1 /++ 2 A web view wrapper. Uses CEF on Linux and WebView2 on Windows. 3 4 Microsoft WebView2 is fairly stable and is unlikely to break, but CEF 5 is not remotely stable and likely to break every release. You'll have 6 to get the same version as me to use this unless you want to generate 7 your own bindings (procedure found in the file comments). Details below. 8 9 10 I currently built against 95.7.17+g4208276+chromium-95.0.4638.69 and it 11 uses UTF-16 strings. 12 13 Then to install the cef put in the Resources in the RElease directory and 14 copy the locales to /opt/cef/Resources/Locales 15 16 You can download compatible builds from https://cef-builds.spotifycdn.com/index.html 17 just make sure to put in the version filter and check "all builds" to match it. 18 19 You do NOT actually need the cef to build the application, but it must be 20 on the user's machine to run it. It looks in /opt/cef/ on Linux. 21 22 Work in progress. DO NOT USE YET as I am prolly gonna break everything too. 23 24 On Windows, you need to distribute the WebView2Loader.dll with your exe. That 25 is found in the web view 2 sdk. Furthermore, users will have to install the runtime. 26 27 Please note; the Microsoft terms and conditions say they may be able to collect 28 information about your users if you use this on Windows. 29 see: https://developer.microsoft.com/en-us/microsoft-edge/webview2/ 30 31 32 +/ 33 module arsd.webview; 34 35 enum WebviewEngine { 36 none, 37 cef, 38 wv2, 39 webkit_gtk 40 } 41 // see activeEngine which is an enum you can static if on 42 43 44 // I might recover this gtk thing but i don't like gtk 45 // dmdi webview -version=linux_gtk -version=Demo 46 47 // the setup link for Microsoft: 48 // https://go.microsoft.com/fwlink/p/?LinkId=2124703 49 50 51 version(Windows) { 52 import arsd.simpledisplay; 53 import arsd.com; 54 import core.atomic; 55 56 //import std.stdio; 57 58 T callback(T)(typeof(&T.init.Invoke) dg) { 59 return new class T { 60 extern(Windows): 61 62 static if(is(typeof(T.init.Invoke) R == return)) 63 static if(is(typeof(T.init.Invoke) P == __parameters)) 64 override R Invoke(P _args_) { 65 return dg(_args_); 66 } 67 68 override HRESULT QueryInterface(const (IID)*riid, LPVOID *ppv) { 69 if (IID_IUnknown == *riid) { 70 *ppv = cast(void*) cast(IUnknown) this; 71 } 72 else if (T.iid == *riid) { 73 *ppv = cast(void*) cast(T) this; 74 } 75 else { 76 *ppv = null; 77 return E_NOINTERFACE; 78 } 79 80 AddRef(); 81 return NOERROR; 82 } 83 84 shared LONG count = 0; 85 ULONG AddRef() { 86 return atomicOp!"+="(count, 1); 87 } 88 ULONG Release() { 89 return atomicOp!"-="(count, 1); 90 } 91 }; 92 } 93 94 enum activeEngine = WebviewEngine.wv2; 95 96 struct RC(T) { 97 private T object; 98 this(T t) { 99 object = t; 100 object.AddRef(); 101 } 102 this(this) { 103 if(object is null) return; 104 object.AddRef(); 105 } 106 ~this() { 107 if(object is null) return; 108 object.Release(); 109 object = null; 110 } 111 112 void opAssign(T obj) { 113 obj.AddRef(); 114 if(object) 115 object.Release(); 116 this.object = obj; 117 } 118 119 T raw() { return object; } 120 121 T returnable() { 122 if(object is null) return null; 123 return object; 124 } 125 126 T passable() { 127 if(object is null) return null; 128 object.AddRef(); 129 return object; 130 } 131 132 static foreach(memberName; __traits(derivedMembers, T)) { 133 mixin ForwardMethod!(memberName); 134 } 135 } 136 137 extern(Windows) 138 alias StringMethod = int delegate(wchar**); 139 140 string toGC(scope StringMethod dg) { 141 wchar* t; 142 auto res = dg(&t); 143 if(res != S_OK) 144 throw new ComException(res); 145 146 auto ot = t; 147 148 string s; 149 150 // FIXME: encode properly in UTF-8 151 while(*t) { 152 s ~= *t; 153 t++; 154 } 155 156 auto ret = s; 157 158 CoTaskMemFree(ot); 159 160 return ret; 161 } 162 163 class ComException : Exception { 164 HRESULT errorCode; 165 this(HRESULT errorCode) { 166 import std.format; 167 super(format("HRESULT: 0x%08x", errorCode)); 168 // FIXME: call FormatMessage 169 } 170 } 171 172 mixin template ForwardMethod(string methodName) { 173 static if(methodName.length > 4 && methodName[0 .. 4] == "put_") { 174 static if(is(typeof(__traits(getMember, T, memberName)) Params == function)) 175 private alias Type = Params[0]; 176 mixin(q{ @property void } ~ memberName[4 .. $] ~ q{(Type v) { 177 auto errorCode = __traits(getMember, object, memberName)(v); 178 if(errorCode) 179 throw new ComException(errorCode); 180 } 181 }); 182 } else 183 static if(methodName.length > 4 && methodName[0 .. 4] == "get_") { 184 static if(is(typeof(__traits(getMember, T, memberName)) Params == function)) 185 private alias Type = typeof(*(Params[0].init)); 186 mixin(q{ @property Type } ~ memberName[4 .. $] ~ q{() { 187 Type response; 188 auto errorCode = __traits(getMember, object, memberName)(&response); 189 if(errorCode) 190 throw new ComException(errorCode); 191 return response; 192 } 193 }); 194 } else 195 static if(methodName.length > 4 && methodName[0 .. 4] == "add_") { 196 static if(is(typeof(__traits(getMember, T, memberName)) Params == function)) 197 alias Handler = Params[0]; 198 alias HandlerDg = typeof(&Handler.init.Invoke); 199 mixin(q{ EventRegistrationToken } ~ memberName ~ q{ (HandlerDg handler) { 200 EventRegistrationToken token; 201 __traits(getMember, object, memberName)(callback!Handler(handler), &token); 202 return token; 203 }}); 204 } else 205 static if(methodName.length > 7 && methodName[0 .. 4] == "remove_") { 206 mixin(q{ void } ~ memberName ~ q{ (EventRegistrationToken token) { 207 __traits(getMember, object, memberName)(token); 208 }}); 209 } else { 210 // I could do the return value things by looking for these comments: 211 // /+[out]+/ but be warned it is possible or a thing to have multiple out params (only one such function in here though i think) 212 // /+[out, retval]+/ 213 // a find/replace could make them a UDA or something. 214 215 static if(is(typeof(__traits(getMember, T, memberName)) Params == function)) 216 static if(is(typeof(__traits(getMember, T, memberName)) Return == return)) 217 218 mixin(q{ Return } ~ memberName ~ q{ (Params p) { 219 // FIXME: check the return value and throw 220 return __traits(getMember, object, memberName)(p); 221 } 222 }); 223 224 } 225 } 226 227 struct Wv2App { 228 static bool active = false; 229 230 static HRESULT code; 231 static bool initialized = false; 232 static RC!ICoreWebView2Environment webview_env; 233 234 @disable this(this); 235 236 static void delegate(RC!ICoreWebView2Environment)[] pending; 237 this(void delegate(RC!ICoreWebView2Environment) withEnvironment) { 238 if(withEnvironment) 239 pending ~= withEnvironment; 240 241 import core.sys.windows.com; 242 CoInitializeEx(null, COINIT_APARTMENTTHREADED); 243 244 active = true; 245 246 auto lib = LoadLibraryW("WebView2Loader.dll"w.ptr); 247 typeof(&CreateCoreWebView2EnvironmentWithOptions) func; 248 249 if(lib is null) 250 throw new Exception("WebView2Loader.dll unable to load. The developer should bundle this with the application exe. It is found with the WebView2 SDK from nuget."); 251 func = cast(typeof(func)) GetProcAddress(lib, CreateCoreWebView2EnvironmentWithOptions.mangleof); 252 if(func is null) 253 throw new Exception("CreateCoreWebView2EnvironmentWithOptions failed from WebView2Loader..."); 254 255 auto result = func(null, null, null, 256 callback!(ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler)( 257 delegate(error, env) { 258 initialized = true; 259 code = error; 260 261 if(error) 262 return error; 263 264 webview_env = env; 265 266 auto len = pending.length; 267 foreach(item; pending) { 268 item(webview_env); 269 } 270 271 pending = pending[len .. $]; 272 273 return S_OK; 274 } 275 ) 276 ); 277 278 if(result != S_OK) { 279 if(MessageBox(null, "The WebView2 runtime is not installed. Would you like to install it now? This will open a browser to download a file. After it installs, you can try running this program again.", "Missing file", MB_YESNO) == IDYES) { 280 import std.process; 281 browse("https://go.microsoft.com/fwlink/p/?LinkId=2124703"); 282 } 283 throw new ComException(result); 284 } 285 } 286 287 @disable this(); 288 289 ~this() { 290 active = false; 291 } 292 293 static void useEnvironment(void delegate(RC!ICoreWebView2Environment) withEnvironment) { 294 assert(active); 295 assert(withEnvironment !is null); 296 if(initialized) { 297 if(code) 298 throw new ComException(code); 299 withEnvironment(webview_env); 300 } else 301 pending ~= withEnvironment; 302 } 303 } 304 } 305 306 307 308 /+ 309 interface WebView { 310 void refresh(); 311 void back(); 312 void forward(); 313 void stop(); 314 315 void navigate(string url); 316 317 // the url and line are for error reporting purposes 318 void executeJavascript(string code, string url = null, int line = 0); 319 320 void showDevTools(); 321 322 // these are get/set properties that you can subscribe to with some system 323 324 mixin Observable!(string, "title"); 325 mixin Observable!(string, "url"); 326 mixin Observable!(string, "status"); 327 mixin Observable!(int, "loadingProgress"); 328 } 329 +/ 330 331 332 version(linux) { 333 version(linux_gtk) {} else 334 version=cef; 335 } 336 337 338 version(cef) { 339 import arsd.simpledisplay; 340 341 //pragma(lib, "cef"); 342 343 class BrowserProcessHandler : CEF!cef_browser_process_handler_t { 344 override void on_context_initialized() { } 345 346 override void on_before_child_process_launch(RC!cef_command_line_t) { } 347 override void on_schedule_message_pump_work(long delayMs) { } 348 override cef_client_t* get_default_client() { return null; } 349 } 350 351 352 int cefProcessHelper() { 353 import core.runtime; 354 import core.stdc.stdlib; 355 356 cef_main_args_t main_args; 357 version(linux) { 358 main_args.argc = Runtime.cArgs.argc; 359 main_args.argv = Runtime.cArgs.argv; 360 } else version(Windows) { 361 main_args.instance = GetModuleHandle(null); 362 } 363 364 if(libcef.loadDynamicLibrary()) { 365 int code = libcef.execute_process(&main_args, null, null); 366 if(code >= 0) 367 exit(code); 368 return code; 369 } 370 return -1; 371 } 372 373 shared static this() { 374 cefProcessHelper(); 375 } 376 377 public struct CefApp { 378 static bool active() { 379 return count > 0; 380 } 381 382 private __gshared int count = 0; 383 384 @disable this(this); 385 @disable new(); 386 this(void delegate(cef_settings_t* settings) setSettings) { 387 388 if(!libcef.loadDynamicLibrary()) 389 throw new Exception("failed to load cef dll"); 390 391 count++; 392 393 import core.runtime; 394 import core.stdc.stdlib; 395 396 cef_main_args_t main_args; 397 version(linux) { 398 main_args.argc = Runtime.cArgs.argc; 399 main_args.argv = Runtime.cArgs.argv; 400 } else version(Windows) { 401 main_args.instance = GetModuleHandle(null); 402 } 403 404 cef_settings_t settings; 405 settings.size = cef_settings_t.sizeof; 406 //settings.log_severity = cef_log_severity_t.LOGSEVERITY_DISABLE; // Show only warnings/errors 407 settings.log_severity = cef_log_severity_t.LOGSEVERITY_INFO; // Show only warnings/errors 408 settings.multi_threaded_message_loop = 1; 409 settings.no_sandbox = 1; 410 411 version(linux) 412 settings.locales_dir_path = cef_string_t("/opt/cef/Resources/locales"); 413 414 if(setSettings !is null) 415 setSettings(&settings); 416 417 418 auto app = new class CEF!cef_app_t { 419 BrowserProcessHandler bph; 420 this() { 421 bph = new BrowserProcessHandler(); 422 } 423 override void on_before_command_line_processing(const(cef_string_t)*, RC!cef_command_line_t) {} 424 425 override cef_resource_bundle_handler_t* get_resource_bundle_handler() { 426 return null; 427 } 428 override cef_browser_process_handler_t* get_browser_process_handler() { 429 return bph.returnable; 430 } 431 override cef_render_process_handler_t* get_render_process_handler() { 432 return null; 433 } 434 override void on_register_custom_schemes(cef_scheme_registrar_t*) { 435 436 } 437 }; 438 439 if(!libcef.initialize(&main_args, &settings, app.passable, null)) { 440 throw new Exception("cef_initialize failed"); 441 } 442 } 443 444 ~this() { 445 count--; 446 // this call hangs and idk why. 447 // FIXME 448 //libcef.shutdown(); 449 } 450 } 451 452 453 version(Demo) 454 void main() { 455 auto app = CefApp(null); 456 457 auto window = new SimpleWindow(640, 480, "D Browser", Resizability.allowResizing); 458 flushGui; 459 460 cef_window_info_t window_info; 461 /* 462 window_info.x = 100; 463 window_info.y = 100; 464 window_info.width = 300; 465 window_info.height = 300; 466 */ 467 //window_info.parent_window = window.nativeWindowHandle; 468 469 cef_string_t cef_url = cef_string_t("http://dpldocs.info/");//"http://youtube.com/"w); 470 471 //string url = "http://arsdnet.net/"; 472 //cef_string_utf8_to_utf16(url.ptr, url.length, &cef_url); 473 474 cef_browser_settings_t browser_settings; 475 browser_settings.size = cef_browser_settings_t.sizeof; 476 477 auto client = new MyCefClient(); 478 479 auto got = libcef.browser_host_create_browser(&window_info, client.passable, &cef_url, &browser_settings, null, null); // or _sync 480 481 window.eventLoop(0); 482 } 483 484 485 /++ 486 This gives access to the CEF functions. If you get a linker error for using an undefined function, 487 it is probably because you did NOT go through this when dynamically loading. 488 489 (...similarly, if you get a segfault, it is probably because you DID go through this when static binding.) 490 +/ 491 struct libcef { 492 static __gshared: 493 494 bool isLoaded; 495 bool loadAttempted; 496 void* libHandle; 497 498 /// Make sure you call this only from one thread, probably at process startup. It caches internally and returns true if the load was successful. 499 bool loadDynamicLibrary() { 500 if(loadAttempted) 501 return isLoaded; 502 503 loadAttempted = true; 504 505 version(linux) { 506 import core.sys.posix.dlfcn; 507 libHandle = dlopen("libcef.so", RTLD_NOW); 508 509 static void* loadsym(const char* name) { 510 return dlsym(libHandle, name); 511 } 512 } else version(Windows) { 513 import core.sys.windows.windows; 514 libHandle = LoadLibrary("libcef.dll"); 515 516 static void* loadsym(const char* name) { 517 return GetProcAddress(libHandle, name); 518 } 519 } 520 521 //import std.stdio; 522 if(libHandle is null) { 523 //writeln("libhandlenull"); 524 return false; 525 } 526 foreach(memberName; __traits(allMembers, libcef)[4 .. $]) { // cutting off everything until the actual static foreach below; this trims off isLoaded to loadDynamicLibrary 527 alias mem = __traits(getMember, libcef, memberName); 528 mem = cast(typeof(mem)) loadsym("cef_" ~ memberName); 529 if(mem is null) { 530 // writeln(memberName); 531 // throw new Exception("cef_" ~ memberName ~ " failed to load"); 532 return false; 533 } 534 } 535 536 import core.stdc.string; 537 if(strcmp(libcef.api_hash(1), CEF_API_HASH_UNIVERSAL) != 0) 538 throw new Exception("libcef versions not matching bindings"); 539 540 isLoaded = true; 541 return true; 542 } 543 544 static foreach(memberName; __traits(allMembers, arsd.webview)) 545 static if(is(typeof(__traits(getMember, arsd.webview, memberName)) == function)) 546 static if(memberName.length > 4 && memberName[0 .. 4] == "cef_") { 547 mixin(q{ typeof(&__traits(getMember, arsd.webview, memberName)) } ~ memberName[4 .. $] ~ ";"); // = &" ~ memberName ~ ";"); 548 } 549 } 550 551 } 552 553 version(linux_gtk) 554 version(Demo) 555 void main() { 556 auto wv = new WebView(true, null); 557 wv.navigate("http://dpldocs.info/"); 558 wv.setTitle("omg a D webview"); 559 wv.setSize(500, 500, true); 560 wv.eval("console.log('just testing');"); 561 wv.run(); 562 } 563 564 version(linux_gtk) 565 566 enum activeEngine = WebviewEngine.webkit_gtk; 567 568 /++ 569 570 +/ 571 class WebView : browser_engine { 572 573 /++ 574 Creates a new webview instance. If dbg is non-zero - developer tools will 575 be enabled (if the platform supports them). Window parameter can be a 576 pointer to the native window handle. If it's non-null - then child WebView 577 is embedded into the given parent window. Otherwise a new window is created. 578 Depending on the platform, a GtkWindow, NSWindow or HWND pointer can be 579 passed here. 580 +/ 581 this(bool dbg, void* window) { 582 super(&on_message, dbg, window); 583 } 584 585 extern(C) 586 static void on_message(const char*) {} 587 588 /// Destroys a webview and closes the native window. 589 void destroy() { 590 591 } 592 593 /// Runs the main loop until it's terminated. After this function exits - you 594 /// must destroy the webview. 595 override void run() { super.run(); } 596 597 /// Stops the main loop. It is safe to call this function from another other 598 /// background thread. 599 override void terminate() { super.terminate(); } 600 601 /+ 602 /// Posts a function to be executed on the main thread. You normally do not need 603 /// to call this function, unless you want to tweak the native window. 604 void dispatch(void function(WebView w, void *arg) fn, void *arg) {} 605 +/ 606 607 /// Returns a native window handle pointer. When using GTK backend the pointer 608 /// is GtkWindow pointer, when using Cocoa backend the pointer is NSWindow 609 /// pointer, when using Win32 backend the pointer is HWND pointer. 610 void* getWindow() { return m_window; } 611 612 /// Updates the title of the native window. Must be called from the UI thread. 613 override void setTitle(const char *title) { super.setTitle(title); } 614 615 /// Navigates webview to the given URL. URL may be a data URI. 616 override void navigate(const char *url) { super.navigate(url); } 617 618 /// Injects JavaScript code at the initialization of the new page. Every time 619 /// the webview will open a the new page - this initialization code will be 620 /// executed. It is guaranteed that code is executed before window.onload. 621 override void init(const char *js) { super.init(js); } 622 623 /// Evaluates arbitrary JavaScript code. Evaluation happens asynchronously, also 624 /// the result of the expression is ignored. Use RPC bindings if you want to 625 /// receive notifications about the results of the evaluation. 626 override void eval(const char *js) { super.eval(js); } 627 628 /// Binds a native C callback so that it will appear under the given name as a 629 /// global JavaScript function. Internally it uses webview_init(). Callback 630 /// receives a request string and a user-provided argument pointer. Request 631 /// string is a JSON array of all the arguments passed to the JavaScript 632 /// function. 633 void bind(const char *name, void function(const char *, void *) fn, void *arg) {} 634 635 /// Allows to return a value from the native binding. Original request pointer 636 /// must be provided to help internal RPC engine match requests with responses. 637 /// If status is zero - result is expected to be a valid JSON result value. 638 /// If status is not zero - result is an error JSON object. 639 void webview_return(const char *req, int status, const char *result) {} 640 641 /* 642 void on_message(const char *msg) { 643 auto seq = json_parse(msg, "seq", 0); 644 auto name = json_parse(msg, "name", 0); 645 auto args = json_parse(msg, "args", 0); 646 auto fn = bindings[name]; 647 if (fn == null) { 648 return; 649 } 650 std::async(std::launch::async, [=]() { 651 auto result = (*fn)(args); 652 dispatch([=]() { 653 eval(("var b = window['" + name + "'];b['callbacks'][" + seq + "](" + 654 result + ");b['callbacks'][" + seq + 655 "] = undefined;b['errors'][" + seq + "] = undefined;") 656 .c_str()); 657 }); 658 }); 659 } 660 std::map<std::string, binding_t *> bindings; 661 662 alias binding_t = std::function<std::string(std::string)>; 663 664 void bind(const char *name, binding_t f) { 665 auto js = "(function() { var name = '" + std::string(name) + "';" + R"( 666 window[name] = function() { 667 var me = window[name]; 668 var errors = me['errors']; 669 var callbacks = me['callbacks']; 670 if (!callbacks) { 671 callbacks = {}; 672 me['callbacks'] = callbacks; 673 } 674 if (!errors) { 675 errors = {}; 676 me['errors'] = errors; 677 } 678 var seq = (me['lastSeq'] || 0) + 1; 679 me['lastSeq'] = seq; 680 var promise = new Promise(function(resolve, reject) { 681 callbacks[seq] = resolve; 682 errors[seq] = reject; 683 }); 684 window.external.invoke(JSON.stringify({ 685 name: name, 686 seq:seq, 687 args: Array.prototype.slice.call(arguments), 688 })); 689 return promise; 690 } 691 })())"; 692 init(js.c_str()); 693 bindings[name] = new binding_t(f); 694 } 695 696 */ 697 } 698 699 private extern(C) { 700 alias dispatch_fn_t = void function(); 701 alias msg_cb_t = void function(const char *msg); 702 } 703 704 version(linux_gtk) { 705 706 707 /* Original https://github.com/zserge/webview notice below: 708 * MIT License 709 * 710 * Copyright (c) 2017 Serge Zaitsev 711 * 712 * Permission is hereby granted, free of charge, to any person obtaining a copy 713 * of this software and associated documentation files (the "Software"), to deal 714 * in the Software without restriction, including without limitation the rights 715 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 716 * copies of the Software, and to permit persons to whom the Software is 717 * furnished to do so, subject to the following conditions: 718 * 719 * The above copyright notice and this permission notice shall be included in 720 * all copies or substantial portions of the Software. 721 * 722 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 723 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 724 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 725 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 726 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 727 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 728 * SOFTWARE. 729 */ 730 731 /* 732 Port to D by Adam D. Ruppe, November 30, 2019 733 */ 734 735 736 pragma(lib, "gtk-3"); 737 pragma(lib, "glib-2.0"); 738 pragma(lib, "gobject-2.0"); 739 pragma(lib, "webkit2gtk-4.0"); 740 pragma(lib, "javascriptcoregtk-4.0"); 741 742 private extern(C) { 743 import core.stdc.config; 744 alias GtkWidget = void; 745 enum GtkWindowType { 746 GTK_WINDOW_TOPLEVEL = 0 747 } 748 bool gtk_init_check(int*, char***); 749 GtkWidget* gtk_window_new(GtkWindowType); 750 c_ulong g_signal_connect_data(void*, const char*, void* /* function pointer!!! */, void*, void*, int); 751 GtkWidget* webkit_web_view_new(); 752 alias WebKitUserContentManager = void; 753 WebKitUserContentManager* webkit_web_view_get_user_content_manager(GtkWidget*); 754 755 void gtk_container_add(GtkWidget*, GtkWidget*); 756 void gtk_widget_grab_focus(GtkWidget*); 757 void gtk_widget_show_all(GtkWidget*); 758 void gtk_main(); 759 void gtk_main_quit(); 760 void webkit_web_view_load_uri(GtkWidget*, const char*); 761 alias WebKitSettings = void; 762 WebKitSettings* webkit_web_view_get_settings(GtkWidget*); 763 void webkit_settings_set_enable_write_console_messages_to_stdout(WebKitSettings*, bool); 764 void webkit_settings_set_enable_developer_extras(WebKitSettings*, bool); 765 void webkit_user_content_manager_register_script_message_handler(WebKitUserContentManager*, const char*); 766 alias JSCValue = void; 767 alias WebKitJavascriptResult = void; 768 JSCValue* webkit_javascript_result_get_js_value(WebKitJavascriptResult*); 769 char* jsc_value_to_string(JSCValue*); 770 void g_free(void*); 771 void webkit_web_view_run_javascript(GtkWidget*, const char*, void*, void*, void*); 772 alias WebKitUserScript = void; 773 void webkit_user_content_manager_add_script(WebKitUserContentManager*, WebKitUserScript*); 774 WebKitUserScript* webkit_user_script_new(const char*, WebKitUserContentInjectedFrames, WebKitUserScriptInjectionTime, const char*, const char*); 775 enum WebKitUserContentInjectedFrames { 776 WEBKIT_USER_CONTENT_INJECT_ALL_FRAMES, 777 WEBKIT_USER_CONTENT_INJECT_TOP_FRAME 778 } 779 enum WebKitUserScriptInjectionTime { 780 WEBKIT_USER_SCRIPT_INJECT_AT_DOCUMENT_START, 781 WEBKIT_USER_SCRIPT_INJECT_AT_DOCUMENT_END 782 } 783 void gtk_window_set_title(GtkWidget*, const char*); 784 785 void gtk_window_set_resizable(GtkWidget*, bool); 786 void gtk_window_set_default_size(GtkWidget*, int, int); 787 void gtk_widget_set_size_request(GtkWidget*, int, int); 788 } 789 790 private class browser_engine { 791 792 static extern(C) 793 void ondestroy (GtkWidget *w, void* arg) { 794 (cast(browser_engine) arg).terminate(); 795 } 796 797 static extern(C) 798 void smr(WebKitUserContentManager* m, WebKitJavascriptResult* r, void* arg) { 799 auto w = cast(browser_engine) arg; 800 JSCValue *value = webkit_javascript_result_get_js_value(r); 801 auto s = jsc_value_to_string(value); 802 w.m_cb(s); 803 g_free(s); 804 } 805 806 this(msg_cb_t cb, bool dbg, void* window) { 807 m_cb = cb; 808 809 gtk_init_check(null, null); 810 m_window = cast(GtkWidget*) window; 811 if (m_window == null) 812 m_window = gtk_window_new(GtkWindowType.GTK_WINDOW_TOPLEVEL); 813 814 g_signal_connect_data(m_window, "destroy", &ondestroy, cast(void*) this, null, 0); 815 816 m_webview = webkit_web_view_new(); 817 WebKitUserContentManager* manager = webkit_web_view_get_user_content_manager(m_webview); 818 819 g_signal_connect_data(manager, "script-message-received::external", &smr, cast(void*) this, null, 0); 820 webkit_user_content_manager_register_script_message_handler(manager, "external"); 821 init("window.external={invoke:function(s){window.webkit.messageHandlers.external.postMessage(s);}}"); 822 823 gtk_container_add(m_window, m_webview); 824 gtk_widget_grab_focus(m_webview); 825 826 if (dbg) { 827 WebKitSettings *settings = webkit_web_view_get_settings(m_webview); 828 webkit_settings_set_enable_write_console_messages_to_stdout(settings, true); 829 webkit_settings_set_enable_developer_extras(settings, true); 830 } 831 832 gtk_widget_show_all(m_window); 833 } 834 void run() { gtk_main(); } 835 void terminate() { gtk_main_quit(); } 836 837 void navigate(const char *url) { 838 webkit_web_view_load_uri(m_webview, url); 839 } 840 841 void setTitle(const char* title) { 842 gtk_window_set_title(m_window, title); 843 } 844 845 /+ 846 void dispatch(std::function<void()> f) { 847 g_idle_add_full(G_PRIORITY_HIGH_IDLE, (GSourceFunc)([](void *f) -> int { 848 (*static_cast<dispatch_fn_t *>(f))(); 849 return G_SOURCE_REMOVE; 850 }), 851 new std::function<void()>(f), 852 [](void *f) { delete static_cast<dispatch_fn_t *>(f); }); 853 } 854 +/ 855 856 void setSize(int width, int height, bool resizable) { 857 gtk_window_set_resizable(m_window, resizable); 858 if (resizable) { 859 gtk_window_set_default_size(m_window, width, height); 860 } 861 gtk_widget_set_size_request(m_window, width, height); 862 } 863 864 void init(const char *js) { 865 WebKitUserContentManager *manager = webkit_web_view_get_user_content_manager(m_webview); 866 webkit_user_content_manager_add_script( 867 manager, webkit_user_script_new( 868 js, WebKitUserContentInjectedFrames.WEBKIT_USER_CONTENT_INJECT_TOP_FRAME, 869 WebKitUserScriptInjectionTime.WEBKIT_USER_SCRIPT_INJECT_AT_DOCUMENT_START, null, null)); 870 } 871 872 void eval(const char *js) { 873 webkit_web_view_run_javascript(m_webview, js, null, null, null); 874 } 875 876 protected: 877 GtkWidget* m_window; 878 GtkWidget* m_webview; 879 msg_cb_t m_cb; 880 } 881 } else version(WEBVIEW_COCOA) { 882 /+ 883 884 // 885 // ==================================================================== 886 // 887 // This implementation uses Cocoa WKWebView backend on macOS. It is 888 // written using ObjC runtime and uses WKWebView class as a browser runtime. 889 // You should pass "-framework Webkit" flag to the compiler. 890 // 891 // ==================================================================== 892 // 893 894 #define OBJC_OLD_DISPATCH_PROTOTYPES 1 895 #include <CoreGraphics/CoreGraphics.h> 896 #include <objc/objc-runtime.h> 897 898 #define NSBackingStoreBuffered 2 899 900 #define NSWindowStyleMaskResizable 8 901 #define NSWindowStyleMaskMiniaturizable 4 902 #define NSWindowStyleMaskTitled 1 903 #define NSWindowStyleMaskClosable 2 904 905 #define NSApplicationActivationPolicyRegular 0 906 907 #define WKUserScriptInjectionTimeAtDocumentStart 0 908 909 id operator"" _cls(const char *s, std::size_t sz) { 910 return (id)objc_getClass(s); 911 } 912 SEL operator"" _sel(const char *s, std::size_t sz) { 913 return sel_registerName(s); 914 } 915 id operator"" _str(const char *s, std::size_t sz) { 916 return objc_msgSend("NSString"_cls, "stringWithUTF8String:"_sel, s); 917 } 918 919 class browser_engine { 920 public: 921 browser_engine(msg_cb_t cb, bool dbg, void *window) : m_cb(cb) { 922 // Application 923 id app = objc_msgSend("NSApplication"_cls, "sharedApplication"_sel); 924 objc_msgSend(app, "setActivationPolicy:"_sel, 925 NSApplicationActivationPolicyRegular); 926 927 // Delegate 928 auto cls = objc_allocateClassPair((Class) "NSObject"_cls, "AppDelegate", 0); 929 class_addProtocol(cls, objc_getProtocol("NSApplicationDelegate")); 930 class_addProtocol(cls, objc_getProtocol("WKScriptMessageHandler")); 931 class_addMethod( 932 cls, "applicationShouldTerminateAfterLastWindowClosed:"_sel, 933 (IMP)(+[](id self, SEL cmd, id notification) -> BOOL { return 1; }), 934 "c@:@"); 935 class_addMethod( 936 cls, "userContentController:didReceiveScriptMessage:"_sel, 937 (IMP)(+[](id self, SEL cmd, id notification, id msg) { 938 auto w = (browser_engine *)objc_getAssociatedObject(self, "webview"); 939 w->m_cb((const char *)objc_msgSend(objc_msgSend(msg, "body"_sel), 940 "UTF8String"_sel)); 941 }), 942 "v@:@@"); 943 objc_registerClassPair(cls); 944 945 auto delegate = objc_msgSend((id)cls, "new"_sel); 946 objc_setAssociatedObject(delegate, "webview", (id)this, 947 OBJC_ASSOCIATION_ASSIGN); 948 objc_msgSend(app, sel_registerName("setDelegate:"), delegate); 949 950 // Main window 951 if (window is null) { 952 m_window = objc_msgSend("NSWindow"_cls, "alloc"_sel); 953 m_window = objc_msgSend( 954 m_window, "initWithContentRect:styleMask:backing:defer:"_sel, 955 CGRectMake(0, 0, 0, 0), 0, NSBackingStoreBuffered, 0); 956 setSize(480, 320, true); 957 } else { 958 m_window = (id)window; 959 } 960 961 // Webview 962 auto config = objc_msgSend("WKWebViewConfiguration"_cls, "new"_sel); 963 m_manager = objc_msgSend(config, "userContentController"_sel); 964 m_webview = objc_msgSend("WKWebView"_cls, "alloc"_sel); 965 objc_msgSend(m_webview, "initWithFrame:configuration:"_sel, 966 CGRectMake(0, 0, 0, 0), config); 967 objc_msgSend(m_manager, "addScriptMessageHandler:name:"_sel, delegate, 968 "external"_str); 969 init(R"script( 970 window.external = { 971 invoke: function(s) { 972 window.webkit.messageHandlers.external.postMessage(s); 973 }, 974 }; 975 )script"); 976 if (dbg) { 977 objc_msgSend(objc_msgSend(config, "preferences"_sel), 978 "setValue:forKey:"_sel, 1, "developerExtrasEnabled"_str); 979 } 980 objc_msgSend(m_window, "setContentView:"_sel, m_webview); 981 objc_msgSend(m_window, "makeKeyAndOrderFront:"_sel, null); 982 } 983 ~browser_engine() { close(); } 984 void terminate() { close(); objc_msgSend("NSApp"_cls, "terminate:"_sel, null); } 985 void run() { 986 id app = objc_msgSend("NSApplication"_cls, "sharedApplication"_sel); 987 dispatch([&]() { objc_msgSend(app, "activateIgnoringOtherApps:"_sel, 1); }); 988 objc_msgSend(app, "run"_sel); 989 } 990 void dispatch(std::function<void()> f) { 991 dispatch_async_f(dispatch_get_main_queue(), new dispatch_fn_t(f), 992 (dispatch_function_t)([](void *arg) { 993 auto f = static_cast<dispatch_fn_t *>(arg); 994 (*f)(); 995 delete f; 996 })); 997 } 998 void setTitle(const char *title) { 999 objc_msgSend( 1000 m_window, "setTitle:"_sel, 1001 objc_msgSend("NSString"_cls, "stringWithUTF8String:"_sel, title)); 1002 } 1003 void setSize(int width, int height, bool resizable) { 1004 auto style = NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | 1005 NSWindowStyleMaskMiniaturizable; 1006 if (resizable) { 1007 style = style | NSWindowStyleMaskResizable; 1008 } 1009 objc_msgSend(m_window, "setStyleMask:"_sel, style); 1010 objc_msgSend(m_window, "setFrame:display:animate:"_sel, 1011 CGRectMake(0, 0, width, height), 1, 0); 1012 } 1013 void navigate(const char *url) { 1014 auto nsurl = objc_msgSend( 1015 "NSURL"_cls, "URLWithString:"_sel, 1016 objc_msgSend("NSString"_cls, "stringWithUTF8String:"_sel, url)); 1017 objc_msgSend( 1018 m_webview, "loadRequest:"_sel, 1019 objc_msgSend("NSURLRequest"_cls, "requestWithURL:"_sel, nsurl)); 1020 } 1021 void init(const char *js) { 1022 objc_msgSend( 1023 m_manager, "addUserScript:"_sel, 1024 objc_msgSend( 1025 objc_msgSend("WKUserScript"_cls, "alloc"_sel), 1026 "initWithSource:injectionTime:forMainFrameOnly:"_sel, 1027 objc_msgSend("NSString"_cls, "stringWithUTF8String:"_sel, js), 1028 WKUserScriptInjectionTimeAtDocumentStart, 1)); 1029 } 1030 void eval(const char *js) { 1031 objc_msgSend(m_webview, "evaluateJavaScript:completionHandler:"_sel, 1032 objc_msgSend("NSString"_cls, "stringWithUTF8String:"_sel, js), 1033 null); 1034 } 1035 1036 protected: 1037 void close() { objc_msgSend(m_window, "close"_sel); } 1038 id m_window; 1039 id m_webview; 1040 id m_manager; 1041 msg_cb_t m_cb; 1042 }; 1043 1044 +/ 1045 1046 } 1047 1048 version(cef) { 1049 1050 /++ 1051 This creates a base class for a thing to help you implement the function pointers. 1052 1053 class MyApp : CEF!cef_app_t { 1054 1055 } 1056 +/ 1057 abstract class CEF(Base) { 1058 private struct Inner { 1059 Base c; 1060 CEF d_object; 1061 } 1062 private Inner inner; 1063 1064 this() { 1065 if(!__ctfe) construct(); 1066 } 1067 1068 // ONLY call this if you did a ctfe construction 1069 void construct() { 1070 assert(inner.c.base.size == 0); 1071 1072 import core.memory; 1073 GC.addRoot(cast(void*) this); 1074 inner.c.base.size = Inner.sizeof; 1075 inner.c.base.add_ref = &c_add_ref; 1076 inner.c.base.release = &c_release; 1077 inner.c.base.has_one_ref = &c_has_one_ref; 1078 inner.c.base.has_at_least_one_ref = &c_has_at_least_one_ref; 1079 inner.d_object = this; 1080 1081 static foreach(memberName; __traits(allMembers, Base)) { 1082 static if(is(typeof(__traits(getMember, Base, memberName)) == return)) { 1083 __traits(getMember, inner.c, memberName) = mixin("&c_" ~ memberName); 1084 } 1085 } 1086 } 1087 1088 private static nothrow @nogc extern(System) { 1089 void c_add_ref(cef_base_ref_counted_t* self) { 1090 return ((cast(Inner*) self).d_object).add_ref(); 1091 } 1092 int c_release(cef_base_ref_counted_t* self) { 1093 return ((cast(Inner*) self).d_object).release(); 1094 } 1095 int c_has_one_ref(cef_base_ref_counted_t* self) { 1096 return ((cast(Inner*) self).d_object).has_one_ref(); 1097 } 1098 int c_has_at_least_one_ref(cef_base_ref_counted_t* self) { 1099 return ((cast(Inner*) self).d_object).has_at_least_one_ref(); 1100 } 1101 } 1102 1103 private shared(int) refcount = 1; 1104 final void add_ref() { 1105 import core.atomic; 1106 atomicOp!"+="(refcount, 1); 1107 } 1108 final int release() { 1109 import core.atomic; 1110 auto v = atomicOp!"-="(refcount, 1); 1111 if(v == 0) { 1112 import core.memory; 1113 GC.removeRoot(cast(void*) this); 1114 return 1; 1115 } 1116 return 0; 1117 } 1118 final int has_one_ref() { 1119 return (cast() refcount) == 1; 1120 } 1121 final int has_at_least_one_ref() { 1122 return (cast() refcount) >= 1; 1123 } 1124 1125 /// Call this to pass to CEF. It will add ref for you. 1126 final Base* passable() { 1127 assert(inner.c.base.size); 1128 add_ref(); 1129 return returnable(); 1130 } 1131 1132 final Base* returnable() { 1133 assert(inner.c.base.size); 1134 return &inner.c; 1135 } 1136 1137 static foreach(memberName; __traits(allMembers, Base)) { 1138 static if(is(typeof(__traits(getMember, Base, memberName)) == return)) { 1139 mixin AbstractMethod!(memberName); 1140 } else { 1141 mixin(q{final ref @property } ~ memberName ~ q{() { return __traits(getMember, inner.c, memberName); }}); 1142 } 1143 } 1144 } 1145 1146 // you implement this in D... 1147 private mixin template AbstractMethod(string name) { 1148 alias ptr = typeof(__traits(getMember, Base, name)); 1149 static if(is(ptr Return == return)) 1150 static if(is(typeof(*ptr) Params == function)) 1151 { 1152 mixin(q{abstract nothrow Return } ~ name ~ q{(CefToD!(Params[1 .. $]) p);}); 1153 // mixin(q{abstract nothrow Return } ~ name ~ q{(Params[1 .. $] p);}); 1154 1155 mixin(q{ 1156 private static nothrow extern(System) 1157 Return c_}~name~q{(Params p) { 1158 Base* self = p[0]; // a bit of a type check here... 1159 auto dobj = (cast(Inner*) self).d_object; // ...before this cast. 1160 1161 //return __traits(getMember, dobj, name)(p[1 .. $]); 1162 mixin(() { 1163 string code = "return __traits(getMember, dobj, name)("; 1164 1165 static foreach(idx; 1 .. p.length) { 1166 if(idx > 1) 1167 code ~= ", "; 1168 code ~= "cefToD(p[" ~ idx.stringof ~ "])"; 1169 } 1170 code ~= ");"; 1171 return code; 1172 }()); 1173 } 1174 }); 1175 } 1176 else static assert(0, name ~ " params"); 1177 else static assert(0, name ~ " return"); 1178 } 1179 1180 // you call this from D... 1181 private mixin template ForwardMethod(string name) { 1182 alias ptr = typeof(__traits(getMember, Base, name)); 1183 static if(is(ptr Return == return)) 1184 static if(is(typeof(*ptr) Params == function)) 1185 { 1186 mixin(q{nothrow auto } ~ name ~ q{(Params[1 .. $] p) { 1187 Base* self = inner; // a bit of a type check here... 1188 static if(is(Return == void)) 1189 return __traits(getMember, inner, name)(self, p); 1190 else 1191 return cefToD(__traits(getMember, inner, name)(self, p)); 1192 }}); 1193 } 1194 else static assert(0, name ~ " params"); 1195 else static assert(0, name ~ " return"); 1196 } 1197 1198 1199 private alias AliasSeq(T...) = T; 1200 1201 private template CefToD(T...) { 1202 static if(T.length == 0) { 1203 alias CefToD = T; 1204 } else static if(T.length == 1) { 1205 static if(is(typeof(T[0].base) == cef_base_ref_counted_t)) { 1206 alias CefToD = RC!(typeof(*T[0])); 1207 /+ 1208 static if(is(T[0] == I*, I)) { 1209 alias CefToD = CEF!(I); 1210 } else static assert(0, T[0]); 1211 +/ 1212 } else 1213 alias CefToD = T[0]; 1214 } else { 1215 alias CefToD = AliasSeq!(CefToD!(T[0]), CefToD!(T[1..$])); 1216 1217 } 1218 } 1219 1220 enum activeEngine = WebviewEngine.cef; 1221 1222 struct RC(Base) { 1223 private Base* inner; 1224 1225 this(Base* t) nothrow { 1226 inner = t; 1227 // assuming the refcount is already set here 1228 } 1229 this(this) nothrow { 1230 if(inner is null) return; 1231 inner.base.add_ref(&inner.base); 1232 } 1233 ~this() nothrow { 1234 if(inner is null) return; 1235 inner.base.release(&inner.base); 1236 inner = null; 1237 } 1238 bool opCast(T:bool)() nothrow { 1239 return inner !is null; 1240 } 1241 1242 Base* getRawPointer() nothrow { 1243 return inner; 1244 } 1245 1246 Base* passable() nothrow { 1247 if(inner is null) 1248 return inner; 1249 1250 inner.base.add_ref(&inner.base); 1251 return inner; 1252 } 1253 1254 static foreach(memberName; __traits(allMembers, Base)) { 1255 static if(is(typeof(__traits(getMember, Base, memberName)) == return)) { 1256 mixin ForwardMethod!(memberName); 1257 } else { 1258 mixin(q{final ref @property } ~ memberName ~ q{() { return __traits(getMember, inner, memberName); }}); 1259 } 1260 } 1261 } 1262 1263 auto cefToD(T)(T t) { 1264 static if(is(typeof(T.base) == cef_base_ref_counted_t)) { 1265 return RC!(typeof(*T))(t); 1266 } else { 1267 return t; 1268 } 1269 } 1270 1271 1272 string toGC(const cef_string_utf16_t str) nothrow { 1273 if(str.str is null) 1274 return null; 1275 1276 string s; 1277 s.reserve(str.length); 1278 1279 try 1280 foreach(char ch; str.str[0 .. str.length]) 1281 s ~= ch; 1282 catch(Exception e) {} 1283 return s; 1284 } 1285 1286 string toGC(const cef_string_utf16_t* str) nothrow { 1287 if(str is null) 1288 return null; 1289 return toGC(*str); 1290 } 1291 1292 string toGCAndFree(const cef_string_userfree_t str) nothrow { 1293 if(str is null) 1294 return null; 1295 1296 string s = toGC(str); 1297 libcef.string_userfree_utf16_free(str); 1298 //str = null; 1299 return s; 1300 } 1301 1302 // bindings follow, first some hand-written ones for Linux, then some machine translated things. More comments about the machine translation when it comes. 1303 1304 version(linux) 1305 struct cef_main_args_t { 1306 int argc; 1307 char** argv; 1308 } 1309 version(Windows) 1310 struct cef_main_args_t { 1311 HINSTANCE instance; 1312 } 1313 1314 // 0 - CEF_VERSION_MAJOR 1315 // 1 - CEF_VERSION_MINOR 1316 // 2 - CEF_VERSION_PATCH 1317 // 3 - CEF_COMMIT_NUMBER 1318 // 4 - CHROME_VERSION_MAJOR 1319 // 5 - CHROME_VERSION_MINOR 1320 // 6 - CHROME_VERSION_BUILD 1321 // 7 - CHROME_VERSION_PATCH 1322 1323 extern(C) nothrow 1324 int cef_string_utf8_to_utf16(const char* src, size_t src_len, cef_string_utf16_t* output); 1325 1326 struct cef_string_utf8_t { 1327 char* str; 1328 size_t length; 1329 void* dtor;// void (*dtor)(char* str); 1330 } 1331 1332 1333 1334 struct cef_string_utf16_t { 1335 char16* str; 1336 size_t length; 1337 void* dtor; // voiod (*dtor)(char16* str); 1338 1339 this(wstring s) nothrow { 1340 this.str = cast(char16*) s.ptr; 1341 this.length = s.length; 1342 } 1343 1344 this(string s) nothrow { 1345 libcef.string_utf8_to_utf16(s.ptr, s.length, &this); 1346 } 1347 } 1348 1349 alias cef_string_t = cef_string_utf16_t; 1350 alias cef_window_handle_t = NativeWindowHandle; 1351 version(Windows) 1352 alias cef_cursor_handle_t = HCURSOR; 1353 else 1354 alias cef_cursor_handle_t = XID; 1355 1356 struct cef_time_t { 1357 int year; // Four or five digit year "2007" (1601 to 30827 on 1358 // Windows, 1970 to 2038 on 32-bit POSIX) 1359 int month; // 1-based month (values 1 = January, etc.) 1360 int day_of_week; // 0-based day of week (0 = Sunday, etc.) 1361 int day_of_month; // 1-based day of month (1-31) 1362 int hour; // Hour within the current day (0-23) 1363 int minute; // Minute within the current hour (0-59) 1364 int second; // Second within the current minute (0-59 plus leap 1365 // seconds which may take it up to 60). 1366 int millisecond; // Milliseconds within the current second (0-999) 1367 } 1368 1369 version(linux) 1370 struct cef_window_info_t { 1371 cef_string_t window_name; 1372 1373 uint x; 1374 uint y; 1375 uint width; 1376 uint height; 1377 1378 cef_window_handle_t parent_window; 1379 1380 int windowless_rendering_enabled; 1381 1382 int shared_texture_enabled; 1383 1384 int external_begin_frame_enabled; 1385 1386 cef_window_handle_t window; 1387 } 1388 1389 version(Windows) 1390 struct cef_window_info_t { 1391 DWORD ex_style; 1392 cef_string_t window_name; 1393 DWORD style; 1394 cef_rect_t bounds; 1395 cef_window_handle_t parent_window; 1396 HMENU menu; 1397 int windowless_rendering_enabled; 1398 int shared_texture_enabled; 1399 int external_begin_frame_enabled; 1400 cef_window_handle_t window; 1401 } 1402 1403 1404 1405 import core.stdc.config; 1406 alias int16 = short; 1407 alias uint16 = ushort; 1408 alias int32 = int; 1409 alias uint32 = uint; 1410 alias char16 = wchar; 1411 alias int64 = long; 1412 alias uint64 = ulong; 1413 1414 // these are supposed to just be opaque pointers but i want some type safety. this same abi wise.......... RIGHT? 1415 struct cef_string_list_t { void* r; } 1416 struct cef_string_multimap_t { void* r; } 1417 struct cef_string_map_t { void* r; } 1418 1419 1420 extern(C) nothrow { 1421 cef_string_list_t cef_string_list_alloc(); 1422 size_t cef_string_list_size(cef_string_list_t list); 1423 int cef_string_list_value(cef_string_list_t list, size_t index, cef_string_t* value); 1424 void cef_string_list_append(cef_string_list_t list, const cef_string_t* value); 1425 void cef_string_list_clear(cef_string_list_t list); 1426 void cef_string_list_free(cef_string_list_t list); 1427 cef_string_list_t cef_string_list_copy(cef_string_list_t list); 1428 } 1429 1430 1431 version(linux) { 1432 import core.sys.posix.sys.types; 1433 alias pid_t cef_platform_thread_id_t; 1434 alias OS_EVENT = XEvent; 1435 } else { 1436 import core.sys.windows.windows; 1437 alias HANDLE cef_platform_thread_id_t; 1438 alias OS_EVENT = void; 1439 } 1440 1441 nothrow @nogc extern(C) void cef_string_userfree_utf16_free(const cef_string_userfree_utf16_t str); 1442 struct cef_string_userfree_utf16_t { cef_string_utf16_t* it; alias it this; } 1443 alias cef_string_userfree_t = cef_string_userfree_utf16_t; 1444 1445 // ************** 1446 1447 // cef/include/capi$ for i in *.h; do dstep -I../.. $i; done 1448 // also dstep include/cef_version.h 1449 // update the CEF_VERSION and the CEF_API_HASH_UNIVERSAL out of cef_version.h and cef_api_hash.h 1450 // then concatenate the bodies of them and delete the translated macros and `struct .*;` stuff 1451 // then I added nothrow to all function pointers with a vim macro (`/function (<ENTER>e%a nothrow<ESC>` then just hold in @ to do the @@ repeat macro command until it was done 1452 // then select all and global replace s/_cef/cef/g 1453 // then delete the pointless aliases find with `/alias \(.*\) = \1;` and delete with 2dd. macros can do the job or just simple global replace to nothing. blank lines don't matter. 1454 1455 // and make sure version(linux) void cef_register_widevine_cdm ( if it is there. 1456 1457 // and extern (C) is wrong on the callbacks, they should all be extern(System) 1458 // `/function (<ENTER>Oextern(System)<ESC>` 1459 1460 1461 version=embedded_cef_bindings; 1462 1463 // everything inside these brackets are the bindings you can replace if update needed 1464 1465 version(embedded_cef_bindings) { 1466 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 1467 // 1468 // Redistribution and use in source and binary forms, with or without 1469 // modification, are permitted provided that the following conditions are 1470 // met: 1471 // 1472 // * Redistributions of source code must retain the above copyright 1473 // notice, this list of conditions and the following disclaimer. 1474 // * Redistributions in binary form must reproduce the above 1475 // copyright notice, this list of conditions and the following disclaimer 1476 // in the documentation and/or other materials provided with the 1477 // distribution. 1478 // * Neither the name of Google Inc. nor the name Chromium Embedded 1479 // Framework nor the names of its contributors may be used to endorse 1480 // or promote products derived from this software without specific prior 1481 // written permission. 1482 // 1483 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1484 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 1485 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 1486 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 1487 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 1488 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 1489 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 1490 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 1491 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 1492 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 1493 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 1494 // 1495 // --------------------------------------------------------------------------- 1496 // 1497 // This file was generated by the make_version_header.py tool. 1498 // 1499 1500 extern (C): 1501 1502 enum CEF_VERSION = "95.7.17+g4208276+chromium-95.0.4638.69"; 1503 enum CEF_VERSION_MAJOR = 95; 1504 enum CEF_VERSION_MINOR = 7; 1505 enum CEF_VERSION_PATCH = 17; 1506 enum CEF_COMMIT_NUMBER = 2459; 1507 enum CEF_COMMIT_HASH = "4208276762b1f52ed444debd7caa84fc3332e6a9"; 1508 enum COPYRIGHT_YEAR = 2021; 1509 1510 enum CHROME_VERSION_MAJOR = 95; 1511 enum CHROME_VERSION_MINOR = 0; 1512 enum CHROME_VERSION_BUILD = 4638; 1513 enum CHROME_VERSION_PATCH = 69; 1514 1515 1516 1517 // Returns CEF version information for the libcef library. The |entry| 1518 // parameter describes which version component will be returned: 1519 // 0 - CEF_VERSION_MAJOR 1520 // 1 - CEF_VERSION_MINOR 1521 // 2 - CEF_VERSION_PATCH 1522 // 3 - CEF_COMMIT_NUMBER 1523 // 4 - CHROME_VERSION_MAJOR 1524 // 5 - CHROME_VERSION_MINOR 1525 // 6 - CHROME_VERSION_BUILD 1526 // 7 - CHROME_VERSION_PATCH 1527 /// 1528 int cef_version_info (int entry); 1529 1530 // APSTUDIO_HIDDEN_SYMBOLS 1531 1532 // CEF_INCLUDE_CEF_VERSION_H_ 1533 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 1534 // 1535 // Redistribution and use in source and binary forms, with or without 1536 // modification, are permitted provided that the following conditions are 1537 // met: 1538 // 1539 // * Redistributions of source code must retain the above copyright 1540 // notice, this list of conditions and the following disclaimer. 1541 // * Redistributions in binary form must reproduce the above 1542 // copyright notice, this list of conditions and the following disclaimer 1543 // in the documentation and/or other materials provided with the 1544 // distribution. 1545 // * Neither the name of Google Inc. nor the name Chromium Embedded 1546 // Framework nor the names of its contributors may be used to endorse 1547 // or promote products derived from this software without specific prior 1548 // written permission. 1549 // 1550 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1551 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 1552 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 1553 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 1554 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 1555 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 1556 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 1557 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 1558 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 1559 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 1560 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 1561 // 1562 // --------------------------------------------------------------------------- 1563 // 1564 // This file was generated by the make_api_hash_header.py tool. 1565 // 1566 1567 extern (C): 1568 1569 // The API hash is created by analyzing CEF header files for C API type 1570 // definitions. The hash value will change when header files are modified in a 1571 // way that may cause binary incompatibility with other builds. The universal 1572 // hash value will change if any platform is affected whereas the platform hash 1573 // values will change only if that particular platform is affected. 1574 enum CEF_API_HASH_UNIVERSAL = "21ac25aebdb49a8e8088c6fbee802b04fd07b501"; 1575 1576 enum CEF_API_HASH_PLATFORM = "0b5227787444955a548b7544b2cdcda95a354506"; 1577 1578 /// 1579 // Returns CEF API hashes for the libcef library. The returned string is owned 1580 // by the library and should not be freed. The |entry| parameter describes which 1581 // hash value will be returned: 1582 // 0 - CEF_API_HASH_PLATFORM 1583 // 1 - CEF_API_HASH_UNIVERSAL 1584 // 2 - CEF_COMMIT_HASH (from cef_version.h) 1585 /// 1586 const(char)* cef_api_hash (int entry); 1587 1588 // CEF_INCLUDE_API_HASH_H_ 1589 // Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. 1590 // 1591 // Redistribution and use in source and binary forms, with or without 1592 // modification, are permitted provided that the following conditions are 1593 // met: 1594 // 1595 // * Redistributions of source code must retain the above copyright 1596 // notice, this list of conditions and the following disclaimer. 1597 // * Redistributions in binary form must reproduce the above 1598 // copyright notice, this list of conditions and the following disclaimer 1599 // in the documentation and/or other materials provided with the 1600 // distribution. 1601 // * Neither the name of Google Inc. nor the name Chromium Embedded 1602 // Framework nor the names of its contributors may be used to endorse 1603 // or promote products derived from this software without specific prior 1604 // written permission. 1605 // 1606 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1607 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 1608 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 1609 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 1610 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 1611 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 1612 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 1613 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 1614 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 1615 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 1616 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 1617 1618 extern (C): 1619 1620 /// 1621 // Structure representing a point. 1622 /// 1623 struct cef_point_t 1624 { 1625 int x; 1626 int y; 1627 } 1628 1629 1630 1631 /// 1632 // Structure representing a rectangle. 1633 /// 1634 struct cef_rect_t 1635 { 1636 int x; 1637 int y; 1638 int width; 1639 int height; 1640 } 1641 1642 1643 1644 /// 1645 // Structure representing a size. 1646 /// 1647 struct cef_size_t 1648 { 1649 int width; 1650 int height; 1651 } 1652 1653 1654 1655 /// 1656 // Structure representing insets. 1657 /// 1658 struct cef_insets_t 1659 { 1660 int top; 1661 int left; 1662 int bottom; 1663 int right; 1664 } 1665 1666 1667 1668 // CEF_INCLUDE_INTERNAL_CEF_TYPES_GEOMETRY_H_ 1669 // Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. 1670 // 1671 // Redistribution and use in source and binary forms, with or without 1672 // modification, are permitted provided that the following conditions are 1673 // met: 1674 // 1675 // * Redistributions of source code must retain the above copyright 1676 // notice, this list of conditions and the following disclaimer. 1677 // * Redistributions in binary form must reproduce the above 1678 // copyright notice, this list of conditions and the following disclaimer 1679 // in the documentation and/or other materials provided with the 1680 // distribution. 1681 // * Neither the name of Google Inc. nor the name Chromium Embedded 1682 // Framework nor the names of its contributors may be used to endorse 1683 // or promote products derived from this software without specific prior 1684 // written permission. 1685 // 1686 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1687 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 1688 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 1689 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 1690 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 1691 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 1692 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 1693 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 1694 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 1695 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 1696 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 1697 1698 import core.stdc.limits; 1699 1700 extern (C): 1701 1702 // Bring in platform-specific definitions. 1703 1704 // 32-bit ARGB color value, not premultiplied. The color components are always 1705 // in a known order. Equivalent to the SkColor type. 1706 alias cef_color_t = uint; 1707 1708 // Return the alpha byte from a cef_color_t value. 1709 1710 1711 // Return the red byte from a cef_color_t value. 1712 1713 1714 // Return the green byte from a cef_color_t value. 1715 1716 1717 // Return the blue byte from a cef_color_t value. 1718 1719 1720 // Return an cef_color_t value with the specified byte component values. 1721 1722 1723 // Return an int64 value with the specified low and high int32 component values. 1724 1725 1726 // Return the low int32 value from an int64 value. 1727 1728 1729 // Return the high int32 value from an int64 value. 1730 1731 1732 /// 1733 // Log severity levels. 1734 /// 1735 enum cef_log_severity_t 1736 { 1737 /// 1738 // Default logging (currently INFO logging). 1739 /// 1740 LOGSEVERITY_DEFAULT = 0, 1741 1742 /// 1743 // Verbose logging. 1744 /// 1745 LOGSEVERITY_VERBOSE = 1, 1746 1747 /// 1748 // DEBUG logging. 1749 /// 1750 LOGSEVERITY_DEBUG = LOGSEVERITY_VERBOSE, 1751 1752 /// 1753 // INFO logging. 1754 /// 1755 LOGSEVERITY_INFO = 2, 1756 1757 /// 1758 // WARNING logging. 1759 /// 1760 LOGSEVERITY_WARNING = 3, 1761 1762 /// 1763 // ERROR logging. 1764 /// 1765 LOGSEVERITY_ERROR = 4, 1766 1767 /// 1768 // FATAL logging. 1769 /// 1770 LOGSEVERITY_FATAL = 5, 1771 1772 /// 1773 // Disable logging to file for all messages, and to stderr for messages with 1774 // severity less than FATAL. 1775 /// 1776 LOGSEVERITY_DISABLE = 99 1777 } 1778 1779 /// 1780 // Represents the state of a setting. 1781 /// 1782 enum cef_state_t 1783 { 1784 /// 1785 // Use the default state for the setting. 1786 /// 1787 STATE_DEFAULT = 0, 1788 1789 /// 1790 // Enable or allow the setting. 1791 /// 1792 STATE_ENABLED = 1, 1793 1794 /// 1795 // Disable or disallow the setting. 1796 /// 1797 STATE_DISABLED = 2 1798 } 1799 1800 /// 1801 // Initialization settings. Specify NULL or 0 to get the recommended default 1802 // values. Many of these and other settings can also configured using command- 1803 // line switches. 1804 /// 1805 struct cef_settings_t 1806 { 1807 /// 1808 // Size of this structure. 1809 /// 1810 size_t size; 1811 1812 /// 1813 // Set to true (1) to disable the sandbox for sub-processes. See 1814 // cef_sandbox_win.h for requirements to enable the sandbox on Windows. Also 1815 // configurable using the "no-sandbox" command-line switch. 1816 /// 1817 int no_sandbox; 1818 1819 /// 1820 // The path to a separate executable that will be launched for sub-processes. 1821 // If this value is empty on Windows or Linux then the main process executable 1822 // will be used. If this value is empty on macOS then a helper executable must 1823 // exist at "Contents/Frameworks/<app> Helper.app/Contents/MacOS/<app> Helper" 1824 // in the top-level app bundle. See the comments on CefExecuteProcess() for 1825 // details. If this value is non-empty then it must be an absolute path. Also 1826 // configurable using the "browser-subprocess-path" command-line switch. 1827 /// 1828 cef_string_t browser_subprocess_path; 1829 1830 /// 1831 // The path to the CEF framework directory on macOS. If this value is empty 1832 // then the framework must exist at "Contents/Frameworks/Chromium Embedded 1833 // Framework.framework" in the top-level app bundle. If this value is 1834 // non-empty then it must be an absolute path. Also configurable using the 1835 // "framework-dir-path" command-line switch. 1836 /// 1837 cef_string_t framework_dir_path; 1838 1839 /// 1840 // The path to the main bundle on macOS. If this value is empty then it 1841 // defaults to the top-level app bundle. If this value is non-empty then it 1842 // must be an absolute path. Also configurable using the "main-bundle-path" 1843 // command-line switch. 1844 /// 1845 cef_string_t main_bundle_path; 1846 1847 /// 1848 // Set to true (1) to enable use of the Chrome runtime in CEF. This feature is 1849 // considered experimental and is not recommended for most users at this time. 1850 // See issue #2969 for details. 1851 /// 1852 int chrome_runtime; 1853 1854 /// 1855 // Set to true (1) to have the browser process message loop run in a separate 1856 // thread. If false (0) than the CefDoMessageLoopWork() function must be 1857 // called from your application message loop. This option is only supported on 1858 // Windows and Linux. 1859 /// 1860 int multi_threaded_message_loop; 1861 1862 /// 1863 // Set to true (1) to control browser process main (UI) thread message pump 1864 // scheduling via the CefBrowserProcessHandler::OnScheduleMessagePumpWork() 1865 // callback. This option is recommended for use in combination with the 1866 // CefDoMessageLoopWork() function in cases where the CEF message loop must be 1867 // integrated into an existing application message loop (see additional 1868 // comments and warnings on CefDoMessageLoopWork). Enabling this option is not 1869 // recommended for most users; leave this option disabled and use either the 1870 // CefRunMessageLoop() function or multi_threaded_message_loop if possible. 1871 /// 1872 int external_message_pump; 1873 1874 /// 1875 // Set to true (1) to enable windowless (off-screen) rendering support. Do not 1876 // enable this value if the application does not use windowless rendering as 1877 // it may reduce rendering performance on some systems. 1878 /// 1879 int windowless_rendering_enabled; 1880 1881 /// 1882 // Set to true (1) to disable configuration of browser process features using 1883 // standard CEF and Chromium command-line arguments. Configuration can still 1884 // be specified using CEF data structures or via the 1885 // CefApp::OnBeforeCommandLineProcessing() method. 1886 /// 1887 int command_line_args_disabled; 1888 1889 /// 1890 // The location where data for the global browser cache will be stored on 1891 // disk. If this value is non-empty then it must be an absolute path that is 1892 // either equal to or a child directory of CefSettings.root_cache_path. If 1893 // this value is empty then browsers will be created in "incognito mode" where 1894 // in-memory caches are used for storage and no data is persisted to disk. 1895 // HTML5 databases such as localStorage will only persist across sessions if a 1896 // cache path is specified. Can be overridden for individual CefRequestContext 1897 // instances via the CefRequestContextSettings.cache_path value. When using 1898 // the Chrome runtime the "default" profile will be used if |cache_path| and 1899 // |root_cache_path| have the same value. 1900 /// 1901 cef_string_t cache_path; 1902 1903 /// 1904 // The root directory that all CefSettings.cache_path and 1905 // CefRequestContextSettings.cache_path values must have in common. If this 1906 // value is empty and CefSettings.cache_path is non-empty then it will 1907 // default to the CefSettings.cache_path value. If this value is non-empty 1908 // then it must be an absolute path. Failure to set this value correctly may 1909 // result in the sandbox blocking read/write access to the cache_path 1910 // directory. 1911 /// 1912 cef_string_t root_cache_path; 1913 1914 /// 1915 // The location where user data such as the Widevine CDM module and spell 1916 // checking dictionary files will be stored on disk. If this value is empty 1917 // then the default platform-specific user data directory will be used 1918 // ("~/.config/cef_user_data" directory on Linux, "~/Library/Application 1919 // Support/CEF/User Data" directory on MacOS, "AppData\Local\CEF\User Data" 1920 // directory under the user profile directory on Windows). If this value is 1921 // non-empty then it must be an absolute path. When using the Chrome runtime 1922 // this value will be ignored in favor of the |root_cache_path| value. 1923 /// 1924 cef_string_t user_data_path; 1925 1926 /// 1927 // To persist session cookies (cookies without an expiry date or validity 1928 // interval) by default when using the global cookie manager set this value to 1929 // true (1). Session cookies are generally intended to be transient and most 1930 // Web browsers do not persist them. A |cache_path| value must also be 1931 // specified to enable this feature. Also configurable using the 1932 // "persist-session-cookies" command-line switch. Can be overridden for 1933 // individual CefRequestContext instances via the 1934 // CefRequestContextSettings.persist_session_cookies value. 1935 /// 1936 int persist_session_cookies; 1937 1938 /// 1939 // To persist user preferences as a JSON file in the cache path directory set 1940 // this value to true (1). A |cache_path| value must also be specified 1941 // to enable this feature. Also configurable using the 1942 // "persist-user-preferences" command-line switch. Can be overridden for 1943 // individual CefRequestContext instances via the 1944 // CefRequestContextSettings.persist_user_preferences value. 1945 /// 1946 int persist_user_preferences; 1947 1948 /// 1949 // Value that will be returned as the User-Agent HTTP header. If empty the 1950 // default User-Agent string will be used. Also configurable using the 1951 // "user-agent" command-line switch. 1952 /// 1953 cef_string_t user_agent; 1954 1955 /// 1956 // Value that will be inserted as the product portion of the default 1957 // User-Agent string. If empty the Chromium product version will be used. If 1958 // |userAgent| is specified this value will be ignored. Also configurable 1959 // using the "user-agent-product" command-line switch. 1960 /// 1961 cef_string_t user_agent_product; 1962 1963 /// 1964 // The locale string that will be passed to WebKit. If empty the default 1965 // locale of "en-US" will be used. This value is ignored on Linux where locale 1966 // is determined using environment variable parsing with the precedence order: 1967 // LANGUAGE, LC_ALL, LC_MESSAGES and LANG. Also configurable using the "lang" 1968 // command-line switch. 1969 /// 1970 cef_string_t locale; 1971 1972 /// 1973 // The directory and file name to use for the debug log. If empty a default 1974 // log file name and location will be used. On Windows and Linux a "debug.log" 1975 // file will be written in the main executable directory. On MacOS a 1976 // "~/Library/Logs/<app name>_debug.log" file will be written where <app name> 1977 // is the name of the main app executable. Also configurable using the 1978 // "log-file" command-line switch. 1979 /// 1980 cef_string_t log_file; 1981 1982 /// 1983 // The log severity. Only messages of this severity level or higher will be 1984 // logged. When set to DISABLE no messages will be written to the log file, 1985 // but FATAL messages will still be output to stderr. Also configurable using 1986 // the "log-severity" command-line switch with a value of "verbose", "info", 1987 // "warning", "error", "fatal" or "disable". 1988 /// 1989 cef_log_severity_t log_severity; 1990 1991 /// 1992 // Custom flags that will be used when initializing the V8 JavaScript engine. 1993 // The consequences of using custom flags may not be well tested. Also 1994 // configurable using the "js-flags" command-line switch. 1995 /// 1996 cef_string_t javascript_flags; 1997 1998 /// 1999 // The fully qualified path for the resources directory. If this value is 2000 // empty the *.pak files must be located in the module directory on 2001 // Windows/Linux or the app bundle Resources directory on MacOS. If this 2002 // value is non-empty then it must be an absolute path. Also configurable 2003 // using the "resources-dir-path" command-line switch. 2004 /// 2005 cef_string_t resources_dir_path; 2006 2007 /// 2008 // The fully qualified path for the locales directory. If this value is empty 2009 // the locales directory must be located in the module directory. If this 2010 // value is non-empty then it must be an absolute path. This value is ignored 2011 // on MacOS where pack files are always loaded from the app bundle Resources 2012 // directory. Also configurable using the "locales-dir-path" command-line 2013 // switch. 2014 /// 2015 cef_string_t locales_dir_path; 2016 2017 /// 2018 // Set to true (1) to disable loading of pack files for resources and locales. 2019 // A resource bundle handler must be provided for the browser and render 2020 // processes via CefApp::GetResourceBundleHandler() if loading of pack files 2021 // is disabled. Also configurable using the "disable-pack-loading" command- 2022 // line switch. 2023 /// 2024 int pack_loading_disabled; 2025 2026 /// 2027 // Set to a value between 1024 and 65535 to enable remote debugging on the 2028 // specified port. For example, if 8080 is specified the remote debugging URL 2029 // will be http://localhost:8080. CEF can be remotely debugged from any CEF or 2030 // Chrome browser window. Also configurable using the "remote-debugging-port" 2031 // command-line switch. 2032 /// 2033 int remote_debugging_port; 2034 2035 /// 2036 // The number of stack trace frames to capture for uncaught exceptions. 2037 // Specify a positive value to enable the CefRenderProcessHandler:: 2038 // OnUncaughtException() callback. Specify 0 (default value) and 2039 // OnUncaughtException() will not be called. Also configurable using the 2040 // "uncaught-exception-stack-size" command-line switch. 2041 /// 2042 int uncaught_exception_stack_size; 2043 2044 /// 2045 // Background color used for the browser before a document is loaded and when 2046 // no document color is specified. The alpha component must be either fully 2047 // opaque (0xFF) or fully transparent (0x00). If the alpha component is fully 2048 // opaque then the RGB components will be used as the background color. If the 2049 // alpha component is fully transparent for a windowed browser then the 2050 // default value of opaque white be used. If the alpha component is fully 2051 // transparent for a windowless (off-screen) browser then transparent painting 2052 // will be enabled. 2053 /// 2054 cef_color_t background_color; 2055 2056 /// 2057 // Comma delimited ordered list of language codes without any whitespace that 2058 // will be used in the "Accept-Language" HTTP header. May be overridden on a 2059 // per-browser basis using the CefBrowserSettings.accept_language_list value. 2060 // If both values are empty then "en-US,en" will be used. Can be overridden 2061 // for individual CefRequestContext instances via the 2062 // CefRequestContextSettings.accept_language_list value. 2063 /// 2064 cef_string_t accept_language_list; 2065 2066 /// 2067 // Comma delimited list of schemes supported by the associated 2068 // CefCookieManager. If |cookieable_schemes_exclude_defaults| is false (0) the 2069 // default schemes ("http", "https", "ws" and "wss") will also be supported. 2070 // Specifying a |cookieable_schemes_list| value and setting 2071 // |cookieable_schemes_exclude_defaults| to true (1) will disable all loading 2072 // and saving of cookies for this manager. Can be overridden 2073 // for individual CefRequestContext instances via the 2074 // CefRequestContextSettings.cookieable_schemes_list and 2075 // CefRequestContextSettings.cookieable_schemes_exclude_defaults values. 2076 /// 2077 cef_string_t cookieable_schemes_list; 2078 int cookieable_schemes_exclude_defaults; 2079 2080 /// 2081 // GUID string used for identifying the application. This is passed to the 2082 // system AV function for scanning downloaded files. By default, the GUID 2083 // will be an empty string and the file will be treated as an untrusted 2084 // file when the GUID is empty. 2085 /// 2086 cef_string_t application_client_id_for_file_scanning; 2087 } 2088 2089 2090 2091 /// 2092 // Request context initialization settings. Specify NULL or 0 to get the 2093 // recommended default values. 2094 /// 2095 struct cef_request_context_settings_t 2096 { 2097 /// 2098 // Size of this structure. 2099 /// 2100 size_t size; 2101 2102 /// 2103 // The location where cache data for this request context will be stored on 2104 // disk. If this value is non-empty then it must be an absolute path that is 2105 // either equal to or a child directory of CefSettings.root_cache_path. If 2106 // this value is empty then browsers will be created in "incognito mode" where 2107 // in-memory caches are used for storage and no data is persisted to disk. 2108 // HTML5 databases such as localStorage will only persist across sessions if a 2109 // cache path is specified. To share the global browser cache and related 2110 // configuration set this value to match the CefSettings.cache_path value. 2111 /// 2112 cef_string_t cache_path; 2113 2114 /// 2115 // To persist session cookies (cookies without an expiry date or validity 2116 // interval) by default when using the global cookie manager set this value to 2117 // true (1). Session cookies are generally intended to be transient and most 2118 // Web browsers do not persist them. Can be set globally using the 2119 // CefSettings.persist_session_cookies value. This value will be ignored if 2120 // |cache_path| is empty or if it matches the CefSettings.cache_path value. 2121 /// 2122 int persist_session_cookies; 2123 2124 /// 2125 // To persist user preferences as a JSON file in the cache path directory set 2126 // this value to true (1). Can be set globally using the 2127 // CefSettings.persist_user_preferences value. This value will be ignored if 2128 // |cache_path| is empty or if it matches the CefSettings.cache_path value. 2129 /// 2130 int persist_user_preferences; 2131 2132 /// 2133 // Comma delimited ordered list of language codes without any whitespace that 2134 // will be used in the "Accept-Language" HTTP header. Can be set globally 2135 // using the CefSettings.accept_language_list value or overridden on a per- 2136 // browser basis using the CefBrowserSettings.accept_language_list value. If 2137 // all values are empty then "en-US,en" will be used. This value will be 2138 // ignored if |cache_path| matches the CefSettings.cache_path value. 2139 /// 2140 cef_string_t accept_language_list; 2141 2142 /// 2143 // Comma delimited list of schemes supported by the associated 2144 // CefCookieManager. If |cookieable_schemes_exclude_defaults| is false (0) the 2145 // default schemes ("http", "https", "ws" and "wss") will also be supported. 2146 // Specifying a |cookieable_schemes_list| value and setting 2147 // |cookieable_schemes_exclude_defaults| to true (1) will disable all loading 2148 // and saving of cookies for this manager. These values will be ignored if 2149 // |cache_path| matches the CefSettings.cache_path value. 2150 /// 2151 cef_string_t cookieable_schemes_list; 2152 int cookieable_schemes_exclude_defaults; 2153 } 2154 2155 2156 2157 /// 2158 // Browser initialization settings. Specify NULL or 0 to get the recommended 2159 // default values. The consequences of using custom values may not be well 2160 // tested. Many of these and other settings can also configured using command- 2161 // line switches. 2162 /// 2163 struct cef_browser_settings_t 2164 { 2165 /// 2166 // Size of this structure. 2167 /// 2168 size_t size; 2169 2170 /// 2171 // The maximum rate in frames per second (fps) that CefRenderHandler::OnPaint 2172 // will be called for a windowless browser. The actual fps may be lower if 2173 // the browser cannot generate frames at the requested rate. The minimum 2174 // value is 1 and the maximum value is 60 (default 30). This value can also be 2175 // changed dynamically via CefBrowserHost::SetWindowlessFrameRate. 2176 /// 2177 int windowless_frame_rate; 2178 2179 // The below values map to WebPreferences settings. 2180 2181 /// 2182 // Font settings. 2183 /// 2184 cef_string_t standard_font_family; 2185 cef_string_t fixed_font_family; 2186 cef_string_t serif_font_family; 2187 cef_string_t sans_serif_font_family; 2188 cef_string_t cursive_font_family; 2189 cef_string_t fantasy_font_family; 2190 int default_font_size; 2191 int default_fixed_font_size; 2192 int minimum_font_size; 2193 int minimum_logical_font_size; 2194 2195 /// 2196 // Default encoding for Web content. If empty "ISO-8859-1" will be used. Also 2197 // configurable using the "default-encoding" command-line switch. 2198 /// 2199 cef_string_t default_encoding; 2200 2201 /// 2202 // Controls the loading of fonts from remote sources. Also configurable using 2203 // the "disable-remote-fonts" command-line switch. 2204 /// 2205 cef_state_t remote_fonts; 2206 2207 /// 2208 // Controls whether JavaScript can be executed. Also configurable using the 2209 // "disable-javascript" command-line switch. 2210 /// 2211 cef_state_t javascript; 2212 2213 /// 2214 // Controls whether JavaScript can be used to close windows that were not 2215 // opened via JavaScript. JavaScript can still be used to close windows that 2216 // were opened via JavaScript or that have no back/forward history. Also 2217 // configurable using the "disable-javascript-close-windows" command-line 2218 // switch. 2219 /// 2220 cef_state_t javascript_close_windows; 2221 2222 /// 2223 // Controls whether JavaScript can access the clipboard. Also configurable 2224 // using the "disable-javascript-access-clipboard" command-line switch. 2225 /// 2226 cef_state_t javascript_access_clipboard; 2227 2228 /// 2229 // Controls whether DOM pasting is supported in the editor via 2230 // execCommand("paste"). The |javascript_access_clipboard| setting must also 2231 // be enabled. Also configurable using the "disable-javascript-dom-paste" 2232 // command-line switch. 2233 /// 2234 cef_state_t javascript_dom_paste; 2235 2236 /// 2237 // Controls whether any plugins will be loaded. Also configurable using the 2238 // "disable-plugins" command-line switch. 2239 /// 2240 cef_state_t plugins; 2241 2242 /// 2243 // Controls whether image URLs will be loaded from the network. A cached image 2244 // will still be rendered if requested. Also configurable using the 2245 // "disable-image-loading" command-line switch. 2246 /// 2247 cef_state_t image_loading; 2248 2249 /// 2250 // Controls whether standalone images will be shrunk to fit the page. Also 2251 // configurable using the "image-shrink-standalone-to-fit" command-line 2252 // switch. 2253 /// 2254 cef_state_t image_shrink_standalone_to_fit; 2255 2256 /// 2257 // Controls whether text areas can be resized. Also configurable using the 2258 // "disable-text-area-resize" command-line switch. 2259 /// 2260 cef_state_t text_area_resize; 2261 2262 /// 2263 // Controls whether the tab key can advance focus to links. Also configurable 2264 // using the "disable-tab-to-links" command-line switch. 2265 /// 2266 cef_state_t tab_to_links; 2267 2268 /// 2269 // Controls whether local storage can be used. Also configurable using the 2270 // "disable-local-storage" command-line switch. 2271 /// 2272 cef_state_t local_storage; 2273 2274 /// 2275 // Controls whether databases can be used. Also configurable using the 2276 // "disable-databases" command-line switch. 2277 /// 2278 cef_state_t databases; 2279 2280 /// 2281 // Controls whether WebGL can be used. Note that WebGL requires hardware 2282 // support and may not work on all systems even when enabled. Also 2283 // configurable using the "disable-webgl" command-line switch. 2284 /// 2285 cef_state_t webgl; 2286 2287 /// 2288 // Background color used for the browser before a document is loaded and when 2289 // no document color is specified. The alpha component must be either fully 2290 // opaque (0xFF) or fully transparent (0x00). If the alpha component is fully 2291 // opaque then the RGB components will be used as the background color. If the 2292 // alpha component is fully transparent for a windowed browser then the 2293 // CefSettings.background_color value will be used. If the alpha component is 2294 // fully transparent for a windowless (off-screen) browser then transparent 2295 // painting will be enabled. 2296 /// 2297 cef_color_t background_color; 2298 2299 /// 2300 // Comma delimited ordered list of language codes without any whitespace that 2301 // will be used in the "Accept-Language" HTTP header. May be set globally 2302 // using the CefSettings.accept_language_list value. If both values are 2303 // empty then "en-US,en" will be used. 2304 /// 2305 cef_string_t accept_language_list; 2306 } 2307 2308 2309 2310 /// 2311 // Return value types. 2312 /// 2313 enum cef_return_value_t 2314 { 2315 /// 2316 // Cancel immediately. 2317 /// 2318 RV_CANCEL = 0, 2319 2320 /// 2321 // Continue immediately. 2322 /// 2323 RV_CONTINUE = 1, 2324 2325 /// 2326 // Continue asynchronously (usually via a callback). 2327 /// 2328 RV_CONTINUE_ASYNC = 2 2329 } 2330 2331 /// 2332 // URL component parts. 2333 /// 2334 struct cef_urlparts_t 2335 { 2336 /// 2337 // The complete URL specification. 2338 /// 2339 cef_string_t spec; 2340 2341 /// 2342 // Scheme component not including the colon (e.g., "http"). 2343 /// 2344 cef_string_t scheme; 2345 2346 /// 2347 // User name component. 2348 /// 2349 cef_string_t username; 2350 2351 /// 2352 // Password component. 2353 /// 2354 cef_string_t password; 2355 2356 /// 2357 // Host component. This may be a hostname, an IPv4 address or an IPv6 literal 2358 // surrounded by square brackets (e.g., "[2001:db8::1]"). 2359 /// 2360 cef_string_t host; 2361 2362 /// 2363 // Port number component. 2364 /// 2365 cef_string_t port; 2366 2367 /// 2368 // Origin contains just the scheme, host, and port from a URL. Equivalent to 2369 // clearing any username and password, replacing the path with a slash, and 2370 // clearing everything after that. This value will be empty for non-standard 2371 // URLs. 2372 /// 2373 cef_string_t origin; 2374 2375 /// 2376 // Path component including the first slash following the host. 2377 /// 2378 cef_string_t path; 2379 2380 /// 2381 // Query string component (i.e., everything following the '?'). 2382 /// 2383 cef_string_t query; 2384 2385 /// 2386 // Fragment (hash) identifier component (i.e., the string following the '#'). 2387 /// 2388 cef_string_t fragment; 2389 } 2390 2391 2392 2393 /// 2394 // Cookie priority values. 2395 /// 2396 enum cef_cookie_priority_t 2397 { 2398 CEF_COOKIE_PRIORITY_LOW = -1, 2399 CEF_COOKIE_PRIORITY_MEDIUM = 0, 2400 CEF_COOKIE_PRIORITY_HIGH = 1 2401 } 2402 2403 /// 2404 // Cookie same site values. 2405 /// 2406 enum cef_cookie_same_site_t 2407 { 2408 CEF_COOKIE_SAME_SITE_UNSPECIFIED = 0, 2409 CEF_COOKIE_SAME_SITE_NO_RESTRICTION = 1, 2410 CEF_COOKIE_SAME_SITE_LAX_MODE = 2, 2411 CEF_COOKIE_SAME_SITE_STRICT_MODE = 3 2412 } 2413 2414 /// 2415 // Cookie information. 2416 /// 2417 struct cef_cookie_t 2418 { 2419 /// 2420 // The cookie name. 2421 /// 2422 cef_string_t name; 2423 2424 /// 2425 // The cookie value. 2426 /// 2427 cef_string_t value; 2428 2429 /// 2430 // If |domain| is empty a host cookie will be created instead of a domain 2431 // cookie. Domain cookies are stored with a leading "." and are visible to 2432 // sub-domains whereas host cookies are not. 2433 /// 2434 cef_string_t domain; 2435 2436 /// 2437 // If |path| is non-empty only URLs at or below the path will get the cookie 2438 // value. 2439 /// 2440 cef_string_t path; 2441 2442 /// 2443 // If |secure| is true the cookie will only be sent for HTTPS requests. 2444 /// 2445 int secure; 2446 2447 /// 2448 // If |httponly| is true the cookie will only be sent for HTTP requests. 2449 /// 2450 int httponly; 2451 2452 /// 2453 // The cookie creation date. This is automatically populated by the system on 2454 // cookie creation. 2455 /// 2456 cef_time_t creation; 2457 2458 /// 2459 // The cookie last access date. This is automatically populated by the system 2460 // on access. 2461 /// 2462 cef_time_t last_access; 2463 2464 /// 2465 // The cookie expiration date is only valid if |has_expires| is true. 2466 /// 2467 int has_expires; 2468 cef_time_t expires; 2469 2470 /// 2471 // Same site. 2472 /// 2473 cef_cookie_same_site_t same_site; 2474 2475 /// 2476 // Priority. 2477 /// 2478 cef_cookie_priority_t priority; 2479 } 2480 2481 2482 2483 /// 2484 // Process termination status values. 2485 /// 2486 enum cef_termination_status_t 2487 { 2488 /// 2489 // Non-zero exit status. 2490 /// 2491 TS_ABNORMAL_TERMINATION = 0, 2492 2493 /// 2494 // SIGKILL or task manager kill. 2495 /// 2496 TS_PROCESS_WAS_KILLED = 1, 2497 2498 /// 2499 // Segmentation fault. 2500 /// 2501 TS_PROCESS_CRASHED = 2, 2502 2503 /// 2504 // Out of memory. Some platforms may use TS_PROCESS_CRASHED instead. 2505 /// 2506 TS_PROCESS_OOM = 3 2507 } 2508 2509 /// 2510 // Path key values. 2511 /// 2512 enum cef_path_key_t 2513 { 2514 /// 2515 // Current directory. 2516 /// 2517 PK_DIR_CURRENT = 0, 2518 2519 /// 2520 // Directory containing PK_FILE_EXE. 2521 /// 2522 PK_DIR_EXE = 1, 2523 2524 /// 2525 // Directory containing PK_FILE_MODULE. 2526 /// 2527 PK_DIR_MODULE = 2, 2528 2529 /// 2530 // Temporary directory. 2531 /// 2532 PK_DIR_TEMP = 3, 2533 2534 /// 2535 // Path and filename of the current executable. 2536 /// 2537 PK_FILE_EXE = 4, 2538 2539 /// 2540 // Path and filename of the module containing the CEF code (usually the libcef 2541 // module). 2542 /// 2543 PK_FILE_MODULE = 5, 2544 2545 /// 2546 // "Local Settings\Application Data" directory under the user profile 2547 // directory on Windows. 2548 /// 2549 PK_LOCAL_APP_DATA = 6, 2550 2551 /// 2552 // "Application Data" directory under the user profile directory on Windows 2553 // and "~/Library/Application Support" directory on MacOS. 2554 /// 2555 PK_USER_DATA = 7, 2556 2557 /// 2558 // Directory containing application resources. Can be configured via 2559 // CefSettings.resources_dir_path. 2560 /// 2561 PK_DIR_RESOURCES = 8 2562 } 2563 2564 /// 2565 // Storage types. 2566 /// 2567 enum cef_storage_type_t 2568 { 2569 ST_LOCALSTORAGE = 0, 2570 ST_SESSIONSTORAGE = 1 2571 } 2572 2573 /// 2574 // Supported error code values. 2575 /// 2576 enum cef_errorcode_t 2577 { 2578 // No error. 2579 ERR_NONE = 0, 2580 ERR_IO_PENDING = -1, 2581 ERR_FAILED = -2, 2582 ERR_ABORTED = -3, 2583 ERR_INVALID_ARGUMENT = -4, 2584 ERR_INVALID_HANDLE = -5, 2585 ERR_FILE_NOT_FOUND = -6, 2586 ERR_TIMED_OUT = -7, 2587 ERR_FILE_TOO_BIG = -8, 2588 ERR_UNEXPECTED = -9, 2589 ERR_ACCESS_DENIED = -10, 2590 ERR_NOT_IMPLEMENTED = -11, 2591 ERR_INSUFFICIENT_RESOURCES = -12, 2592 ERR_OUT_OF_MEMORY = -13, 2593 ERR_UPLOAD_FILE_CHANGED = -14, 2594 ERR_SOCKET_NOT_CONNECTED = -15, 2595 ERR_FILE_EXISTS = -16, 2596 ERR_FILE_PATH_TOO_LONG = -17, 2597 ERR_FILE_NO_SPACE = -18, 2598 ERR_FILE_VIRUS_INFECTED = -19, 2599 ERR_BLOCKED_BY_CLIENT = -20, 2600 ERR_NETWORK_CHANGED = -21, 2601 ERR_BLOCKED_BY_ADMINISTRATOR = -22, 2602 ERR_SOCKET_IS_CONNECTED = -23, 2603 ERR_BLOCKED_ENROLLMENT_CHECK_PENDING = -24, 2604 ERR_UPLOAD_STREAM_REWIND_NOT_SUPPORTED = -25, 2605 ERR_CONTEXT_SHUT_DOWN = -26, 2606 ERR_BLOCKED_BY_RESPONSE = -27, 2607 ERR_CLEARTEXT_NOT_PERMITTED = -29, 2608 ERR_BLOCKED_BY_CSP = -30, 2609 ERR_H2_OR_QUIC_REQUIRED = -31, 2610 ERR_CONNECTION_CLOSED = -100, 2611 ERR_CONNECTION_RESET = -101, 2612 ERR_CONNECTION_REFUSED = -102, 2613 ERR_CONNECTION_ABORTED = -103, 2614 ERR_CONNECTION_FAILED = -104, 2615 ERR_NAME_NOT_RESOLVED = -105, 2616 ERR_INTERNET_DISCONNECTED = -106, 2617 ERR_SSL_PROTOCOL_ERROR = -107, 2618 ERR_ADDRESS_INVALID = -108, 2619 ERR_ADDRESS_UNREACHABLE = -109, 2620 ERR_SSL_CLIENT_AUTH_CERT_NEEDED = -110, 2621 ERR_TUNNEL_CONNECTION_FAILED = -111, 2622 ERR_NO_SSL_VERSIONS_ENABLED = -112, 2623 ERR_SSL_VERSION_OR_CIPHER_MISMATCH = -113, 2624 ERR_SSL_RENEGOTIATION_REQUESTED = -114, 2625 ERR_PROXY_AUTH_UNSUPPORTED = -115, 2626 ERR_CERT_ERROR_IN_SSL_RENEGOTIATION = -116, 2627 ERR_BAD_SSL_CLIENT_AUTH_CERT = -117, 2628 ERR_CONNECTION_TIMED_OUT = -118, 2629 ERR_HOST_RESOLVER_QUEUE_TOO_LARGE = -119, 2630 ERR_SOCKS_CONNECTION_FAILED = -120, 2631 ERR_SOCKS_CONNECTION_HOST_UNREACHABLE = -121, 2632 ERR_ALPN_NEGOTIATION_FAILED = -122, 2633 ERR_SSL_NO_RENEGOTIATION = -123, 2634 ERR_WINSOCK_UNEXPECTED_WRITTEN_BYTES = -124, 2635 ERR_SSL_DECOMPRESSION_FAILURE_ALERT = -125, 2636 ERR_SSL_BAD_RECORD_MAC_ALERT = -126, 2637 ERR_PROXY_AUTH_REQUESTED = -127, 2638 ERR_PROXY_CONNECTION_FAILED = -130, 2639 ERR_MANDATORY_PROXY_CONFIGURATION_FAILED = -131, 2640 ERR_PRECONNECT_MAX_SOCKET_LIMIT = -133, 2641 ERR_SSL_CLIENT_AUTH_PRIVATE_KEY_ACCESS_DENIED = -134, 2642 ERR_SSL_CLIENT_AUTH_CERT_NO_PRIVATE_KEY = -135, 2643 ERR_PROXY_CERTIFICATE_INVALID = -136, 2644 ERR_NAME_RESOLUTION_FAILED = -137, 2645 ERR_NETWORK_ACCESS_DENIED = -138, 2646 ERR_TEMPORARILY_THROTTLED = -139, 2647 ERR_HTTPS_PROXY_TUNNEL_RESPONSE_REDIRECT = -140, 2648 ERR_SSL_CLIENT_AUTH_SIGNATURE_FAILED = -141, 2649 ERR_MSG_TOO_BIG = -142, 2650 ERR_WS_PROTOCOL_ERROR = -145, 2651 ERR_ADDRESS_IN_USE = -147, 2652 ERR_SSL_HANDSHAKE_NOT_COMPLETED = -148, 2653 ERR_SSL_BAD_PEER_PUBLIC_KEY = -149, 2654 ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN = -150, 2655 ERR_CLIENT_AUTH_CERT_TYPE_UNSUPPORTED = -151, 2656 ERR_SSL_DECRYPT_ERROR_ALERT = -153, 2657 ERR_WS_THROTTLE_QUEUE_TOO_LARGE = -154, 2658 ERR_SSL_SERVER_CERT_CHANGED = -156, 2659 ERR_SSL_UNRECOGNIZED_NAME_ALERT = -159, 2660 ERR_SOCKET_SET_RECEIVE_BUFFER_SIZE_ERROR = -160, 2661 ERR_SOCKET_SET_SEND_BUFFER_SIZE_ERROR = -161, 2662 ERR_SOCKET_RECEIVE_BUFFER_SIZE_UNCHANGEABLE = -162, 2663 ERR_SOCKET_SEND_BUFFER_SIZE_UNCHANGEABLE = -163, 2664 ERR_SSL_CLIENT_AUTH_CERT_BAD_FORMAT = -164, 2665 ERR_ICANN_NAME_COLLISION = -166, 2666 ERR_SSL_SERVER_CERT_BAD_FORMAT = -167, 2667 ERR_CT_STH_PARSING_FAILED = -168, 2668 ERR_CT_STH_INCOMPLETE = -169, 2669 ERR_UNABLE_TO_REUSE_CONNECTION_FOR_PROXY_AUTH = -170, 2670 ERR_CT_CONSISTENCY_PROOF_PARSING_FAILED = -171, 2671 ERR_SSL_OBSOLETE_CIPHER = -172, 2672 ERR_WS_UPGRADE = -173, 2673 ERR_READ_IF_READY_NOT_IMPLEMENTED = -174, 2674 ERR_NO_BUFFER_SPACE = -176, 2675 ERR_SSL_CLIENT_AUTH_NO_COMMON_ALGORITHMS = -177, 2676 ERR_EARLY_DATA_REJECTED = -178, 2677 ERR_WRONG_VERSION_ON_EARLY_DATA = -179, 2678 ERR_TLS13_DOWNGRADE_DETECTED = -180, 2679 ERR_SSL_KEY_USAGE_INCOMPATIBLE = -181, 2680 ERR_CERT_COMMON_NAME_INVALID = -200, 2681 ERR_CERT_DATE_INVALID = -201, 2682 ERR_CERT_AUTHORITY_INVALID = -202, 2683 ERR_CERT_CONTAINS_ERRORS = -203, 2684 ERR_CERT_NO_REVOCATION_MECHANISM = -204, 2685 ERR_CERT_UNABLE_TO_CHECK_REVOCATION = -205, 2686 ERR_CERT_REVOKED = -206, 2687 ERR_CERT_INVALID = -207, 2688 ERR_CERT_WEAK_SIGNATURE_ALGORITHM = -208, 2689 ERR_CERT_NON_UNIQUE_NAME = -210, 2690 ERR_CERT_WEAK_KEY = -211, 2691 ERR_CERT_NAME_CONSTRAINT_VIOLATION = -212, 2692 ERR_CERT_VALIDITY_TOO_LONG = -213, 2693 ERR_CERTIFICATE_TRANSPARENCY_REQUIRED = -214, 2694 ERR_CERT_SYMANTEC_LEGACY = -215, 2695 ERR_CERT_KNOWN_INTERCEPTION_BLOCKED = -217, 2696 ERR_SSL_OBSOLETE_VERSION = -218, 2697 ERR_CERT_END = -219, 2698 ERR_INVALID_URL = -300, 2699 ERR_DISALLOWED_URL_SCHEME = -301, 2700 ERR_UNKNOWN_URL_SCHEME = -302, 2701 ERR_INVALID_REDIRECT = -303, 2702 ERR_TOO_MANY_REDIRECTS = -310, 2703 ERR_UNSAFE_REDIRECT = -311, 2704 ERR_UNSAFE_PORT = -312, 2705 ERR_INVALID_RESPONSE = -320, 2706 ERR_INVALID_CHUNKED_ENCODING = -321, 2707 ERR_METHOD_NOT_SUPPORTED = -322, 2708 ERR_UNEXPECTED_PROXY_AUTH = -323, 2709 ERR_EMPTY_RESPONSE = -324, 2710 ERR_RESPONSE_HEADERS_TOO_BIG = -325, 2711 ERR_PAC_SCRIPT_FAILED = -327, 2712 ERR_REQUEST_RANGE_NOT_SATISFIABLE = -328, 2713 ERR_MALFORMED_IDENTITY = -329, 2714 ERR_CONTENT_DECODING_FAILED = -330, 2715 ERR_NETWORK_IO_SUSPENDED = -331, 2716 ERR_SYN_REPLY_NOT_RECEIVED = -332, 2717 ERR_ENCODING_CONVERSION_FAILED = -333, 2718 ERR_UNRECOGNIZED_FTP_DIRECTORY_LISTING_FORMAT = -334, 2719 ERR_NO_SUPPORTED_PROXIES = -336, 2720 ERR_HTTP2_PROTOCOL_ERROR = -337, 2721 ERR_INVALID_AUTH_CREDENTIALS = -338, 2722 ERR_UNSUPPORTED_AUTH_SCHEME = -339, 2723 ERR_ENCODING_DETECTION_FAILED = -340, 2724 ERR_MISSING_AUTH_CREDENTIALS = -341, 2725 ERR_UNEXPECTED_SECURITY_LIBRARY_STATUS = -342, 2726 ERR_MISCONFIGURED_AUTH_ENVIRONMENT = -343, 2727 ERR_UNDOCUMENTED_SECURITY_LIBRARY_STATUS = -344, 2728 ERR_RESPONSE_BODY_TOO_BIG_TO_DRAIN = -345, 2729 ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_LENGTH = -346, 2730 ERR_INCOMPLETE_HTTP2_HEADERS = -347, 2731 ERR_PAC_NOT_IN_DHCP = -348, 2732 ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION = -349, 2733 ERR_RESPONSE_HEADERS_MULTIPLE_LOCATION = -350, 2734 ERR_HTTP2_SERVER_REFUSED_STREAM = -351, 2735 ERR_HTTP2_PING_FAILED = -352, 2736 ERR_CONTENT_LENGTH_MISMATCH = -354, 2737 ERR_INCOMPLETE_CHUNKED_ENCODING = -355, 2738 ERR_QUIC_PROTOCOL_ERROR = -356, 2739 ERR_RESPONSE_HEADERS_TRUNCATED = -357, 2740 ERR_QUIC_HANDSHAKE_FAILED = -358, 2741 ERR_HTTP2_INADEQUATE_TRANSPORT_SECURITY = -360, 2742 ERR_HTTP2_FLOW_CONTROL_ERROR = -361, 2743 ERR_HTTP2_FRAME_SIZE_ERROR = -362, 2744 ERR_HTTP2_COMPRESSION_ERROR = -363, 2745 ERR_PROXY_AUTH_REQUESTED_WITH_NO_CONNECTION = -364, 2746 ERR_HTTP_1_1_REQUIRED = -365, 2747 ERR_PROXY_HTTP_1_1_REQUIRED = -366, 2748 ERR_PAC_SCRIPT_TERMINATED = -367, 2749 ERR_INVALID_HTTP_RESPONSE = -370, 2750 ERR_CONTENT_DECODING_INIT_FAILED = -371, 2751 ERR_HTTP2_RST_STREAM_NO_ERROR_RECEIVED = -372, 2752 ERR_HTTP2_PUSHED_STREAM_NOT_AVAILABLE = -373, 2753 ERR_HTTP2_CLAIMED_PUSHED_STREAM_RESET_BY_SERVER = -374, 2754 ERR_TOO_MANY_RETRIES = -375, 2755 ERR_HTTP2_STREAM_CLOSED = -376, 2756 ERR_HTTP2_CLIENT_REFUSED_STREAM = -377, 2757 ERR_HTTP2_PUSHED_RESPONSE_DOES_NOT_MATCH = -378, 2758 ERR_HTTP_RESPONSE_CODE_FAILURE = -379, 2759 ERR_QUIC_CERT_ROOT_NOT_KNOWN = -380, 2760 ERR_QUIC_GOAWAY_REQUEST_CAN_BE_RETRIED = -381, 2761 ERR_CACHE_MISS = -400, 2762 ERR_CACHE_READ_FAILURE = -401, 2763 ERR_CACHE_WRITE_FAILURE = -402, 2764 ERR_CACHE_OPERATION_NOT_SUPPORTED = -403, 2765 ERR_CACHE_OPEN_FAILURE = -404, 2766 ERR_CACHE_CREATE_FAILURE = -405, 2767 2768 /// 2769 // Supported certificate status code values. See net\cert\cert_status_flags.h 2770 ERR_CACHE_RACE = -406, 2771 // for more information. CERT_STATUS_NONE is new in CEF because we use an 2772 // enum while cert_status_flags.h uses a typedef and static const variables. 2773 /// 2774 ERR_CACHE_CHECKSUM_READ_FAILURE = -407, 2775 2776 // 1 << 3 is reserved for ERR_CERT_CONTAINS_ERRORS (not useful with WinHTTP). 2777 ERR_CACHE_CHECKSUM_MISMATCH = -408, 2778 2779 // 1 << 9 was used for CERT_STATUS_NOT_IN_DNS 2780 ERR_CACHE_LOCK_TIMEOUT = -409, 2781 2782 // 1 << 12 was used for CERT_STATUS_WEAK_DH_KEY 2783 ERR_CACHE_AUTH_FAILURE_AFTER_READ = -410, 2784 2785 // Bits 16 to 31 are for non-error statuses. 2786 2787 // Bit 18 was CERT_STATUS_IS_DNSSEC 2788 ERR_CACHE_ENTRY_NOT_SUITABLE = -411, 2789 ERR_CACHE_DOOM_FAILURE = -412, 2790 2791 /// 2792 // The manner in which a link click should be opened. These constants match 2793 // their equivalents in Chromium's window_open_disposition.h and should not be 2794 ERR_CACHE_OPEN_OR_CREATE_FAILURE = -413, 2795 // renumbered. 2796 /// 2797 ERR_INSECURE_RESPONSE = -501, 2798 ERR_NO_PRIVATE_KEY_FOR_CERT = -502, 2799 2800 /// 2801 // "Verb" of a drag-and-drop operation as negotiated between the source and 2802 ERR_ADD_USER_CERT_FAILED = -503, 2803 // destination. These constants match their equivalents in WebCore's 2804 ERR_INVALID_SIGNED_EXCHANGE = -504, 2805 // DragActions.h and should not be renumbered. 2806 /// 2807 ERR_INVALID_WEB_BUNDLE = -505, 2808 ERR_TRUST_TOKEN_OPERATION_FAILED = -506, 2809 2810 /// 2811 // Input mode of a virtual keyboard. These constants match their equivalents 2812 // in Chromium's text_input_mode.h and should not be renumbered. 2813 // See https://html.spec.whatwg.org/#input-modalities:-the-inputmode-attribute 2814 /// 2815 ERR_TRUST_TOKEN_OPERATION_SUCCESS_WITHOUT_SENDING_REQUEST = -507, 2816 2817 /// 2818 // V8 access control values. 2819 ERR_FTP_FAILED = -601, 2820 /// 2821 ERR_FTP_SERVICE_UNAVAILABLE = -602, 2822 2823 /// 2824 // V8 property attribute values. 2825 ERR_FTP_TRANSFER_ABORTED = -603, 2826 /// 2827 2828 // Writeable, Enumerable, 2829 // Configurable 2830 ERR_FTP_FILE_BUSY = -604, 2831 // Not writeable 2832 // Not enumerable 2833 ERR_FTP_SYNTAX_ERROR = -605, 2834 // Not configurable 2835 2836 /// 2837 // Post data elements may represent either bytes or files. 2838 ERR_FTP_COMMAND_NOT_SUPPORTED = -606, 2839 /// 2840 2841 /// 2842 ERR_FTP_BAD_COMMAND_SEQUENCE = -607, 2843 // Resource type for a request. 2844 /// 2845 2846 /// 2847 // Top level page. 2848 /// 2849 ERR_PKCS12_IMPORT_BAD_PASSWORD = -701, 2850 2851 /// 2852 // Frame or iframe. 2853 /// 2854 2855 /// 2856 // CSS stylesheet. 2857 ERR_PKCS12_IMPORT_FAILED = -702, 2858 /// 2859 2860 /// 2861 // External script. 2862 /// 2863 2864 /// 2865 ERR_IMPORT_CA_CERT_NOT_CA = -703, 2866 // Image (jpg/gif/png/etc). 2867 /// 2868 2869 /// 2870 // Font. 2871 /// 2872 2873 /// 2874 // Some other subresource. This is the default type if the actual type is 2875 // unknown. 2876 /// 2877 2878 /// 2879 ERR_IMPORT_CERT_ALREADY_EXISTS = -704, 2880 // Object (or embed) tag for a plugin, or a resource that a plugin requested. 2881 /// 2882 ERR_IMPORT_CA_CERT_FAILED = -705, 2883 2884 /// 2885 // Media resource. 2886 /// 2887 2888 /// 2889 // Main resource of a dedicated worker. 2890 ERR_IMPORT_SERVER_CERT_FAILED = -706, 2891 /// 2892 2893 /// 2894 // Main resource of a shared worker. 2895 /// 2896 ERR_PKCS12_IMPORT_INVALID_MAC = -707, 2897 2898 /// 2899 // Explicitly requested prefetch. 2900 /// 2901 2902 /// 2903 // Favicon. 2904 /// 2905 ERR_PKCS12_IMPORT_INVALID_FILE = -708, 2906 2907 /// 2908 // XMLHttpRequest. 2909 /// 2910 2911 /// 2912 // A request for a <ping> 2913 /// 2914 ERR_PKCS12_IMPORT_UNSUPPORTED = -709, 2915 2916 /// 2917 // Main resource of a service worker. 2918 /// 2919 ERR_KEY_GENERATION_FAILED = -710, 2920 2921 /// 2922 // A report of Content Security Policy violations. 2923 /// 2924 2925 /// 2926 // A resource that a plugin requested. 2927 ERR_PRIVATE_KEY_EXPORT_FAILED = -712, 2928 /// 2929 2930 /// 2931 // A main-frame service worker navigation preload request. 2932 ERR_SELF_SIGNED_CERT_GENERATION_FAILED = -713, 2933 /// 2934 2935 /// 2936 // A sub-frame service worker navigation preload request. 2937 ERR_CERT_DATABASE_CHANGED = -714, 2938 /// 2939 2940 /// 2941 // Transition type for a request. Made up of one source value and 0 or more 2942 // qualifiers. 2943 ERR_DNS_MALFORMED_RESPONSE = -800, 2944 /// 2945 2946 /// 2947 // Source is a link click or the JavaScript window.open function. This is 2948 ERR_DNS_SERVER_REQUIRES_TCP = -801, 2949 // also the default value for requests like sub-resource loads that are not 2950 // navigations. 2951 /// 2952 2953 /// 2954 // Source is some other "explicit" navigation. This is the default value for 2955 // navigations where the actual type is unknown. See also TT_DIRECT_LOAD_FLAG. 2956 /// 2957 2958 /// 2959 // Source is a subframe navigation. This is any content that is automatically 2960 // loaded in a non-toplevel frame. For example, if a page consists of several 2961 ERR_DNS_SERVER_FAILED = -802, 2962 // frames containing ads, those ad URLs will have this transition type. 2963 ERR_DNS_TIMED_OUT = -803, 2964 // The user may not even realize the content in these pages is a separate 2965 // frame, so may not care about the URL. 2966 /// 2967 2968 /// 2969 // Source is a subframe navigation explicitly requested by the user that will 2970 // generate new navigation entries in the back/forward list. These are 2971 ERR_DNS_CACHE_MISS = -804, 2972 // probably more important than frames that were automatically loaded in 2973 ERR_DNS_SEARCH_EMPTY = -805, 2974 // the background because the user probably cares about the fact that this 2975 ERR_DNS_SORT_ERROR = -806, 2976 // link was loaded. 2977 /// 2978 2979 /// 2980 // Source is a form submission by the user. NOTE: In some situations 2981 // submitting a form does not result in this transition type. This can happen 2982 ERR_DNS_SECURE_RESOLVER_HOSTNAME_RESOLUTION_FAILED = -808, 2983 // if the form uses a script to submit the contents. 2984 /// 2985 2986 /// 2987 // Source is a "reload" of the page via the Reload function or by re-visiting 2988 ERR_DNS_NAME_HTTPS_ONLY = -809 2989 } 2990 2991 enum cef_cert_status_t 2992 { 2993 CERT_STATUS_NONE = 0, 2994 CERT_STATUS_COMMON_NAME_INVALID = 1 << 0, 2995 CERT_STATUS_DATE_INVALID = 1 << 1, 2996 CERT_STATUS_AUTHORITY_INVALID = 1 << 2, 2997 CERT_STATUS_NO_REVOCATION_MECHANISM = 1 << 4, 2998 CERT_STATUS_UNABLE_TO_CHECK_REVOCATION = 1 << 5, 2999 CERT_STATUS_REVOKED = 1 << 6, 3000 CERT_STATUS_INVALID = 1 << 7, 3001 CERT_STATUS_WEAK_SIGNATURE_ALGORITHM = 1 << 8, 3002 CERT_STATUS_NON_UNIQUE_NAME = 1 << 10, 3003 CERT_STATUS_WEAK_KEY = 1 << 11, 3004 CERT_STATUS_PINNED_KEY_MISSING = 1 << 13, 3005 CERT_STATUS_NAME_CONSTRAINT_VIOLATION = 1 << 14, 3006 CERT_STATUS_VALIDITY_TOO_LONG = 1 << 15, 3007 CERT_STATUS_IS_EV = 1 << 16, 3008 CERT_STATUS_REV_CHECKING_ENABLED = 1 << 17, 3009 CERT_STATUS_SHA1_SIGNATURE_PRESENT = 1 << 19, 3010 CERT_STATUS_CT_COMPLIANCE_FAILED = 1 << 20 3011 } 3012 3013 enum cef_window_open_disposition_t 3014 { 3015 WOD_UNKNOWN = 0, 3016 WOD_CURRENT_TAB = 1, 3017 WOD_SINGLETON_TAB = 2, 3018 WOD_NEW_FOREGROUND_TAB = 3, 3019 WOD_NEW_BACKGROUND_TAB = 4, 3020 WOD_NEW_POPUP = 5, 3021 WOD_NEW_WINDOW = 6, 3022 WOD_SAVE_TO_DISK = 7, 3023 WOD_OFF_THE_RECORD = 8, 3024 WOD_IGNORE_ACTION = 9 3025 } 3026 3027 enum cef_drag_operations_mask_t 3028 { 3029 DRAG_OPERATION_NONE = 0, 3030 DRAG_OPERATION_COPY = 1, 3031 DRAG_OPERATION_LINK = 2, 3032 DRAG_OPERATION_GENERIC = 4, 3033 DRAG_OPERATION_PRIVATE = 8, 3034 DRAG_OPERATION_MOVE = 16, 3035 DRAG_OPERATION_DELETE = 32, 3036 DRAG_OPERATION_EVERY = UINT_MAX 3037 } 3038 3039 enum cef_text_input_mode_t 3040 { 3041 CEF_TEXT_INPUT_MODE_DEFAULT = 0, 3042 CEF_TEXT_INPUT_MODE_NONE = 1, 3043 CEF_TEXT_INPUT_MODE_TEXT = 2, 3044 CEF_TEXT_INPUT_MODE_TEL = 3, 3045 CEF_TEXT_INPUT_MODE_URL = 4, 3046 CEF_TEXT_INPUT_MODE_EMAIL = 5, 3047 CEF_TEXT_INPUT_MODE_NUMERIC = 6, 3048 CEF_TEXT_INPUT_MODE_DECIMAL = 7, 3049 CEF_TEXT_INPUT_MODE_SEARCH = 8, 3050 CEF_TEXT_INPUT_MODE_MAX = CEF_TEXT_INPUT_MODE_SEARCH 3051 } 3052 3053 enum cef_v8_accesscontrol_t 3054 { 3055 V8_ACCESS_CONTROL_DEFAULT = 0, 3056 V8_ACCESS_CONTROL_ALL_CAN_READ = 1, 3057 V8_ACCESS_CONTROL_ALL_CAN_WRITE = 1 << 1, 3058 V8_ACCESS_CONTROL_PROHIBITS_OVERWRITING = 1 << 2 3059 } 3060 3061 enum cef_v8_propertyattribute_t 3062 { 3063 V8_PROPERTY_ATTRIBUTE_NONE = 0, 3064 V8_PROPERTY_ATTRIBUTE_READONLY = 1 << 0, 3065 V8_PROPERTY_ATTRIBUTE_DONTENUM = 1 << 1, 3066 V8_PROPERTY_ATTRIBUTE_DONTDELETE = 1 << 2 3067 } 3068 3069 enum cef_postdataelement_type_t 3070 { 3071 PDE_TYPE_EMPTY = 0, 3072 PDE_TYPE_BYTES = 1, 3073 PDE_TYPE_FILE = 2 3074 } 3075 3076 enum cef_resource_type_t 3077 { 3078 RT_MAIN_FRAME = 0, 3079 RT_SUB_FRAME = 1, 3080 RT_STYLESHEET = 2, 3081 RT_SCRIPT = 3, 3082 RT_IMAGE = 4, 3083 RT_FONT_RESOURCE = 5, 3084 RT_SUB_RESOURCE = 6, 3085 RT_OBJECT = 7, 3086 RT_MEDIA = 8, 3087 RT_WORKER = 9, 3088 RT_SHARED_WORKER = 10, 3089 RT_PREFETCH = 11, 3090 RT_FAVICON = 12, 3091 RT_XHR = 13, 3092 RT_PING = 14, 3093 RT_SERVICE_WORKER = 15, 3094 RT_CSP_REPORT = 16, 3095 RT_PLUGIN_RESOURCE = 17, 3096 RT_NAVIGATION_PRELOAD_MAIN_FRAME = 19, 3097 RT_NAVIGATION_PRELOAD_SUB_FRAME = 20 3098 } 3099 3100 enum cef_transition_type_t 3101 { 3102 TT_LINK = 0, 3103 TT_EXPLICIT = 1, 3104 TT_AUTO_SUBFRAME = 3, 3105 TT_MANUAL_SUBFRAME = 4, 3106 TT_FORM_SUBMIT = 7, 3107 // the same URL. NOTE: This is distinct from the concept of whether a 3108 // particular load uses "reload semantics" (i.e. bypasses cached data). 3109 /// 3110 TT_RELOAD = 8, 3111 3112 /// 3113 // General mask defining the bits used for the source values. 3114 /// 3115 TT_SOURCE_MASK = 0xFF, 3116 3117 // Qualifiers. 3118 // Any of the core values above can be augmented by one or more qualifiers. 3119 // These qualifiers further define the transition. 3120 3121 /// 3122 // Attempted to visit a URL but was blocked. 3123 /// 3124 TT_BLOCKED_FLAG = 0x00800000, 3125 3126 /// 3127 // Used the Forward or Back function to navigate among browsing history. 3128 // Will be ORed to the transition type for the original load. 3129 /// 3130 TT_FORWARD_BACK_FLAG = 0x01000000, 3131 3132 /// 3133 // Loaded a URL directly via CreateBrowser, LoadURL or LoadRequest. 3134 /// 3135 TT_DIRECT_LOAD_FLAG = 0x02000000, 3136 3137 /// 3138 // The beginning of a navigation chain. 3139 /// 3140 TT_CHAIN_START_FLAG = 0x10000000, 3141 3142 /// 3143 // The last transition in a redirect chain. 3144 /// 3145 TT_CHAIN_END_FLAG = 0x20000000, 3146 3147 /// 3148 // Redirects caused by JavaScript or a meta refresh tag on the page. 3149 /// 3150 TT_CLIENT_REDIRECT_FLAG = 0x40000000, 3151 3152 /// 3153 // Redirects sent from the server by HTTP headers. 3154 /// 3155 TT_SERVER_REDIRECT_FLAG = 0x80000000, 3156 3157 /// 3158 // Used to test whether a transition involves a redirect. 3159 /// 3160 TT_IS_REDIRECT_MASK = 0xC0000000, 3161 3162 /// 3163 // General mask defining the bits used for the qualifiers. 3164 /// 3165 TT_QUALIFIER_MASK = 0xFFFFFF00 3166 } 3167 3168 /// 3169 // Flags used to customize the behavior of CefURLRequest. 3170 /// 3171 enum cef_urlrequest_flags_t 3172 { 3173 /// 3174 // Default behavior. 3175 /// 3176 UR_FLAG_NONE = 0, 3177 3178 /// 3179 // If set the cache will be skipped when handling the request. Setting this 3180 // value is equivalent to specifying the "Cache-Control: no-cache" request 3181 // header. Setting this value in combination with UR_FLAG_ONLY_FROM_CACHE will 3182 // cause the request to fail. 3183 /// 3184 UR_FLAG_SKIP_CACHE = 1 << 0, 3185 3186 /// 3187 // If set the request will fail if it cannot be served from the cache (or some 3188 // equivalent local store). Setting this value is equivalent to specifying the 3189 // "Cache-Control: only-if-cached" request header. Setting this value in 3190 // combination with UR_FLAG_SKIP_CACHE or UR_FLAG_DISABLE_CACHE will cause the 3191 // request to fail. 3192 /// 3193 UR_FLAG_ONLY_FROM_CACHE = 1 << 1, 3194 3195 /// 3196 // If set the cache will not be used at all. Setting this value is equivalent 3197 // to specifying the "Cache-Control: no-store" request header. Setting this 3198 // value in combination with UR_FLAG_ONLY_FROM_CACHE will cause the request to 3199 // fail. 3200 /// 3201 UR_FLAG_DISABLE_CACHE = 1 << 2, 3202 3203 /// 3204 // If set user name, password, and cookies may be sent with the request, and 3205 // cookies may be saved from the response. 3206 /// 3207 UR_FLAG_ALLOW_STORED_CREDENTIALS = 1 << 3, 3208 3209 /// 3210 // If set upload progress events will be generated when a request has a body. 3211 /// 3212 UR_FLAG_REPORT_UPLOAD_PROGRESS = 1 << 4, 3213 3214 /// 3215 // If set the CefURLRequestClient::OnDownloadData method will not be called. 3216 /// 3217 UR_FLAG_NO_DOWNLOAD_DATA = 1 << 5, 3218 3219 /// 3220 // If set 5XX redirect errors will be propagated to the observer instead of 3221 // automatically re-tried. This currently only applies for requests 3222 // originated in the browser process. 3223 /// 3224 UR_FLAG_NO_RETRY_ON_5XX = 1 << 6, 3225 3226 /// 3227 // If set 3XX responses will cause the fetch to halt immediately rather than 3228 // continue through the redirect. 3229 /// 3230 UR_FLAG_STOP_ON_REDIRECT = 1 << 7 3231 } 3232 3233 /// 3234 // Flags that represent CefURLRequest status. 3235 /// 3236 enum cef_urlrequest_status_t 3237 { 3238 /// 3239 // Unknown status. 3240 /// 3241 UR_UNKNOWN = 0, 3242 3243 /// 3244 // Request succeeded. 3245 /// 3246 UR_SUCCESS = 1, 3247 3248 /// 3249 // An IO request is pending, and the caller will be informed when it is 3250 // completed. 3251 /// 3252 UR_IO_PENDING = 2, 3253 3254 /// 3255 // Request was canceled programatically. 3256 /// 3257 UR_CANCELED = 3, 3258 3259 /// 3260 // Request failed for some reason. 3261 /// 3262 UR_FAILED = 4 3263 } 3264 3265 // Structure representing a draggable region. 3266 /// 3267 struct cef_draggable_region_t 3268 { 3269 /// 3270 // Bounds of the region. 3271 /// 3272 cef_rect_t bounds; 3273 3274 /// 3275 // True (1) this this region is draggable and false (0) otherwise. 3276 /// 3277 int draggable; 3278 } 3279 3280 3281 3282 /// 3283 // Existing process IDs. 3284 /// 3285 enum cef_process_id_t 3286 { 3287 /// 3288 // Browser process. 3289 /// 3290 PID_BROWSER = 0, 3291 /// 3292 // Renderer process. 3293 /// 3294 PID_RENDERER = 1 3295 } 3296 3297 /// 3298 // Existing thread IDs. 3299 /// 3300 enum cef_thread_id_t 3301 { 3302 // BROWSER PROCESS THREADS -- Only available in the browser process. 3303 3304 /// 3305 // The main thread in the browser. This will be the same as the main 3306 // application thread if CefInitialize() is called with a 3307 // CefSettings.multi_threaded_message_loop value of false. Do not perform 3308 // blocking tasks on this thread. All tasks posted after 3309 // CefBrowserProcessHandler::OnContextInitialized() and before CefShutdown() 3310 // are guaranteed to run. This thread will outlive all other CEF threads. 3311 /// 3312 TID_UI = 0, 3313 3314 /// 3315 // Used for blocking tasks (e.g. file system access) where the user won't 3316 // notice if the task takes an arbitrarily long time to complete. All tasks 3317 // posted after CefBrowserProcessHandler::OnContextInitialized() and before 3318 // CefShutdown() are guaranteed to run. 3319 /// 3320 TID_FILE_BACKGROUND = 1, 3321 3322 /// 3323 // Used for blocking tasks (e.g. file system access) that affect UI or 3324 // responsiveness of future user interactions. Do not use if an immediate 3325 // response to a user interaction is expected. All tasks posted after 3326 // CefBrowserProcessHandler::OnContextInitialized() and before CefShutdown() 3327 // are guaranteed to run. 3328 // Examples: 3329 // - Updating the UI to reflect progress on a long task. 3330 // - Loading data that might be shown in the UI after a future user 3331 // interaction. 3332 /// 3333 TID_FILE_USER_VISIBLE = 2, 3334 3335 /// 3336 // Used for blocking tasks (e.g. file system access) that affect UI 3337 // immediately after a user interaction. All tasks posted after 3338 // CefBrowserProcessHandler::OnContextInitialized() and before CefShutdown() 3339 // are guaranteed to run. 3340 // Example: Generating data shown in the UI immediately after a click. 3341 /// 3342 TID_FILE_USER_BLOCKING = 3, 3343 3344 /// 3345 // Used to launch and terminate browser processes. 3346 /// 3347 TID_PROCESS_LAUNCHER = 4, 3348 3349 /// 3350 // Used to process IPC and network messages. Do not perform blocking tasks on 3351 // this thread. All tasks posted after 3352 // CefBrowserProcessHandler::OnContextInitialized() and before CefShutdown() 3353 // are guaranteed to run. 3354 /// 3355 TID_IO = 5, 3356 3357 // RENDER PROCESS THREADS -- Only available in the render process. 3358 3359 /// 3360 // The main thread in the renderer. Used for all WebKit and V8 interaction. 3361 // Tasks may be posted to this thread after 3362 // CefRenderProcessHandler::OnWebKitInitialized but are not guaranteed to 3363 // run before sub-process termination (sub-processes may be killed at any time 3364 // without warning). 3365 /// 3366 TID_RENDERER = 6 3367 } 3368 3369 /// 3370 // Thread priority values listed in increasing order of importance. 3371 /// 3372 enum cef_thread_priority_t 3373 { 3374 /// 3375 // Suitable for threads that shouldn't disrupt high priority work. 3376 /// 3377 TP_BACKGROUND = 0, 3378 3379 /// 3380 // Default priority level. 3381 /// 3382 TP_NORMAL = 1, 3383 3384 /// 3385 // Suitable for threads which generate data for the display (at ~60Hz). 3386 /// 3387 TP_DISPLAY = 2, 3388 3389 /// 3390 // Suitable for low-latency, glitch-resistant audio. 3391 /// 3392 TP_REALTIME_AUDIO = 3 3393 } 3394 3395 /// 3396 // Message loop types. Indicates the set of asynchronous events that a message 3397 // loop can process. 3398 /// 3399 enum cef_message_loop_type_t 3400 { 3401 /// 3402 // Supports tasks and timers. 3403 /// 3404 ML_TYPE_DEFAULT = 0, 3405 3406 /// 3407 // Supports tasks, timers and native UI events (e.g. Windows messages). 3408 /// 3409 ML_TYPE_UI = 1, 3410 3411 /// 3412 // Supports tasks, timers and asynchronous IO events. 3413 /// 3414 ML_TYPE_IO = 2 3415 } 3416 3417 /// 3418 // Windows COM initialization mode. Specifies how COM will be initialized for a 3419 // new thread. 3420 /// 3421 enum cef_com_init_mode_t 3422 { 3423 /// 3424 // No COM initialization. 3425 /// 3426 COM_INIT_MODE_NONE = 0, 3427 3428 /// 3429 // Initialize COM using single-threaded apartments. 3430 /// 3431 COM_INIT_MODE_STA = 1, 3432 3433 /// 3434 // Initialize COM using multi-threaded apartments. 3435 /// 3436 COM_INIT_MODE_MTA = 2 3437 } 3438 3439 /// 3440 // Supported value types. 3441 /// 3442 enum cef_value_type_t 3443 { 3444 VTYPE_INVALID = 0, 3445 VTYPE_NULL = 1, 3446 VTYPE_BOOL = 2, 3447 VTYPE_INT = 3, 3448 VTYPE_DOUBLE = 4, 3449 VTYPE_STRING = 5, 3450 VTYPE_BINARY = 6, 3451 VTYPE_DICTIONARY = 7, 3452 VTYPE_LIST = 8 3453 } 3454 3455 /// 3456 // Supported JavaScript dialog types. 3457 /// 3458 enum cef_jsdialog_type_t 3459 { 3460 JSDIALOGTYPE_ALERT = 0, 3461 JSDIALOGTYPE_CONFIRM = 1, 3462 JSDIALOGTYPE_PROMPT = 2 3463 } 3464 3465 /// 3466 // Screen information used when window rendering is disabled. This structure is 3467 // passed as a parameter to CefRenderHandler::GetScreenInfo and should be filled 3468 // in by the client. 3469 /// 3470 struct cef_screen_info_t 3471 { 3472 /// 3473 // Device scale factor. Specifies the ratio between physical and logical 3474 // pixels. 3475 /// 3476 float device_scale_factor; 3477 3478 /// 3479 // The screen depth in bits per pixel. 3480 /// 3481 int depth; 3482 3483 /// 3484 // The bits per color component. This assumes that the colors are balanced 3485 // equally. 3486 /// 3487 int depth_per_component; 3488 3489 /// 3490 // This can be true for black and white printers. 3491 /// 3492 int is_monochrome; 3493 3494 /// 3495 // This is set from the rcMonitor member of MONITORINFOEX, to whit: 3496 // "A RECT structure that specifies the display monitor rectangle, 3497 // expressed in virtual-screen coordinates. Note that if the monitor 3498 // is not the primary display monitor, some of the rectangle's 3499 // coordinates may be negative values." 3500 // 3501 // The |rect| and |available_rect| properties are used to determine the 3502 // available surface for rendering popup views. 3503 /// 3504 cef_rect_t rect; 3505 3506 /// 3507 // This is set from the rcWork member of MONITORINFOEX, to whit: 3508 // "A RECT structure that specifies the work area rectangle of the 3509 // display monitor that can be used by applications, expressed in 3510 // virtual-screen coordinates. Windows uses this rectangle to 3511 // maximize an application on the monitor. The rest of the area in 3512 // rcMonitor contains system windows such as the task bar and side 3513 // bars. Note that if the monitor is not the primary display monitor, 3514 // some of the rectangle's coordinates may be negative values". 3515 // 3516 // The |rect| and |available_rect| properties are used to determine the 3517 // available surface for rendering popup views. 3518 /// 3519 cef_rect_t available_rect; 3520 } 3521 3522 3523 3524 /// 3525 // Supported menu IDs. Non-English translations can be provided for the 3526 // IDS_MENU_* strings in CefResourceBundleHandler::GetLocalizedString(). 3527 /// 3528 enum cef_menu_id_t 3529 { 3530 // Navigation. 3531 MENU_ID_BACK = 100, 3532 MENU_ID_FORWARD = 101, 3533 MENU_ID_RELOAD = 102, 3534 MENU_ID_RELOAD_NOCACHE = 103, 3535 MENU_ID_STOPLOAD = 104, 3536 3537 // Editing. 3538 MENU_ID_UNDO = 110, 3539 MENU_ID_REDO = 111, 3540 MENU_ID_CUT = 112, 3541 MENU_ID_COPY = 113, 3542 MENU_ID_PASTE = 114, 3543 MENU_ID_DELETE = 115, 3544 MENU_ID_SELECT_ALL = 116, 3545 3546 // Miscellaneous. 3547 MENU_ID_FIND = 130, 3548 MENU_ID_PRINT = 131, 3549 MENU_ID_VIEW_SOURCE = 132, 3550 3551 // Spell checking word correction suggestions. 3552 MENU_ID_SPELLCHECK_SUGGESTION_0 = 200, 3553 MENU_ID_SPELLCHECK_SUGGESTION_1 = 201, 3554 MENU_ID_SPELLCHECK_SUGGESTION_2 = 202, 3555 MENU_ID_SPELLCHECK_SUGGESTION_3 = 203, 3556 MENU_ID_SPELLCHECK_SUGGESTION_4 = 204, 3557 MENU_ID_SPELLCHECK_SUGGESTION_LAST = 204, 3558 MENU_ID_NO_SPELLING_SUGGESTIONS = 205, 3559 MENU_ID_ADD_TO_DICTIONARY = 206, 3560 3561 // Custom menu items originating from the renderer process. For example, 3562 // plugin placeholder menu items. 3563 MENU_ID_CUSTOM_FIRST = 220, 3564 MENU_ID_CUSTOM_LAST = 250, 3565 3566 // All user-defined menu IDs should come between MENU_ID_USER_FIRST and 3567 // MENU_ID_USER_LAST to avoid overlapping the Chromium and CEF ID ranges 3568 // defined in the tools/gritsettings/resource_ids file. 3569 MENU_ID_USER_FIRST = 26500, 3570 MENU_ID_USER_LAST = 28500 3571 } 3572 3573 /// 3574 // Mouse button types. 3575 /// 3576 enum cef_mouse_button_type_t 3577 { 3578 MBT_LEFT = 0, 3579 MBT_MIDDLE = 1, 3580 MBT_RIGHT = 2 3581 } 3582 3583 /// 3584 // Structure representing mouse event information. 3585 /// 3586 struct cef_mouse_event_t 3587 { 3588 /// 3589 // X coordinate relative to the left side of the view. 3590 /// 3591 int x; 3592 3593 /// 3594 // Y coordinate relative to the top side of the view. 3595 /// 3596 int y; 3597 3598 /// 3599 // Bit flags describing any pressed modifier keys. See 3600 // cef_event_flags_t for values. 3601 /// 3602 uint32 modifiers; 3603 } 3604 3605 3606 3607 /// 3608 // Touch points states types. 3609 /// 3610 enum cef_touch_event_type_t 3611 { 3612 CEF_TET_RELEASED = 0, 3613 CEF_TET_PRESSED = 1, 3614 CEF_TET_MOVED = 2, 3615 CEF_TET_CANCELLED = 3 3616 } 3617 3618 /// 3619 // The device type that caused the event. 3620 /// 3621 enum cef_pointer_type_t 3622 { 3623 CEF_POINTER_TYPE_TOUCH = 0, 3624 CEF_POINTER_TYPE_MOUSE = 1, 3625 CEF_POINTER_TYPE_PEN = 2, 3626 CEF_POINTER_TYPE_ERASER = 3, 3627 CEF_POINTER_TYPE_UNKNOWN = 4 3628 } 3629 3630 /// 3631 // Structure representing touch event information. 3632 /// 3633 struct cef_touch_event_t 3634 { 3635 /// 3636 // Id of a touch point. Must be unique per touch, can be any number except -1. 3637 // Note that a maximum of 16 concurrent touches will be tracked; touches 3638 // beyond that will be ignored. 3639 /// 3640 int id; 3641 3642 /// 3643 // X coordinate relative to the left side of the view. 3644 /// 3645 float x; 3646 3647 /// 3648 // Y coordinate relative to the top side of the view. 3649 /// 3650 float y; 3651 3652 /// 3653 // X radius in pixels. Set to 0 if not applicable. 3654 /// 3655 float radius_x; 3656 3657 /// 3658 // Y radius in pixels. Set to 0 if not applicable. 3659 /// 3660 float radius_y; 3661 3662 /// 3663 // Rotation angle in radians. Set to 0 if not applicable. 3664 /// 3665 float rotation_angle; 3666 3667 /// 3668 // The normalized pressure of the pointer input in the range of [0,1]. 3669 // Set to 0 if not applicable. 3670 /// 3671 float pressure; 3672 3673 /// 3674 // The state of the touch point. Touches begin with one CEF_TET_PRESSED event 3675 // followed by zero or more CEF_TET_MOVED events and finally one 3676 // CEF_TET_RELEASED or CEF_TET_CANCELLED event. Events not respecting this 3677 // order will be ignored. 3678 /// 3679 cef_touch_event_type_t type; 3680 3681 /// 3682 // Bit flags describing any pressed modifier keys. See 3683 // cef_event_flags_t for values. 3684 /// 3685 uint32 modifiers; 3686 3687 /// 3688 // The device type that caused the event. 3689 /// 3690 cef_pointer_type_t pointer_type; 3691 } 3692 3693 3694 3695 /// 3696 // Paint element types. 3697 /// 3698 enum cef_paint_element_type_t 3699 { 3700 PET_VIEW = 0, 3701 PET_POPUP = 1 3702 } 3703 3704 /// 3705 // Supported event bit flags. 3706 /// 3707 enum cef_event_flags_t 3708 { 3709 EVENTFLAG_NONE = 0, 3710 EVENTFLAG_CAPS_LOCK_ON = 1 << 0, 3711 EVENTFLAG_SHIFT_DOWN = 1 << 1, 3712 EVENTFLAG_CONTROL_DOWN = 1 << 2, 3713 EVENTFLAG_ALT_DOWN = 1 << 3, 3714 EVENTFLAG_LEFT_MOUSE_BUTTON = 1 << 4, 3715 EVENTFLAG_MIDDLE_MOUSE_BUTTON = 1 << 5, 3716 EVENTFLAG_RIGHT_MOUSE_BUTTON = 1 << 6, 3717 // Mac OS-X command key. 3718 EVENTFLAG_COMMAND_DOWN = 1 << 7, 3719 EVENTFLAG_NUM_LOCK_ON = 1 << 8, 3720 EVENTFLAG_IS_KEY_PAD = 1 << 9, 3721 EVENTFLAG_IS_LEFT = 1 << 10, 3722 EVENTFLAG_IS_RIGHT = 1 << 11, 3723 EVENTFLAG_ALTGR_DOWN = 1 << 12, 3724 EVENTFLAG_IS_REPEAT = 1 << 13 3725 } 3726 3727 /// 3728 // Supported menu item types. 3729 /// 3730 enum cef_menu_item_type_t 3731 { 3732 MENUITEMTYPE_NONE = 0, 3733 MENUITEMTYPE_COMMAND = 1, 3734 MENUITEMTYPE_CHECK = 2, 3735 MENUITEMTYPE_RADIO = 3, 3736 MENUITEMTYPE_SEPARATOR = 4, 3737 MENUITEMTYPE_SUBMENU = 5 3738 } 3739 3740 /// 3741 // Supported context menu type flags. 3742 /// 3743 enum cef_context_menu_type_flags_t 3744 { 3745 /// 3746 // No node is selected. 3747 /// 3748 CM_TYPEFLAG_NONE = 0, 3749 /// 3750 // The top page is selected. 3751 /// 3752 CM_TYPEFLAG_PAGE = 1 << 0, 3753 /// 3754 // A subframe page is selected. 3755 /// 3756 CM_TYPEFLAG_FRAME = 1 << 1, 3757 /// 3758 // A link is selected. 3759 /// 3760 CM_TYPEFLAG_LINK = 1 << 2, 3761 /// 3762 // A media node is selected. 3763 /// 3764 CM_TYPEFLAG_MEDIA = 1 << 3, 3765 /// 3766 // There is a textual or mixed selection that is selected. 3767 /// 3768 CM_TYPEFLAG_SELECTION = 1 << 4, 3769 /// 3770 // An editable element is selected. 3771 /// 3772 CM_TYPEFLAG_EDITABLE = 1 << 5 3773 } 3774 3775 /// 3776 // Supported context menu media types. 3777 /// 3778 enum cef_context_menu_media_type_t 3779 { 3780 /// 3781 // No special node is in context. 3782 /// 3783 CM_MEDIATYPE_NONE = 0, 3784 /// 3785 // An image node is selected. 3786 /// 3787 CM_MEDIATYPE_IMAGE = 1, 3788 /// 3789 // A video node is selected. 3790 /// 3791 CM_MEDIATYPE_VIDEO = 2, 3792 /// 3793 // An audio node is selected. 3794 /// 3795 CM_MEDIATYPE_AUDIO = 3, 3796 /// 3797 // A file node is selected. 3798 /// 3799 CM_MEDIATYPE_FILE = 4, 3800 /// 3801 // A plugin node is selected. 3802 /// 3803 CM_MEDIATYPE_PLUGIN = 5 3804 } 3805 3806 /// 3807 // Supported context menu media state bit flags. 3808 /// 3809 enum cef_context_menu_media_state_flags_t 3810 { 3811 CM_MEDIAFLAG_NONE = 0, 3812 CM_MEDIAFLAG_ERROR = 1 << 0, 3813 CM_MEDIAFLAG_PAUSED = 1 << 1, 3814 CM_MEDIAFLAG_MUTED = 1 << 2, 3815 CM_MEDIAFLAG_LOOP = 1 << 3, 3816 CM_MEDIAFLAG_CAN_SAVE = 1 << 4, 3817 CM_MEDIAFLAG_HAS_AUDIO = 1 << 5, 3818 CM_MEDIAFLAG_HAS_VIDEO = 1 << 6, 3819 CM_MEDIAFLAG_CONTROL_ROOT_ELEMENT = 1 << 7, 3820 CM_MEDIAFLAG_CAN_PRINT = 1 << 8, 3821 CM_MEDIAFLAG_CAN_ROTATE = 1 << 9 3822 } 3823 3824 /// 3825 // Supported context menu edit state bit flags. 3826 /// 3827 enum cef_context_menu_edit_state_flags_t 3828 { 3829 CM_EDITFLAG_NONE = 0, 3830 CM_EDITFLAG_CAN_UNDO = 1 << 0, 3831 CM_EDITFLAG_CAN_REDO = 1 << 1, 3832 CM_EDITFLAG_CAN_CUT = 1 << 2, 3833 CM_EDITFLAG_CAN_COPY = 1 << 3, 3834 CM_EDITFLAG_CAN_PASTE = 1 << 4, 3835 CM_EDITFLAG_CAN_DELETE = 1 << 5, 3836 CM_EDITFLAG_CAN_SELECT_ALL = 1 << 6, 3837 CM_EDITFLAG_CAN_TRANSLATE = 1 << 7 3838 } 3839 3840 /// 3841 // Key event types. 3842 /// 3843 enum cef_key_event_type_t 3844 { 3845 /// 3846 // Notification that a key transitioned from "up" to "down". 3847 /// 3848 KEYEVENT_RAWKEYDOWN = 0, 3849 3850 /// 3851 // Notification that a key was pressed. This does not necessarily correspond 3852 // to a character depending on the key and language. Use KEYEVENT_CHAR for 3853 // character input. 3854 /// 3855 KEYEVENT_KEYDOWN = 1, 3856 3857 /// 3858 // Notification that a key was released. 3859 /// 3860 KEYEVENT_KEYUP = 2, 3861 3862 /// 3863 // Notification that a character was typed. Use this for text input. Key 3864 // down events may generate 0, 1, or more than one character event depending 3865 // on the key, locale, and operating system. 3866 /// 3867 KEYEVENT_CHAR = 3 3868 } 3869 3870 /// 3871 // Structure representing keyboard event information. 3872 /// 3873 struct cef_key_event_t 3874 { 3875 /// 3876 // The type of keyboard event. 3877 /// 3878 cef_key_event_type_t type; 3879 3880 /// 3881 // Bit flags describing any pressed modifier keys. See 3882 // cef_event_flags_t for values. 3883 /// 3884 uint32 modifiers; 3885 3886 /// 3887 // The Windows key code for the key event. This value is used by the DOM 3888 // specification. Sometimes it comes directly from the event (i.e. on 3889 // Windows) and sometimes it's determined using a mapping function. See 3890 // WebCore/platform/chromium/KeyboardCodes.h for the list of values. 3891 /// 3892 int windows_key_code; 3893 3894 /// 3895 // The actual key code genenerated by the platform. 3896 /// 3897 int native_key_code; 3898 3899 /// 3900 // Indicates whether the event is considered a "system key" event (see 3901 // http://msdn.microsoft.com/en-us/library/ms646286(VS.85).aspx for details). 3902 // This value will always be false on non-Windows platforms. 3903 /// 3904 int is_system_key; 3905 3906 /// 3907 // The character generated by the keystroke. 3908 /// 3909 char16 character; 3910 3911 /// 3912 // Same as |character| but unmodified by any concurrently-held modifiers 3913 // (except shift). This is useful for working out shortcut keys. 3914 /// 3915 char16 unmodified_character; 3916 3917 /// 3918 // True if the focus is currently on an editable field on the page. This is 3919 // useful for determining if standard key events should be intercepted. 3920 /// 3921 int focus_on_editable_field; 3922 } 3923 3924 3925 3926 /// 3927 // Focus sources. 3928 /// 3929 enum cef_focus_source_t 3930 { 3931 /// 3932 // The source is explicit navigation via the API (LoadURL(), etc). 3933 /// 3934 FOCUS_SOURCE_NAVIGATION = 0, 3935 /// 3936 // The source is a system-generated focus event. 3937 /// 3938 FOCUS_SOURCE_SYSTEM = 1 3939 } 3940 3941 /// 3942 // Navigation types. 3943 /// 3944 enum cef_navigation_type_t 3945 { 3946 NAVIGATION_LINK_CLICKED = 0, 3947 NAVIGATION_FORM_SUBMITTED = 1, 3948 NAVIGATION_BACK_FORWARD = 2, 3949 NAVIGATION_RELOAD = 3, 3950 NAVIGATION_FORM_RESUBMITTED = 4, 3951 NAVIGATION_OTHER = 5 3952 } 3953 3954 /// 3955 // Supported XML encoding types. The parser supports ASCII, ISO-8859-1, and 3956 // UTF16 (LE and BE) by default. All other types must be translated to UTF8 3957 // before being passed to the parser. If a BOM is detected and the correct 3958 // decoder is available then that decoder will be used automatically. 3959 /// 3960 enum cef_xml_encoding_type_t 3961 { 3962 XML_ENCODING_NONE = 0, 3963 XML_ENCODING_UTF8 = 1, 3964 XML_ENCODING_UTF16LE = 2, 3965 XML_ENCODING_UTF16BE = 3, 3966 XML_ENCODING_ASCII = 4 3967 } 3968 3969 /// 3970 // XML node types. 3971 /// 3972 enum cef_xml_node_type_t 3973 { 3974 XML_NODE_UNSUPPORTED = 0, 3975 XML_NODE_PROCESSING_INSTRUCTION = 1, 3976 XML_NODE_DOCUMENT_TYPE = 2, 3977 XML_NODE_ELEMENT_START = 3, 3978 XML_NODE_ELEMENT_END = 4, 3979 XML_NODE_ATTRIBUTE = 5, 3980 XML_NODE_TEXT = 6, 3981 XML_NODE_CDATA = 7, 3982 XML_NODE_ENTITY_REFERENCE = 8, 3983 XML_NODE_WHITESPACE = 9, 3984 XML_NODE_COMMENT = 10 3985 } 3986 3987 /// 3988 // Popup window features. 3989 /// 3990 struct cef_popup_features_t 3991 { 3992 int x; 3993 int xSet; 3994 int y; 3995 int ySet; 3996 int width; 3997 int widthSet; 3998 int height; 3999 int heightSet; 4000 4001 int menuBarVisible; 4002 int statusBarVisible; 4003 int toolBarVisible; 4004 int scrollbarsVisible; 4005 } 4006 4007 4008 4009 /// 4010 // DOM document types. 4011 /// 4012 enum cef_dom_document_type_t 4013 { 4014 DOM_DOCUMENT_TYPE_UNKNOWN = 0, 4015 DOM_DOCUMENT_TYPE_HTML = 1, 4016 DOM_DOCUMENT_TYPE_XHTML = 2, 4017 DOM_DOCUMENT_TYPE_PLUGIN = 3 4018 } 4019 4020 /// 4021 // DOM event category flags. 4022 /// 4023 enum cef_dom_event_category_t 4024 { 4025 DOM_EVENT_CATEGORY_UNKNOWN = 0x0, 4026 DOM_EVENT_CATEGORY_UI = 0x1, 4027 DOM_EVENT_CATEGORY_MOUSE = 0x2, 4028 DOM_EVENT_CATEGORY_MUTATION = 0x4, 4029 DOM_EVENT_CATEGORY_KEYBOARD = 0x8, 4030 DOM_EVENT_CATEGORY_TEXT = 0x10, 4031 DOM_EVENT_CATEGORY_COMPOSITION = 0x20, 4032 DOM_EVENT_CATEGORY_DRAG = 0x40, 4033 DOM_EVENT_CATEGORY_CLIPBOARD = 0x80, 4034 DOM_EVENT_CATEGORY_MESSAGE = 0x100, 4035 DOM_EVENT_CATEGORY_WHEEL = 0x200, 4036 DOM_EVENT_CATEGORY_BEFORE_TEXT_INSERTED = 0x400, 4037 DOM_EVENT_CATEGORY_OVERFLOW = 0x800, 4038 DOM_EVENT_CATEGORY_PAGE_TRANSITION = 0x1000, 4039 DOM_EVENT_CATEGORY_POPSTATE = 0x2000, 4040 DOM_EVENT_CATEGORY_PROGRESS = 0x4000, 4041 DOM_EVENT_CATEGORY_XMLHTTPREQUEST_PROGRESS = 0x8000 4042 } 4043 4044 /// 4045 // DOM event processing phases. 4046 /// 4047 enum cef_dom_event_phase_t 4048 { 4049 DOM_EVENT_PHASE_UNKNOWN = 0, 4050 DOM_EVENT_PHASE_CAPTURING = 1, 4051 DOM_EVENT_PHASE_AT_TARGET = 2, 4052 DOM_EVENT_PHASE_BUBBLING = 3 4053 } 4054 4055 /// 4056 // DOM node types. 4057 /// 4058 enum cef_dom_node_type_t 4059 { 4060 DOM_NODE_TYPE_UNSUPPORTED = 0, 4061 DOM_NODE_TYPE_ELEMENT = 1, 4062 DOM_NODE_TYPE_ATTRIBUTE = 2, 4063 DOM_NODE_TYPE_TEXT = 3, 4064 DOM_NODE_TYPE_CDATA_SECTION = 4, 4065 DOM_NODE_TYPE_PROCESSING_INSTRUCTIONS = 5, 4066 DOM_NODE_TYPE_COMMENT = 6, 4067 DOM_NODE_TYPE_DOCUMENT = 7, 4068 DOM_NODE_TYPE_DOCUMENT_TYPE = 8, 4069 DOM_NODE_TYPE_DOCUMENT_FRAGMENT = 9 4070 } 4071 4072 /// 4073 // Supported file dialog modes. 4074 /// 4075 enum cef_file_dialog_mode_t 4076 { 4077 /// 4078 // Requires that the file exists before allowing the user to pick it. 4079 /// 4080 FILE_DIALOG_OPEN = 0, 4081 4082 /// 4083 // Like Open, but allows picking multiple files to open. 4084 /// 4085 FILE_DIALOG_OPEN_MULTIPLE = 1, 4086 4087 /// 4088 // Like Open, but selects a folder to open. 4089 /// 4090 FILE_DIALOG_OPEN_FOLDER = 2, 4091 4092 /// 4093 // Allows picking a nonexistent file, and prompts to overwrite if the file 4094 // already exists. 4095 /// 4096 FILE_DIALOG_SAVE = 3, 4097 4098 /// 4099 // General mask defining the bits used for the type values. 4100 /// 4101 FILE_DIALOG_TYPE_MASK = 0xFF, 4102 4103 // Qualifiers. 4104 // Any of the type values above can be augmented by one or more qualifiers. 4105 // These qualifiers further define the dialog behavior. 4106 4107 /// 4108 // Prompt to overwrite if the user selects an existing file with the Save 4109 // dialog. 4110 /// 4111 FILE_DIALOG_OVERWRITEPROMPT_FLAG = 0x01000000, 4112 4113 /// 4114 // Do not display read-only files. 4115 /// 4116 FILE_DIALOG_HIDEREADONLY_FLAG = 0x02000000 4117 } 4118 4119 /// 4120 // Print job color mode values. 4121 /// 4122 enum cef_color_model_t 4123 { 4124 COLOR_MODEL_UNKNOWN = 0, 4125 COLOR_MODEL_GRAY = 1, 4126 COLOR_MODEL_COLOR = 2, 4127 COLOR_MODEL_CMYK = 3, 4128 COLOR_MODEL_CMY = 4, 4129 COLOR_MODEL_KCMY = 5, 4130 COLOR_MODEL_CMY_K = 6, // CMY_K represents CMY+K. 4131 COLOR_MODEL_BLACK = 7, 4132 COLOR_MODEL_GRAYSCALE = 8, 4133 COLOR_MODEL_RGB = 9, 4134 COLOR_MODEL_RGB16 = 10, 4135 COLOR_MODEL_RGBA = 11, 4136 COLOR_MODEL_COLORMODE_COLOR = 12, // Used in samsung printer ppds. 4137 COLOR_MODEL_COLORMODE_MONOCHROME = 13, // Used in samsung printer ppds. 4138 COLOR_MODEL_HP_COLOR_COLOR = 14, // Used in HP color printer ppds. 4139 COLOR_MODEL_HP_COLOR_BLACK = 15, // Used in HP color printer ppds. 4140 COLOR_MODEL_PRINTOUTMODE_NORMAL = 16, // Used in foomatic ppds. 4141 COLOR_MODEL_PRINTOUTMODE_NORMAL_GRAY = 17, // Used in foomatic ppds. 4142 COLOR_MODEL_PROCESSCOLORMODEL_CMYK = 18, // Used in canon printer ppds. 4143 COLOR_MODEL_PROCESSCOLORMODEL_GREYSCALE = 19, // Used in canon printer ppds. 4144 COLOR_MODEL_PROCESSCOLORMODEL_RGB = 20 // Used in canon printer ppds 4145 } 4146 4147 /// 4148 // Print job duplex mode values. 4149 /// 4150 enum cef_duplex_mode_t 4151 { 4152 DUPLEX_MODE_UNKNOWN = -1, 4153 DUPLEX_MODE_SIMPLEX = 0, 4154 DUPLEX_MODE_LONG_EDGE = 1, 4155 DUPLEX_MODE_SHORT_EDGE = 2 4156 } 4157 4158 /// 4159 // Cursor type values. 4160 /// 4161 enum cef_cursor_type_t 4162 { 4163 CT_POINTER = 0, 4164 CT_CROSS = 1, 4165 CT_HAND = 2, 4166 CT_IBEAM = 3, 4167 CT_WAIT = 4, 4168 CT_HELP = 5, 4169 CT_EASTRESIZE = 6, 4170 CT_NORTHRESIZE = 7, 4171 CT_NORTHEASTRESIZE = 8, 4172 CT_NORTHWESTRESIZE = 9, 4173 CT_SOUTHRESIZE = 10, 4174 CT_SOUTHEASTRESIZE = 11, 4175 CT_SOUTHWESTRESIZE = 12, 4176 CT_WESTRESIZE = 13, 4177 CT_NORTHSOUTHRESIZE = 14, 4178 CT_EASTWESTRESIZE = 15, 4179 CT_NORTHEASTSOUTHWESTRESIZE = 16, 4180 CT_NORTHWESTSOUTHEASTRESIZE = 17, 4181 CT_COLUMNRESIZE = 18, 4182 CT_ROWRESIZE = 19, 4183 CT_MIDDLEPANNING = 20, 4184 CT_EASTPANNING = 21, 4185 CT_NORTHPANNING = 22, 4186 CT_NORTHEASTPANNING = 23, 4187 CT_NORTHWESTPANNING = 24, 4188 CT_SOUTHPANNING = 25, 4189 CT_SOUTHEASTPANNING = 26, 4190 CT_SOUTHWESTPANNING = 27, 4191 CT_WESTPANNING = 28, 4192 CT_MOVE = 29, 4193 CT_VERTICALTEXT = 30, 4194 CT_CELL = 31, 4195 CT_CONTEXTMENU = 32, 4196 CT_ALIAS = 33, 4197 CT_PROGRESS = 34, 4198 CT_NODROP = 35, 4199 CT_COPY = 36, 4200 CT_NONE = 37, 4201 CT_NOTALLOWED = 38, 4202 CT_ZOOMIN = 39, 4203 CT_ZOOMOUT = 40, 4204 CT_GRAB = 41, 4205 CT_GRABBING = 42, 4206 CT_MIDDLE_PANNING_VERTICAL = 43, 4207 CT_MIDDLE_PANNING_HORIZONTAL = 44, 4208 CT_CUSTOM = 45, 4209 CT_DND_NONE = 46, 4210 CT_DND_MOVE = 47, 4211 CT_DND_COPY = 48, 4212 CT_DND_LINK = 49 4213 } 4214 4215 /// 4216 // Structure representing cursor information. |buffer| will be 4217 // |size.width|*|size.height|*4 bytes in size and represents a BGRA image with 4218 // an upper-left origin. 4219 /// 4220 struct cef_cursor_info_t 4221 { 4222 cef_point_t hotspot; 4223 float image_scale_factor; 4224 void* buffer; 4225 cef_size_t size; 4226 } 4227 4228 4229 4230 /// 4231 // URI unescape rules passed to CefURIDecode(). 4232 /// 4233 enum cef_uri_unescape_rule_t 4234 { 4235 /// 4236 // Don't unescape anything at all. 4237 /// 4238 UU_NONE = 0, 4239 4240 /// 4241 // Don't unescape anything special, but all normal unescaping will happen. 4242 // This is a placeholder and can't be combined with other flags (since it's 4243 // just the absence of them). All other unescape rules imply "normal" in 4244 // addition to their special meaning. Things like escaped letters, digits, 4245 // and most symbols will get unescaped with this mode. 4246 /// 4247 UU_NORMAL = 1 << 0, 4248 4249 /// 4250 // Convert %20 to spaces. In some places where we're showing URLs, we may 4251 // want this. In places where the URL may be copied and pasted out, then 4252 // you wouldn't want this since it might not be interpreted in one piece 4253 // by other applications. 4254 /// 4255 UU_SPACES = 1 << 1, 4256 4257 /// 4258 // Unescapes '/' and '\\'. If these characters were unescaped, the resulting 4259 // URL won't be the same as the source one. Moreover, they are dangerous to 4260 // unescape in strings that will be used as file paths or names. This value 4261 // should only be used when slashes don't have special meaning, like data 4262 // URLs. 4263 /// 4264 UU_PATH_SEPARATORS = 1 << 2, 4265 4266 /// 4267 // Unescapes various characters that will change the meaning of URLs, 4268 // including '%', '+', '&', '#'. Does not unescape path separators. 4269 // If these characters were unescaped, the resulting URL won't be the same 4270 // as the source one. This flag is used when generating final output like 4271 // filenames for URLs where we won't be interpreting as a URL and want to do 4272 // as much unescaping as possible. 4273 /// 4274 UU_URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS = 1 << 3, 4275 4276 /// 4277 // URL queries use "+" for space. This flag controls that replacement. 4278 /// 4279 UU_REPLACE_PLUS_WITH_SPACE = 1 << 4 4280 } 4281 4282 /// 4283 // Options that can be passed to CefParseJSON. 4284 /// 4285 enum cef_json_parser_options_t 4286 { 4287 /// 4288 // Parses the input strictly according to RFC 4627. See comments in Chromium's 4289 // base/json/json_reader.h file for known limitations/deviations from the RFC. 4290 /// 4291 JSON_PARSER_RFC = 0, 4292 4293 /// 4294 // Allows commas to exist after the last element in structures. 4295 /// 4296 JSON_PARSER_ALLOW_TRAILING_COMMAS = 1 << 0 4297 } 4298 4299 /// 4300 // Options that can be passed to CefWriteJSON. 4301 /// 4302 enum cef_json_writer_options_t 4303 { 4304 /// 4305 // Default behavior. 4306 /// 4307 JSON_WRITER_DEFAULT = 0, 4308 4309 /// 4310 // This option instructs the writer that if a Binary value is encountered, 4311 // the value (and key if within a dictionary) will be omitted from the 4312 // output, and success will be returned. Otherwise, if a binary value is 4313 // encountered, failure will be returned. 4314 /// 4315 JSON_WRITER_OMIT_BINARY_VALUES = 1 << 0, 4316 4317 /// 4318 // This option instructs the writer to write doubles that have no fractional 4319 // part as a normal integer (i.e., without using exponential notation 4320 // or appending a '.0') as long as the value is within the range of a 4321 // 64-bit int. 4322 /// 4323 JSON_WRITER_OMIT_DOUBLE_TYPE_PRESERVATION = 1 << 1, 4324 4325 /// 4326 // Return a slightly nicer formatted json string (pads with whitespace to 4327 // help with readability). 4328 /// 4329 JSON_WRITER_PRETTY_PRINT = 1 << 2 4330 } 4331 4332 /// 4333 // Margin type for PDF printing. 4334 /// 4335 enum cef_pdf_print_margin_type_t 4336 { 4337 /// 4338 // Default margins. 4339 /// 4340 PDF_PRINT_MARGIN_DEFAULT = 0, 4341 4342 /// 4343 // No margins. 4344 /// 4345 PDF_PRINT_MARGIN_NONE = 1, 4346 4347 /// 4348 // Minimum margins. 4349 /// 4350 PDF_PRINT_MARGIN_MINIMUM = 2, 4351 4352 /// 4353 // Custom margins using the |margin_*| values from cef_pdf_print_settings_t. 4354 /// 4355 PDF_PRINT_MARGIN_CUSTOM = 3 4356 } 4357 4358 /// 4359 // Structure representing PDF print settings. 4360 /// 4361 struct cef_pdf_print_settings_t 4362 { 4363 /// 4364 // Page title to display in the header. Only used if |header_footer_enabled| 4365 // is set to true (1). 4366 /// 4367 cef_string_t header_footer_title; 4368 4369 /// 4370 // URL to display in the footer. Only used if |header_footer_enabled| is set 4371 // to true (1). 4372 /// 4373 cef_string_t header_footer_url; 4374 4375 /// 4376 // Output page size in microns. If either of these values is less than or 4377 // equal to zero then the default paper size (A4) will be used. 4378 /// 4379 int page_width; 4380 int page_height; 4381 4382 /// 4383 // The percentage to scale the PDF by before printing (e.g. 50 is 50%). 4384 // If this value is less than or equal to zero the default value of 100 4385 // will be used. 4386 /// 4387 int scale_factor; 4388 4389 /// 4390 // Margins in points. Only used if |margin_type| is set to 4391 // PDF_PRINT_MARGIN_CUSTOM. 4392 /// 4393 int margin_top; 4394 int margin_right; 4395 int margin_bottom; 4396 int margin_left; 4397 4398 /// 4399 // Margin type. 4400 /// 4401 cef_pdf_print_margin_type_t margin_type; 4402 4403 /// 4404 // Set to true (1) to print headers and footers or false (0) to not print 4405 // headers and footers. 4406 /// 4407 int header_footer_enabled; 4408 4409 /// 4410 // Set to true (1) to print the selection only or false (0) to print all. 4411 /// 4412 int selection_only; 4413 4414 /// 4415 // Set to true (1) for landscape mode or false (0) for portrait mode. 4416 /// 4417 int landscape; 4418 4419 /// 4420 // Set to true (1) to print background graphics or false (0) to not print 4421 // background graphics. 4422 /// 4423 int backgrounds_enabled; 4424 } 4425 4426 4427 4428 /// 4429 // Supported UI scale factors for the platform. SCALE_FACTOR_NONE is used for 4430 // density independent resources such as string, html/js files or an image that 4431 // can be used for any scale factors (such as wallpapers). 4432 /// 4433 enum cef_scale_factor_t 4434 { 4435 SCALE_FACTOR_NONE = 0, 4436 SCALE_FACTOR_100P = 1, 4437 SCALE_FACTOR_125P = 2, 4438 SCALE_FACTOR_133P = 3, 4439 SCALE_FACTOR_140P = 4, 4440 SCALE_FACTOR_150P = 5, 4441 SCALE_FACTOR_180P = 6, 4442 SCALE_FACTOR_200P = 7, 4443 SCALE_FACTOR_250P = 8, 4444 SCALE_FACTOR_300P = 9 4445 } 4446 4447 /// 4448 // Plugin policies supported by CefRequestContextHandler::OnBeforePluginLoad. 4449 /// 4450 enum cef_plugin_policy_t 4451 { 4452 /// 4453 // Allow the content. 4454 /// 4455 PLUGIN_POLICY_ALLOW = 0, 4456 4457 /// 4458 // Allow important content and block unimportant content based on heuristics. 4459 // The user can manually load blocked content. 4460 /// 4461 PLUGIN_POLICY_DETECT_IMPORTANT = 1, 4462 4463 /// 4464 // Block the content. The user can manually load blocked content. 4465 /// 4466 PLUGIN_POLICY_BLOCK = 2, 4467 4468 /// 4469 // Disable the content. The user cannot load disabled content. 4470 /// 4471 PLUGIN_POLICY_DISABLE = 3 4472 } 4473 4474 /// 4475 // Policy for how the Referrer HTTP header value will be sent during navigation. 4476 // If the `--no-referrers` command-line flag is specified then the policy value 4477 // will be ignored and the Referrer value will never be sent. 4478 // Must be kept synchronized with net::URLRequest::ReferrerPolicy from Chromium. 4479 /// 4480 enum cef_referrer_policy_t 4481 { 4482 /// 4483 // Clear the referrer header if the header value is HTTPS but the request 4484 // destination is HTTP. This is the default behavior. 4485 /// 4486 REFERRER_POLICY_CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE = 0, 4487 REFERRER_POLICY_DEFAULT = REFERRER_POLICY_CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE, 4488 4489 /// 4490 // A slight variant on CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE: 4491 // If the request destination is HTTP, an HTTPS referrer will be cleared. If 4492 // the request's destination is cross-origin with the referrer (but does not 4493 // downgrade), the referrer's granularity will be stripped down to an origin 4494 // rather than a full URL. Same-origin requests will send the full referrer. 4495 /// 4496 REFERRER_POLICY_REDUCE_REFERRER_GRANULARITY_ON_TRANSITION_CROSS_ORIGIN = 1, 4497 4498 /// 4499 // Strip the referrer down to an origin when the origin of the referrer is 4500 // different from the destination's origin. 4501 /// 4502 REFERRER_POLICY_ORIGIN_ONLY_ON_TRANSITION_CROSS_ORIGIN = 2, 4503 4504 /// 4505 // Never change the referrer. 4506 /// 4507 REFERRER_POLICY_NEVER_CLEAR_REFERRER = 3, 4508 4509 /// 4510 // Strip the referrer down to the origin regardless of the redirect location. 4511 /// 4512 REFERRER_POLICY_ORIGIN = 4, 4513 4514 /// 4515 // Clear the referrer when the request's referrer is cross-origin with the 4516 // request's destination. 4517 /// 4518 REFERRER_POLICY_CLEAR_REFERRER_ON_TRANSITION_CROSS_ORIGIN = 5, 4519 4520 /// 4521 // Strip the referrer down to the origin, but clear it entirely if the 4522 // referrer value is HTTPS and the destination is HTTP. 4523 /// 4524 REFERRER_POLICY_ORIGIN_CLEAR_ON_TRANSITION_FROM_SECURE_TO_INSECURE = 6, 4525 4526 /// 4527 // Always clear the referrer regardless of the request destination. 4528 /// 4529 REFERRER_POLICY_NO_REFERRER = 7, 4530 4531 // Always the last value in this enumeration. 4532 REFERRER_POLICY_LAST_VALUE = REFERRER_POLICY_NO_REFERRER 4533 } 4534 4535 /// 4536 // Return values for CefResponseFilter::Filter(). 4537 /// 4538 enum cef_response_filter_status_t 4539 { 4540 /// 4541 // Some or all of the pre-filter data was read successfully but more data is 4542 // needed in order to continue filtering (filtered output is pending). 4543 /// 4544 RESPONSE_FILTER_NEED_MORE_DATA = 0, 4545 4546 /// 4547 // Some or all of the pre-filter data was read successfully and all available 4548 // filtered output has been written. 4549 /// 4550 RESPONSE_FILTER_DONE = 1, 4551 4552 /// 4553 // An error occurred during filtering. 4554 /// 4555 RESPONSE_FILTER_ERROR = 2 4556 } 4557 4558 /// 4559 // Describes how to interpret the components of a pixel. 4560 /// 4561 enum cef_color_type_t 4562 { 4563 /// 4564 // RGBA with 8 bits per pixel (32bits total). 4565 /// 4566 CEF_COLOR_TYPE_RGBA_8888 = 0, 4567 4568 /// 4569 // BGRA with 8 bits per pixel (32bits total). 4570 /// 4571 CEF_COLOR_TYPE_BGRA_8888 = 1 4572 } 4573 4574 /// 4575 // Describes how to interpret the alpha component of a pixel. 4576 /// 4577 enum cef_alpha_type_t 4578 { 4579 /// 4580 // No transparency. The alpha component is ignored. 4581 /// 4582 CEF_ALPHA_TYPE_OPAQUE = 0, 4583 4584 /// 4585 // Transparency with pre-multiplied alpha component. 4586 /// 4587 CEF_ALPHA_TYPE_PREMULTIPLIED = 1, 4588 4589 /// 4590 // Transparency with post-multiplied alpha component. 4591 /// 4592 CEF_ALPHA_TYPE_POSTMULTIPLIED = 2 4593 } 4594 4595 /// 4596 // Text style types. Should be kepy in sync with gfx::TextStyle. 4597 /// 4598 enum cef_text_style_t 4599 { 4600 CEF_TEXT_STYLE_BOLD = 0, 4601 CEF_TEXT_STYLE_ITALIC = 1, 4602 CEF_TEXT_STYLE_STRIKE = 2, 4603 CEF_TEXT_STYLE_DIAGONAL_STRIKE = 3, 4604 CEF_TEXT_STYLE_UNDERLINE = 4 4605 } 4606 4607 /// 4608 // Specifies where along the main axis the CefBoxLayout child views should be 4609 // laid out. 4610 /// 4611 enum cef_main_axis_alignment_t 4612 { 4613 /// 4614 // Child views will be left-aligned. 4615 /// 4616 CEF_MAIN_AXIS_ALIGNMENT_START = 0, 4617 4618 /// 4619 // Child views will be center-aligned. 4620 /// 4621 CEF_MAIN_AXIS_ALIGNMENT_CENTER = 1, 4622 4623 /// 4624 // Child views will be right-aligned. 4625 /// 4626 CEF_MAIN_AXIS_ALIGNMENT_END = 2 4627 } 4628 4629 /// 4630 // Specifies where along the cross axis the CefBoxLayout child views should be 4631 // laid out. 4632 /// 4633 enum cef_cross_axis_alignment_t 4634 { 4635 /// 4636 // Child views will be stretched to fit. 4637 /// 4638 CEF_CROSS_AXIS_ALIGNMENT_STRETCH = 0, 4639 4640 /// 4641 // Child views will be left-aligned. 4642 /// 4643 CEF_CROSS_AXIS_ALIGNMENT_START = 1, 4644 4645 /// 4646 // Child views will be center-aligned. 4647 /// 4648 CEF_CROSS_AXIS_ALIGNMENT_CENTER = 2, 4649 4650 /// 4651 // Child views will be right-aligned. 4652 /// 4653 CEF_CROSS_AXIS_ALIGNMENT_END = 3 4654 } 4655 4656 /// 4657 // Settings used when initializing a CefBoxLayout. 4658 /// 4659 struct cef_box_layout_settings_t 4660 { 4661 /// 4662 // If true (1) the layout will be horizontal, otherwise the layout will be 4663 // vertical. 4664 /// 4665 int horizontal; 4666 4667 /// 4668 // Adds additional horizontal space between the child view area and the host 4669 // view border. 4670 /// 4671 int inside_border_horizontal_spacing; 4672 4673 /// 4674 // Adds additional vertical space between the child view area and the host 4675 // view border. 4676 /// 4677 int inside_border_vertical_spacing; 4678 4679 /// 4680 // Adds additional space around the child view area. 4681 /// 4682 cef_insets_t inside_border_insets; 4683 4684 /// 4685 // Adds additional space between child views. 4686 /// 4687 int between_child_spacing; 4688 4689 /// 4690 // Specifies where along the main axis the child views should be laid out. 4691 /// 4692 cef_main_axis_alignment_t main_axis_alignment; 4693 4694 /// 4695 // Specifies where along the cross axis the child views should be laid out. 4696 /// 4697 cef_cross_axis_alignment_t cross_axis_alignment; 4698 4699 /// 4700 // Minimum cross axis size. 4701 /// 4702 int minimum_cross_axis_size; 4703 4704 /// 4705 // Default flex for views when none is specified via CefBoxLayout methods. 4706 // Using the preferred size as the basis, free space along the main axis is 4707 // distributed to views in the ratio of their flex weights. Similarly, if the 4708 // views will overflow the parent, space is subtracted in these ratios. A flex 4709 // of 0 means this view is not resized. Flex values must not be negative. 4710 /// 4711 int default_flex; 4712 } 4713 4714 4715 4716 /// 4717 // Specifies the button display state. 4718 /// 4719 enum cef_button_state_t 4720 { 4721 CEF_BUTTON_STATE_NORMAL = 0, 4722 CEF_BUTTON_STATE_HOVERED = 1, 4723 CEF_BUTTON_STATE_PRESSED = 2, 4724 CEF_BUTTON_STATE_DISABLED = 3 4725 } 4726 4727 /// 4728 // Specifies the horizontal text alignment mode. 4729 /// 4730 enum cef_horizontal_alignment_t 4731 { 4732 /// 4733 // Align the text's left edge with that of its display area. 4734 /// 4735 CEF_HORIZONTAL_ALIGNMENT_LEFT = 0, 4736 4737 /// 4738 // Align the text's center with that of its display area. 4739 /// 4740 CEF_HORIZONTAL_ALIGNMENT_CENTER = 1, 4741 4742 /// 4743 // Align the text's right edge with that of its display area. 4744 /// 4745 CEF_HORIZONTAL_ALIGNMENT_RIGHT = 2 4746 } 4747 4748 /// 4749 // Specifies how a menu will be anchored for non-RTL languages. The opposite 4750 // position will be used for RTL languages. 4751 /// 4752 enum cef_menu_anchor_position_t 4753 { 4754 CEF_MENU_ANCHOR_TOPLEFT = 0, 4755 CEF_MENU_ANCHOR_TOPRIGHT = 1, 4756 CEF_MENU_ANCHOR_BOTTOMCENTER = 2 4757 } 4758 4759 /// 4760 // Supported color types for menu items. 4761 /// 4762 enum cef_menu_color_type_t 4763 { 4764 CEF_MENU_COLOR_TEXT = 0, 4765 CEF_MENU_COLOR_TEXT_HOVERED = 1, 4766 CEF_MENU_COLOR_TEXT_ACCELERATOR = 2, 4767 CEF_MENU_COLOR_TEXT_ACCELERATOR_HOVERED = 3, 4768 CEF_MENU_COLOR_BACKGROUND = 4, 4769 CEF_MENU_COLOR_BACKGROUND_HOVERED = 5, 4770 CEF_MENU_COLOR_COUNT = 6 4771 } 4772 4773 // Supported SSL version values. See net/ssl/ssl_connection_status_flags.h 4774 // for more information. 4775 enum cef_ssl_version_t 4776 { 4777 SSL_CONNECTION_VERSION_UNKNOWN = 0, // Unknown SSL version. 4778 SSL_CONNECTION_VERSION_SSL2 = 1, 4779 SSL_CONNECTION_VERSION_SSL3 = 2, 4780 SSL_CONNECTION_VERSION_TLS1 = 3, 4781 SSL_CONNECTION_VERSION_TLS1_1 = 4, 4782 SSL_CONNECTION_VERSION_TLS1_2 = 5, 4783 SSL_CONNECTION_VERSION_TLS1_3 = 6, 4784 SSL_CONNECTION_VERSION_QUIC = 7 4785 } 4786 4787 // Supported SSL content status flags. See content/public/common/ssl_status.h 4788 // for more information. 4789 enum cef_ssl_content_status_t 4790 { 4791 SSL_CONTENT_NORMAL_CONTENT = 0, 4792 SSL_CONTENT_DISPLAYED_INSECURE_CONTENT = 1 << 0, 4793 SSL_CONTENT_RAN_INSECURE_CONTENT = 1 << 1 4794 } 4795 4796 // 4797 // Configuration options for registering a custom scheme. 4798 // These values are used when calling AddCustomScheme. 4799 // 4800 enum cef_scheme_options_t 4801 { 4802 CEF_SCHEME_OPTION_NONE = 0, 4803 4804 /// 4805 // If CEF_SCHEME_OPTION_STANDARD is set the scheme will be treated as a 4806 // standard scheme. Standard schemes are subject to URL canonicalization and 4807 // parsing rules as defined in the Common Internet Scheme Syntax RFC 1738 4808 // Section 3.1 available at http://www.ietf.org/rfc/rfc1738.txt 4809 // 4810 // In particular, the syntax for standard scheme URLs must be of the form: 4811 // <pre> 4812 // [scheme]://[username]:[password]@[host]:[port]/[url-path] 4813 // </pre> Standard scheme URLs must have a host component that is a fully 4814 // qualified domain name as defined in Section 3.5 of RFC 1034 [13] and 4815 // Section 2.1 of RFC 1123. These URLs will be canonicalized to 4816 // "scheme://host/path" in the simplest case and 4817 // "scheme://username:password@host:port/path" in the most explicit case. For 4818 // example, "scheme:host/path" and "scheme:///host/path" will both be 4819 // canonicalized to "scheme://host/path". The origin of a standard scheme URL 4820 // is the combination of scheme, host and port (i.e., "scheme://host:port" in 4821 // the most explicit case). 4822 // 4823 // For non-standard scheme URLs only the "scheme:" component is parsed and 4824 // canonicalized. The remainder of the URL will be passed to the handler as- 4825 // is. For example, "scheme:///some%20text" will remain the same. Non-standard 4826 // scheme URLs cannot be used as a target for form submission. 4827 /// 4828 CEF_SCHEME_OPTION_STANDARD = 1 << 0, 4829 4830 /// 4831 // If CEF_SCHEME_OPTION_LOCAL is set the scheme will be treated with the same 4832 // security rules as those applied to "file" URLs. Normal pages cannot link to 4833 // or access local URLs. Also, by default, local URLs can only perform 4834 // XMLHttpRequest calls to the same URL (origin + path) that originated the 4835 // request. To allow XMLHttpRequest calls from a local URL to other URLs with 4836 // the same origin set the CefSettings.file_access_from_file_urls_allowed 4837 // value to true (1). To allow XMLHttpRequest calls from a local URL to all 4838 // origins set the CefSettings.universal_access_from_file_urls_allowed value 4839 // to true (1). 4840 /// 4841 CEF_SCHEME_OPTION_LOCAL = 1 << 1, 4842 4843 /// 4844 // If CEF_SCHEME_OPTION_DISPLAY_ISOLATED is set the scheme can only be 4845 // displayed from other content hosted with the same scheme. For example, 4846 // pages in other origins cannot create iframes or hyperlinks to URLs with the 4847 // scheme. For schemes that must be accessible from other schemes don't set 4848 // this, set CEF_SCHEME_OPTION_CORS_ENABLED, and use CORS 4849 // "Access-Control-Allow-Origin" headers to further restrict access. 4850 /// 4851 CEF_SCHEME_OPTION_DISPLAY_ISOLATED = 1 << 2, 4852 4853 /// 4854 // If CEF_SCHEME_OPTION_SECURE is set the scheme will be treated with the same 4855 // security rules as those applied to "https" URLs. For example, loading this 4856 // scheme from other secure schemes will not trigger mixed content warnings. 4857 /// 4858 CEF_SCHEME_OPTION_SECURE = 1 << 3, 4859 4860 /// 4861 // If CEF_SCHEME_OPTION_CORS_ENABLED is set the scheme can be sent CORS 4862 // requests. This value should be set in most cases where 4863 // CEF_SCHEME_OPTION_STANDARD is set. 4864 /// 4865 CEF_SCHEME_OPTION_CORS_ENABLED = 1 << 4, 4866 4867 /// 4868 // If CEF_SCHEME_OPTION_CSP_BYPASSING is set the scheme can bypass Content- 4869 // Security-Policy (CSP) checks. This value should not be set in most cases 4870 // where CEF_SCHEME_OPTION_STANDARD is set. 4871 /// 4872 CEF_SCHEME_OPTION_CSP_BYPASSING = 1 << 5, 4873 4874 /// 4875 // If CEF_SCHEME_OPTION_FETCH_ENABLED is set the scheme can perform Fetch API 4876 // requests. 4877 /// 4878 CEF_SCHEME_OPTION_FETCH_ENABLED = 1 << 6 4879 } 4880 4881 /// 4882 // Structure representing a range. 4883 /// 4884 struct cef_range_t 4885 { 4886 int from; 4887 int to; 4888 } 4889 4890 4891 4892 /// 4893 // Composition underline style. 4894 /// 4895 enum cef_composition_underline_style_t 4896 { 4897 CEF_CUS_SOLID = 0, 4898 CEF_CUS_DOT = 1, 4899 CEF_CUS_DASH = 2, 4900 CEF_CUS_NONE = 3 4901 } 4902 4903 /// 4904 // Structure representing IME composition underline information. This is a thin 4905 // wrapper around Blink's WebCompositionUnderline class and should be kept in 4906 // sync with that. 4907 /// 4908 struct cef_composition_underline_t 4909 { 4910 /// 4911 // Underline character range. 4912 /// 4913 cef_range_t range; 4914 4915 /// 4916 // Text color. 4917 /// 4918 cef_color_t color; 4919 4920 /// 4921 // Background color. 4922 /// 4923 cef_color_t background_color; 4924 4925 /// 4926 // Set to true (1) for thick underline. 4927 /// 4928 int thick; 4929 4930 /// 4931 // Style. 4932 /// 4933 cef_composition_underline_style_t style; 4934 } 4935 4936 4937 4938 /// 4939 // Enumerates the various representations of the ordering of audio channels. 4940 // Must be kept synchronized with media::ChannelLayout from Chromium. 4941 // See media\base\channel_layout.h 4942 /// 4943 enum cef_channel_layout_t 4944 { 4945 CEF_CHANNEL_LAYOUT_NONE = 0, 4946 CEF_CHANNEL_LAYOUT_UNSUPPORTED = 1, 4947 4948 // Front C 4949 CEF_CHANNEL_LAYOUT_MONO = 2, 4950 4951 // Front L, Front R 4952 CEF_CHANNEL_LAYOUT_STEREO = 3, 4953 4954 // Front L, Front R, Back C 4955 CEF_CHANNEL_LAYOUT_2_1 = 4, 4956 4957 // Front L, Front R, Front C 4958 CEF_CHANNEL_LAYOUT_SURROUND = 5, 4959 4960 // Front L, Front R, Front C, Back C 4961 CEF_CHANNEL_LAYOUT_4_0 = 6, 4962 4963 // Front L, Front R, Side L, Side R 4964 CEF_CHANNEL_LAYOUT_2_2 = 7, 4965 4966 // Front L, Front R, Back L, Back R 4967 CEF_CHANNEL_LAYOUT_QUAD = 8, 4968 4969 // Front L, Front R, Front C, Side L, Side R 4970 CEF_CHANNEL_LAYOUT_5_0 = 9, 4971 4972 // Front L, Front R, Front C, LFE, Side L, Side R 4973 CEF_CHANNEL_LAYOUT_5_1 = 10, 4974 4975 // Front L, Front R, Front C, Back L, Back R 4976 CEF_CHANNEL_LAYOUT_5_0_BACK = 11, 4977 4978 // Front L, Front R, Front C, LFE, Back L, Back R 4979 CEF_CHANNEL_LAYOUT_5_1_BACK = 12, 4980 4981 // Front L, Front R, Front C, Side L, Side R, Back L, Back R 4982 CEF_CHANNEL_LAYOUT_7_0 = 13, 4983 4984 // Front L, Front R, Front C, LFE, Side L, Side R, Back L, Back R 4985 CEF_CHANNEL_LAYOUT_7_1 = 14, 4986 4987 // Front L, Front R, Front C, LFE, Side L, Side R, Front LofC, Front RofC 4988 CEF_CHANNEL_LAYOUT_7_1_WIDE = 15, 4989 4990 // Stereo L, Stereo R 4991 CEF_CHANNEL_LAYOUT_STEREO_DOWNMIX = 16, 4992 4993 // Stereo L, Stereo R, LFE 4994 CEF_CHANNEL_LAYOUT_2POINT1 = 17, 4995 4996 // Stereo L, Stereo R, Front C, LFE 4997 CEF_CHANNEL_LAYOUT_3_1 = 18, 4998 4999 // Stereo L, Stereo R, Front C, Rear C, LFE 5000 CEF_CHANNEL_LAYOUT_4_1 = 19, 5001 5002 // Stereo L, Stereo R, Front C, Side L, Side R, Back C 5003 CEF_CHANNEL_LAYOUT_6_0 = 20, 5004 5005 // Stereo L, Stereo R, Side L, Side R, Front LofC, Front RofC 5006 CEF_CHANNEL_LAYOUT_6_0_FRONT = 21, 5007 5008 // Stereo L, Stereo R, Front C, Rear L, Rear R, Rear C 5009 CEF_CHANNEL_LAYOUT_HEXAGONAL = 22, 5010 5011 // Stereo L, Stereo R, Front C, LFE, Side L, Side R, Rear Center 5012 CEF_CHANNEL_LAYOUT_6_1 = 23, 5013 5014 // Stereo L, Stereo R, Front C, LFE, Back L, Back R, Rear Center 5015 CEF_CHANNEL_LAYOUT_6_1_BACK = 24, 5016 5017 // Stereo L, Stereo R, Side L, Side R, Front LofC, Front RofC, LFE 5018 CEF_CHANNEL_LAYOUT_6_1_FRONT = 25, 5019 5020 // Front L, Front R, Front C, Side L, Side R, Front LofC, Front RofC 5021 CEF_CHANNEL_LAYOUT_7_0_FRONT = 26, 5022 5023 // Front L, Front R, Front C, LFE, Back L, Back R, Front LofC, Front RofC 5024 CEF_CHANNEL_LAYOUT_7_1_WIDE_BACK = 27, 5025 5026 // Front L, Front R, Front C, Side L, Side R, Rear L, Back R, Back C. 5027 CEF_CHANNEL_LAYOUT_OCTAGONAL = 28, 5028 5029 // Channels are not explicitly mapped to speakers. 5030 CEF_CHANNEL_LAYOUT_DISCRETE = 29, 5031 5032 // Front L, Front R, Front C. Front C contains the keyboard mic audio. This 5033 // layout is only intended for input for WebRTC. The Front C channel 5034 // is stripped away in the WebRTC audio input pipeline and never seen outside 5035 // of that. 5036 CEF_CHANNEL_LAYOUT_STEREO_AND_KEYBOARD_MIC = 30, 5037 5038 // Front L, Front R, Side L, Side R, LFE 5039 CEF_CHANNEL_LAYOUT_4_1_QUAD_SIDE = 31, 5040 5041 // Actual channel layout is specified in the bitstream and the actual channel 5042 // count is unknown at Chromium media pipeline level (useful for audio 5043 // pass-through mode). 5044 CEF_CHANNEL_LAYOUT_BITSTREAM = 32, 5045 5046 // Max value, must always equal the largest entry ever logged. 5047 CEF_CHANNEL_LAYOUT_MAX = CEF_CHANNEL_LAYOUT_BITSTREAM 5048 } 5049 5050 /// 5051 // Structure representing the audio parameters for setting up the audio handler. 5052 /// 5053 struct cef_audio_parameters_t 5054 { 5055 /// 5056 // Layout of the audio channels 5057 /// 5058 cef_channel_layout_t channel_layout; 5059 5060 /// 5061 // Sample rate 5062 // 5063 int sample_rate; 5064 5065 /// 5066 // Number of frames per buffer 5067 /// 5068 int frames_per_buffer; 5069 } 5070 5071 5072 5073 /// 5074 // Result codes for CefMediaRouter::CreateRoute. Should be kept in sync with 5075 // Chromium's media_router::RouteRequestResult::ResultCode type. 5076 /// 5077 enum cef_media_route_create_result_t 5078 { 5079 CEF_MRCR_UNKNOWN_ERROR = 0, 5080 CEF_MRCR_OK = 1, 5081 CEF_MRCR_TIMED_OUT = 2, 5082 CEF_MRCR_ROUTE_NOT_FOUND = 3, 5083 CEF_MRCR_SINK_NOT_FOUND = 4, 5084 CEF_MRCR_INVALID_ORIGIN = 5, 5085 CEF_MRCR_NO_SUPPORTED_PROVIDER = 7, 5086 CEF_MRCR_CANCELLED = 8, 5087 CEF_MRCR_ROUTE_ALREADY_EXISTS = 9, 5088 CEF_MRCR_ROUTE_ALREADY_TERMINATED = 11, 5089 5090 CEF_MRCR_TOTAL_COUNT = 12 // The total number of values. 5091 } 5092 5093 /// 5094 // Connection state for a MediaRoute object. 5095 /// 5096 enum cef_media_route_connection_state_t 5097 { 5098 CEF_MRCS_UNKNOWN = 0, 5099 CEF_MRCS_CONNECTING = 1, 5100 CEF_MRCS_CONNECTED = 2, 5101 CEF_MRCS_CLOSED = 3, 5102 CEF_MRCS_TERMINATED = 4 5103 } 5104 5105 /// 5106 // Icon types for a MediaSink object. Should be kept in sync with Chromium's 5107 // media_router::SinkIconType type. 5108 /// 5109 enum cef_media_sink_icon_type_t 5110 { 5111 CEF_MSIT_CAST = 0, 5112 CEF_MSIT_CAST_AUDIO_GROUP = 1, 5113 CEF_MSIT_CAST_AUDIO = 2, 5114 CEF_MSIT_MEETING = 3, 5115 CEF_MSIT_HANGOUT = 4, 5116 CEF_MSIT_EDUCATION = 5, 5117 CEF_MSIT_WIRED_DISPLAY = 6, 5118 CEF_MSIT_GENERIC = 7, 5119 5120 CEF_MSIT_TOTAL_COUNT = 8 // The total number of values. 5121 } 5122 5123 /// 5124 // Device information for a MediaSink object. 5125 /// 5126 struct cef_media_sink_device_info_t 5127 { 5128 cef_string_t ip_address; 5129 int port; 5130 cef_string_t model_name; 5131 } 5132 5133 5134 5135 /// 5136 // Represents commands available to TextField. 5137 /// 5138 enum cef_text_field_commands_t 5139 { 5140 CEF_TFC_CUT = 1, 5141 CEF_TFC_COPY = 2, 5142 CEF_TFC_PASTE = 3, 5143 CEF_TFC_UNDO = 4, 5144 CEF_TFC_DELETE = 5, 5145 CEF_TFC_SELECT_ALL = 6 5146 } 5147 5148 /// 5149 // Supported Chrome toolbar types. 5150 /// 5151 enum cef_chrome_toolbar_type_t 5152 { 5153 CEF_CTT_NONE = 1, 5154 CEF_CTT_NORMAL = 2, 5155 CEF_CTT_LOCATION = 3 5156 } 5157 5158 /// 5159 // Docking modes supported by CefWindow::AddOverlay. 5160 /// 5161 enum cef_docking_mode_t 5162 { 5163 CEF_DOCKING_MODE_TOP_LEFT = 1, 5164 CEF_DOCKING_MODE_TOP_RIGHT = 2, 5165 CEF_DOCKING_MODE_BOTTOM_LEFT = 3, 5166 CEF_DOCKING_MODE_BOTTOM_RIGHT = 4, 5167 CEF_DOCKING_MODE_CUSTOM = 5 5168 } 5169 5170 /// 5171 // Show states supported by CefWindowDelegate::GetInitialShowState. 5172 /// 5173 enum cef_show_state_t 5174 { 5175 CEF_SHOW_STATE_NORMAL = 1, 5176 CEF_SHOW_STATE_MINIMIZED = 2, 5177 CEF_SHOW_STATE_MAXIMIZED = 3, 5178 CEF_SHOW_STATE_FULLSCREEN = 4 5179 } 5180 5181 // CEF_INCLUDE_INTERNAL_CEF_TYPES_H_ 5182 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 5183 // 5184 // Redistribution and use in source and binary forms, with or without 5185 // modification, are permitted provided that the following conditions are 5186 // met: 5187 // 5188 // * Redistributions of source code must retain the above copyright 5189 // notice, this list of conditions and the following disclaimer. 5190 // * Redistributions in binary form must reproduce the above 5191 // copyright notice, this list of conditions and the following disclaimer 5192 // in the documentation and/or other materials provided with the 5193 // distribution. 5194 // * Neither the name of Google Inc. nor the name Chromium Embedded 5195 // Framework nor the names of its contributors may be used to endorse 5196 // or promote products derived from this software without specific prior 5197 // written permission. 5198 // 5199 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 5200 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 5201 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 5202 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 5203 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 5204 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 5205 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 5206 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 5207 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 5208 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 5209 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 5210 // 5211 // --------------------------------------------------------------------------- 5212 // 5213 // This file was generated by the CEF translator tool and should not edited 5214 // by hand. See the translator.README.txt file in the tools directory for 5215 // more information. 5216 // 5217 // $hash=c487e5fd787b1be8224a8981839e0cfdd0ed74f3$ 5218 // 5219 5220 extern (C): 5221 5222 /// 5223 // Implement this structure to receive accessibility notification when 5224 // accessibility events have been registered. The functions of this structure 5225 // will be called on the UI thread. 5226 /// 5227 struct cef_accessibility_handler_t 5228 { 5229 /// 5230 // Base structure. 5231 /// 5232 cef_base_ref_counted_t base; 5233 5234 /// 5235 // Called after renderer process sends accessibility tree changes to the 5236 // browser process. 5237 /// 5238 extern(System) void function ( 5239 cef_accessibility_handler_t* self, 5240 cef_value_t* value) nothrow on_accessibility_tree_change; 5241 5242 /// 5243 // Called after renderer process sends accessibility location changes to the 5244 // browser process. 5245 /// 5246 extern(System) void function ( 5247 cef_accessibility_handler_t* self, 5248 cef_value_t* value) nothrow on_accessibility_location_change; 5249 } 5250 5251 5252 5253 // CEF_INCLUDE_CAPI_CEF_ACCESSIBILITY_HANDLER_CAPI_H_ 5254 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 5255 // 5256 // Redistribution and use in source and binary forms, with or without 5257 // modification, are permitted provided that the following conditions are 5258 // met: 5259 // 5260 // * Redistributions of source code must retain the above copyright 5261 // notice, this list of conditions and the following disclaimer. 5262 // * Redistributions in binary form must reproduce the above 5263 // copyright notice, this list of conditions and the following disclaimer 5264 // in the documentation and/or other materials provided with the 5265 // distribution. 5266 // * Neither the name of Google Inc. nor the name Chromium Embedded 5267 // Framework nor the names of its contributors may be used to endorse 5268 // or promote products derived from this software without specific prior 5269 // written permission. 5270 // 5271 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 5272 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 5273 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 5274 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 5275 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 5276 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 5277 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 5278 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 5279 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 5280 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 5281 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 5282 // 5283 // --------------------------------------------------------------------------- 5284 // 5285 // This file was generated by the CEF translator tool and should not edited 5286 // by hand. See the translator.README.txt file in the tools directory for 5287 // more information. 5288 // 5289 // $hash=a4b63e6e7942e3a3961b4f7141a963980178ae6f$ 5290 // 5291 5292 extern (C): 5293 5294 /// 5295 // Implement this structure to provide handler implementations. Methods will be 5296 // called by the process and/or thread indicated. 5297 /// 5298 struct cef_app_t 5299 { 5300 /// 5301 // Base structure. 5302 /// 5303 cef_base_ref_counted_t base; 5304 5305 /// 5306 // Provides an opportunity to view and/or modify command-line arguments before 5307 // processing by CEF and Chromium. The |process_type| value will be NULL for 5308 // the browser process. Do not keep a reference to the cef_command_line_t 5309 // object passed to this function. The CefSettings.command_line_args_disabled 5310 // value can be used to start with an NULL command-line object. Any values 5311 // specified in CefSettings that equate to command-line arguments will be set 5312 // before this function is called. Be cautious when using this function to 5313 // modify command-line arguments for non-browser processes as this may result 5314 // in undefined behavior including crashes. 5315 /// 5316 extern(System) void function ( 5317 cef_app_t* self, 5318 const(cef_string_t)* process_type, 5319 cef_command_line_t* command_line) nothrow on_before_command_line_processing; 5320 5321 /// 5322 // Provides an opportunity to register custom schemes. Do not keep a reference 5323 // to the |registrar| object. This function is called on the main thread for 5324 // each process and the registered schemes should be the same across all 5325 // processes. 5326 /// 5327 extern(System) void function ( 5328 cef_app_t* self, 5329 cef_scheme_registrar_t* registrar) nothrow on_register_custom_schemes; 5330 5331 /// 5332 // Return the handler for resource bundle events. If 5333 // CefSettings.pack_loading_disabled is true (1) a handler must be returned. 5334 // If no handler is returned resources will be loaded from pack files. This 5335 // function is called by the browser and render processes on multiple threads. 5336 /// 5337 extern(System) cef_resource_bundle_handler_t* function ( 5338 cef_app_t* self) nothrow get_resource_bundle_handler; 5339 5340 /// 5341 // Return the handler for functionality specific to the browser process. This 5342 // function is called on multiple threads in the browser process. 5343 /// 5344 extern(System) cef_browser_process_handler_t* function ( 5345 cef_app_t* self) nothrow get_browser_process_handler; 5346 5347 /// 5348 // Return the handler for functionality specific to the render process. This 5349 // function is called on the render process main thread. 5350 /// 5351 extern(System) cef_render_process_handler_t* function ( 5352 cef_app_t* self) nothrow get_render_process_handler; 5353 } 5354 5355 5356 5357 /// 5358 // This function should be called from the application entry point function to 5359 // execute a secondary process. It can be used to run secondary processes from 5360 // the browser client executable (default behavior) or from a separate 5361 // executable specified by the CefSettings.browser_subprocess_path value. If 5362 // called for the browser process (identified by no "type" command-line value) 5363 // it will return immediately with a value of -1. If called for a recognized 5364 // secondary process it will block until the process should exit and then return 5365 // the process exit code. The |application| parameter may be NULL. The 5366 // |windows_sandbox_info| parameter is only used on Windows and may be NULL (see 5367 // cef_sandbox_win.h for details). 5368 /// 5369 int cef_execute_process ( 5370 const(cef_main_args_t)* args, 5371 cef_app_t* application, 5372 void* windows_sandbox_info); 5373 5374 /// 5375 // This function should be called on the main application thread to initialize 5376 // the CEF browser process. The |application| parameter may be NULL. A return 5377 // value of true (1) indicates that it succeeded and false (0) indicates that it 5378 // failed. The |windows_sandbox_info| parameter is only used on Windows and may 5379 // be NULL (see cef_sandbox_win.h for details). 5380 /// 5381 int cef_initialize ( 5382 const(cef_main_args_t)* args, 5383 const(cef_settings_t)* settings, 5384 cef_app_t* application, 5385 void* windows_sandbox_info); 5386 5387 /// 5388 // This function should be called on the main application thread to shut down 5389 // the CEF browser process before the application exits. 5390 /// 5391 void cef_shutdown (); 5392 5393 /// 5394 // Perform a single iteration of CEF message loop processing. This function is 5395 // provided for cases where the CEF message loop must be integrated into an 5396 // existing application message loop. Use of this function is not recommended 5397 // for most users; use either the cef_run_message_loop() function or 5398 // CefSettings.multi_threaded_message_loop if possible. When using this function 5399 // care must be taken to balance performance against excessive CPU usage. It is 5400 // recommended to enable the CefSettings.external_message_pump option when using 5401 // this function so that 5402 // cef_browser_process_handler_t::on_schedule_message_pump_work() callbacks can 5403 // facilitate the scheduling process. This function should only be called on the 5404 // main application thread and only if cef_initialize() is called with a 5405 // CefSettings.multi_threaded_message_loop value of false (0). This function 5406 // will not block. 5407 /// 5408 void cef_do_message_loop_work (); 5409 5410 /// 5411 // Run the CEF message loop. Use this function instead of an application- 5412 // provided message loop to get the best balance between performance and CPU 5413 // usage. This function should only be called on the main application thread and 5414 // only if cef_initialize() is called with a 5415 // CefSettings.multi_threaded_message_loop value of false (0). This function 5416 // will block until a quit message is received by the system. 5417 /// 5418 void cef_run_message_loop (); 5419 5420 /// 5421 // Quit the CEF message loop that was started by calling cef_run_message_loop(). 5422 // This function should only be called on the main application thread and only 5423 // if cef_run_message_loop() was used. 5424 /// 5425 void cef_quit_message_loop (); 5426 5427 /// 5428 // Set to true (1) before calling Windows APIs like TrackPopupMenu that enter a 5429 // modal message loop. Set to false (0) after exiting the modal message loop. 5430 /// 5431 void cef_set_osmodal_loop (int osModalLoop); 5432 5433 /// 5434 // Call during process startup to enable High-DPI support on Windows 7 or newer. 5435 // Older versions of Windows should be left DPI-unaware because they do not 5436 // support DirectWrite and GDI fonts are kerned very badly. 5437 /// 5438 void cef_enable_highdpi_support (); 5439 5440 // CEF_INCLUDE_CAPI_CEF_APP_CAPI_H_ 5441 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 5442 // 5443 // Redistribution and use in source and binary forms, with or without 5444 // modification, are permitted provided that the following conditions are 5445 // met: 5446 // 5447 // * Redistributions of source code must retain the above copyright 5448 // notice, this list of conditions and the following disclaimer. 5449 // * Redistributions in binary form must reproduce the above 5450 // copyright notice, this list of conditions and the following disclaimer 5451 // in the documentation and/or other materials provided with the 5452 // distribution. 5453 // * Neither the name of Google Inc. nor the name Chromium Embedded 5454 // Framework nor the names of its contributors may be used to endorse 5455 // or promote products derived from this software without specific prior 5456 // written permission. 5457 // 5458 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 5459 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 5460 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 5461 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 5462 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 5463 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 5464 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 5465 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 5466 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 5467 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 5468 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 5469 // 5470 // --------------------------------------------------------------------------- 5471 // 5472 // This file was generated by the CEF translator tool and should not edited 5473 // by hand. See the translator.README.txt file in the tools directory for 5474 // more information. 5475 // 5476 // $hash=7a483ed552ecca4f1aaa03800d366beca1ea2dee$ 5477 // 5478 5479 extern (C): 5480 5481 /// 5482 // Implement this structure to handle audio events. 5483 /// 5484 struct cef_audio_handler_t 5485 { 5486 /// 5487 // Base structure. 5488 /// 5489 cef_base_ref_counted_t base; 5490 5491 /// 5492 // Called on the UI thread to allow configuration of audio stream parameters. 5493 // Return true (1) to proceed with audio stream capture, or false (0) to 5494 // cancel it. All members of |params| can optionally be configured here, but 5495 // they are also pre-filled with some sensible defaults. 5496 /// 5497 extern(System) int function ( 5498 cef_audio_handler_t* self, 5499 cef_browser_t* browser, 5500 cef_audio_parameters_t* params) nothrow get_audio_parameters; 5501 5502 /// 5503 // Called on a browser audio capture thread when the browser starts streaming 5504 // audio. OnAudioSteamStopped will always be called after 5505 // OnAudioStreamStarted; both functions may be called multiple times for the 5506 // same browser. |params| contains the audio parameters like sample rate and 5507 // channel layout. |channels| is the number of channels. 5508 /// 5509 extern(System) void function ( 5510 cef_audio_handler_t* self, 5511 cef_browser_t* browser, 5512 const(cef_audio_parameters_t)* params, 5513 int channels) nothrow on_audio_stream_started; 5514 5515 /// 5516 // Called on the audio stream thread when a PCM packet is received for the 5517 // stream. |data| is an array representing the raw PCM data as a floating 5518 // point type, i.e. 4-byte value(s). |frames| is the number of frames in the 5519 // PCM packet. |pts| is the presentation timestamp (in milliseconds since the 5520 // Unix Epoch) and represents the time at which the decompressed packet should 5521 // be presented to the user. Based on |frames| and the |channel_layout| value 5522 // passed to OnAudioStreamStarted you can calculate the size of the |data| 5523 // array in bytes. 5524 /// 5525 extern(System) void function ( 5526 cef_audio_handler_t* self, 5527 cef_browser_t* browser, 5528 const(float*)* data, 5529 int frames, 5530 int64 pts) nothrow on_audio_stream_packet; 5531 5532 /// 5533 // Called on the UI thread when the stream has stopped. OnAudioSteamStopped 5534 // will always be called after OnAudioStreamStarted; both functions may be 5535 // called multiple times for the same stream. 5536 /// 5537 extern(System) void function ( 5538 cef_audio_handler_t* self, 5539 cef_browser_t* browser) nothrow on_audio_stream_stopped; 5540 5541 /// 5542 // Called on the UI or audio stream thread when an error occurred. During the 5543 // stream creation phase this callback will be called on the UI thread while 5544 // in the capturing phase it will be called on the audio stream thread. The 5545 // stream will be stopped immediately. 5546 /// 5547 extern(System) void function ( 5548 cef_audio_handler_t* self, 5549 cef_browser_t* browser, 5550 const(cef_string_t)* message) nothrow on_audio_stream_error; 5551 } 5552 5553 5554 5555 // CEF_INCLUDE_CAPI_CEF_AUDIO_HANDLER_CAPI_H_ 5556 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 5557 // 5558 // Redistribution and use in source and binary forms, with or without 5559 // modification, are permitted provided that the following conditions are 5560 // met: 5561 // 5562 // * Redistributions of source code must retain the above copyright 5563 // notice, this list of conditions and the following disclaimer. 5564 // * Redistributions in binary form must reproduce the above 5565 // copyright notice, this list of conditions and the following disclaimer 5566 // in the documentation and/or other materials provided with the 5567 // distribution. 5568 // * Neither the name of Google Inc. nor the name Chromium Embedded 5569 // Framework nor the names of its contributors may be used to endorse 5570 // or promote products derived from this software without specific prior 5571 // written permission. 5572 // 5573 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 5574 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 5575 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 5576 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 5577 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 5578 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 5579 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 5580 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 5581 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 5582 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 5583 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 5584 // 5585 // --------------------------------------------------------------------------- 5586 // 5587 // This file was generated by the CEF translator tool and should not edited 5588 // by hand. See the translator.README.txt file in the tools directory for 5589 // more information. 5590 // 5591 // $hash=2b9508a328ed0218e2c576af455f8d76e5978545$ 5592 // 5593 5594 extern (C): 5595 5596 /// 5597 // Callback structure used for asynchronous continuation of authentication 5598 // requests. 5599 /// 5600 struct cef_auth_callback_t 5601 { 5602 /// 5603 // Base structure. 5604 /// 5605 cef_base_ref_counted_t base; 5606 5607 /// 5608 // Continue the authentication request. 5609 /// 5610 extern(System) void function ( 5611 cef_auth_callback_t* self, 5612 const(cef_string_t)* username, 5613 const(cef_string_t)* password) nothrow cont; 5614 5615 /// 5616 // Cancel the authentication request. 5617 /// 5618 extern(System) void function (cef_auth_callback_t* self) nothrow cancel; 5619 } 5620 5621 5622 5623 // CEF_INCLUDE_CAPI_CEF_AUTH_CALLBACK_CAPI_H_ 5624 // Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. 5625 // 5626 // Redistribution and use in source and binary forms, with or without 5627 // modification, are permitted provided that the following conditions are 5628 // met: 5629 // 5630 // * Redistributions of source code must retain the above copyright 5631 // notice, this list of conditions and the following disclaimer. 5632 // * Redistributions in binary form must reproduce the above 5633 // copyright notice, this list of conditions and the following disclaimer 5634 // in the documentation and/or other materials provided with the 5635 // distribution. 5636 // * Neither the name of Google Inc. nor the name Chromium Embedded 5637 // Framework nor the names of its contributors may be used to endorse 5638 // or promote products derived from this software without specific prior 5639 // written permission. 5640 // 5641 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 5642 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 5643 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 5644 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 5645 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 5646 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 5647 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 5648 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 5649 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 5650 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 5651 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 5652 5653 extern (C): 5654 5655 /// 5656 // All ref-counted framework structures must include this structure first. 5657 /// 5658 struct cef_base_ref_counted_t 5659 { 5660 /// 5661 // Size of the data structure. 5662 /// 5663 size_t size; 5664 5665 /// 5666 // Called to increment the reference count for the object. Should be called 5667 // for every new copy of a pointer to a given object. 5668 /// 5669 extern(System) void function (cef_base_ref_counted_t* self) nothrow add_ref; 5670 5671 /// 5672 // Called to decrement the reference count for the object. If the reference 5673 // count falls to 0 the object should self-delete. Returns true (1) if the 5674 // resulting reference count is 0. 5675 /// 5676 extern(System) int function (cef_base_ref_counted_t* self) nothrow release; 5677 5678 /// 5679 // Returns true (1) if the current reference count is 1. 5680 /// 5681 extern(System) int function (cef_base_ref_counted_t* self) nothrow has_one_ref; 5682 5683 /// 5684 // Returns true (1) if the current reference count is at least 1. 5685 /// 5686 extern(System) int function (cef_base_ref_counted_t* self) nothrow has_at_least_one_ref; 5687 } 5688 5689 5690 5691 /// 5692 // All scoped framework structures must include this structure first. 5693 /// 5694 struct cef_base_scoped_t 5695 { 5696 /// 5697 // Size of the data structure. 5698 /// 5699 size_t size; 5700 5701 /// 5702 // Called to delete this object. May be NULL if the object is not owned. 5703 /// 5704 extern(System) void function (cef_base_scoped_t* self) nothrow del; 5705 } 5706 5707 5708 5709 // Check that the structure |s|, which is defined with a size_t member at the 5710 // top, is large enough to contain the specified member |f|. 5711 5712 5713 5714 5715 // CEF_INCLUDE_CAPI_CEF_BASE_CAPI_H_ 5716 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 5717 // 5718 // Redistribution and use in source and binary forms, with or without 5719 // modification, are permitted provided that the following conditions are 5720 // met: 5721 // 5722 // * Redistributions of source code must retain the above copyright 5723 // notice, this list of conditions and the following disclaimer. 5724 // * Redistributions in binary form must reproduce the above 5725 // copyright notice, this list of conditions and the following disclaimer 5726 // in the documentation and/or other materials provided with the 5727 // distribution. 5728 // * Neither the name of Google Inc. nor the name Chromium Embedded 5729 // Framework nor the names of its contributors may be used to endorse 5730 // or promote products derived from this software without specific prior 5731 // written permission. 5732 // 5733 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 5734 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 5735 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 5736 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 5737 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 5738 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 5739 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 5740 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 5741 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 5742 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 5743 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 5744 // 5745 // --------------------------------------------------------------------------- 5746 // 5747 // This file was generated by the CEF translator tool and should not edited 5748 // by hand. See the translator.README.txt file in the tools directory for 5749 // more information. 5750 // 5751 // $hash=b83b96e2b90124bba8084e2df7f66cc6749df872$ 5752 // 5753 5754 import core.stdc.config; 5755 5756 extern (C): 5757 5758 5759 5760 /// 5761 // Structure used to represent a browser. When used in the browser process the 5762 // functions of this structure may be called on any thread unless otherwise 5763 // indicated in the comments. When used in the render process the functions of 5764 // this structure may only be called on the main thread. 5765 /// 5766 struct cef_browser_t 5767 { 5768 /// 5769 // Base structure. 5770 /// 5771 cef_base_ref_counted_t base; 5772 5773 /// 5774 // True if this object is currently valid. This will return false (0) after 5775 // cef_life_span_handler_t::OnBeforeClose is called. 5776 /// 5777 extern(System) int function (cef_browser_t* self) nothrow is_valid; 5778 5779 /// 5780 // Returns the browser host object. This function can only be called in the 5781 // browser process. 5782 /// 5783 extern(System) cef_browser_host_t* function (cef_browser_t* self) nothrow get_host; 5784 5785 /// 5786 // Returns true (1) if the browser can navigate backwards. 5787 /// 5788 extern(System) int function (cef_browser_t* self) nothrow can_go_back; 5789 5790 /// 5791 // Navigate backwards. 5792 /// 5793 extern(System) void function (cef_browser_t* self) nothrow go_back; 5794 5795 /// 5796 // Returns true (1) if the browser can navigate forwards. 5797 /// 5798 extern(System) int function (cef_browser_t* self) nothrow can_go_forward; 5799 5800 /// 5801 // Navigate forwards. 5802 /// 5803 extern(System) void function (cef_browser_t* self) nothrow go_forward; 5804 5805 /// 5806 // Returns true (1) if the browser is currently loading. 5807 /// 5808 extern(System) int function (cef_browser_t* self) nothrow is_loading; 5809 5810 /// 5811 // Reload the current page. 5812 /// 5813 extern(System) void function (cef_browser_t* self) nothrow reload; 5814 5815 /// 5816 // Reload the current page ignoring any cached data. 5817 /// 5818 extern(System) void function (cef_browser_t* self) nothrow reload_ignore_cache; 5819 5820 /// 5821 // Stop loading the page. 5822 /// 5823 extern(System) void function (cef_browser_t* self) nothrow stop_load; 5824 5825 /// 5826 // Returns the globally unique identifier for this browser. This value is also 5827 // used as the tabId for extension APIs. 5828 /// 5829 extern(System) int function (cef_browser_t* self) nothrow get_identifier; 5830 5831 /// 5832 // Returns true (1) if this object is pointing to the same handle as |that| 5833 // object. 5834 /// 5835 extern(System) int function (cef_browser_t* self, cef_browser_t* that) nothrow is_same; 5836 5837 /// 5838 // Returns true (1) if the browser is a popup. 5839 /// 5840 extern(System) int function (cef_browser_t* self) nothrow is_popup; 5841 5842 /// 5843 // Returns true (1) if a document has been loaded in the browser. 5844 /// 5845 extern(System) int function (cef_browser_t* self) nothrow has_document; 5846 5847 /// 5848 // Returns the main (top-level) frame for the browser. In the browser process 5849 // this will return a valid object until after 5850 // cef_life_span_handler_t::OnBeforeClose is called. In the renderer process 5851 // this will return NULL if the main frame is hosted in a different renderer 5852 // process (e.g. for cross-origin sub-frames). The main frame object will 5853 // change during cross-origin navigation or re-navigation after renderer 5854 // process termination (due to crashes, etc). 5855 /// 5856 extern(System) cef_frame_t* function (cef_browser_t* self) nothrow get_main_frame; 5857 5858 /// 5859 // Returns the focused frame for the browser. 5860 /// 5861 extern(System) cef_frame_t* function (cef_browser_t* self) nothrow get_focused_frame; 5862 5863 /// 5864 // Returns the frame with the specified identifier, or NULL if not found. 5865 /// 5866 extern(System) cef_frame_t* function ( 5867 cef_browser_t* self, 5868 int64 identifier) nothrow get_frame_byident; 5869 5870 /// 5871 // Returns the frame with the specified name, or NULL if not found. 5872 /// 5873 extern(System) cef_frame_t* function ( 5874 cef_browser_t* self, 5875 const(cef_string_t)* name) nothrow get_frame; 5876 5877 /// 5878 // Returns the number of frames that currently exist. 5879 /// 5880 extern(System) size_t function (cef_browser_t* self) nothrow get_frame_count; 5881 5882 /// 5883 // Returns the identifiers of all existing frames. 5884 /// 5885 extern(System) void function ( 5886 cef_browser_t* self, 5887 size_t* identifiersCount, 5888 int64* identifiers) nothrow get_frame_identifiers; 5889 5890 /// 5891 // Returns the names of all existing frames. 5892 /// 5893 extern(System) void function ( 5894 cef_browser_t* self, 5895 cef_string_list_t names) nothrow get_frame_names; 5896 } 5897 5898 5899 5900 /// 5901 // Callback structure for cef_browser_host_t::RunFileDialog. The functions of 5902 // this structure will be called on the browser process UI thread. 5903 /// 5904 struct cef_run_file_dialog_callback_t 5905 { 5906 /// 5907 // Base structure. 5908 /// 5909 cef_base_ref_counted_t base; 5910 5911 /// 5912 // Called asynchronously after the file dialog is dismissed. 5913 // |selected_accept_filter| is the 0-based index of the value selected from 5914 // the accept filters array passed to cef_browser_host_t::RunFileDialog. 5915 // |file_paths| will be a single value or a list of values depending on the 5916 // dialog mode. If the selection was cancelled |file_paths| will be NULL. 5917 /// 5918 extern(System) void function ( 5919 cef_run_file_dialog_callback_t* self, 5920 int selected_accept_filter, 5921 cef_string_list_t file_paths) nothrow on_file_dialog_dismissed; 5922 } 5923 5924 5925 5926 /// 5927 // Callback structure for cef_browser_host_t::GetNavigationEntries. The 5928 // functions of this structure will be called on the browser process UI thread. 5929 /// 5930 struct cef_navigation_entry_visitor_t 5931 { 5932 /// 5933 // Base structure. 5934 /// 5935 cef_base_ref_counted_t base; 5936 5937 /// 5938 // Method that will be executed. Do not keep a reference to |entry| outside of 5939 // this callback. Return true (1) to continue visiting entries or false (0) to 5940 // stop. |current| is true (1) if this entry is the currently loaded 5941 // navigation entry. |index| is the 0-based index of this entry and |total| is 5942 // the total number of entries. 5943 /// 5944 extern(System) int function ( 5945 cef_navigation_entry_visitor_t* self, 5946 cef_navigation_entry_t* entry, 5947 int current, 5948 int index, 5949 int total) nothrow visit; 5950 } 5951 5952 5953 5954 /// 5955 // Callback structure for cef_browser_host_t::PrintToPDF. The functions of this 5956 // structure will be called on the browser process UI thread. 5957 /// 5958 struct cef_pdf_print_callback_t 5959 { 5960 /// 5961 // Base structure. 5962 /// 5963 cef_base_ref_counted_t base; 5964 5965 /// 5966 // Method that will be executed when the PDF printing has completed. |path| is 5967 // the output path. |ok| will be true (1) if the printing completed 5968 // successfully or false (0) otherwise. 5969 /// 5970 extern(System) void function ( 5971 cef_pdf_print_callback_t* self, 5972 const(cef_string_t)* path, 5973 int ok) nothrow on_pdf_print_finished; 5974 } 5975 5976 5977 5978 /// 5979 // Callback structure for cef_browser_host_t::DownloadImage. The functions of 5980 // this structure will be called on the browser process UI thread. 5981 /// 5982 struct cef_download_image_callback_t 5983 { 5984 /// 5985 // Base structure. 5986 /// 5987 cef_base_ref_counted_t base; 5988 5989 /// 5990 // Method that will be executed when the image download has completed. 5991 // |image_url| is the URL that was downloaded and |http_status_code| is the 5992 // resulting HTTP status code. |image| is the resulting image, possibly at 5993 // multiple scale factors, or NULL if the download failed. 5994 /// 5995 extern(System) void function ( 5996 cef_download_image_callback_t* self, 5997 const(cef_string_t)* image_url, 5998 int http_status_code, 5999 cef_image_t* image) nothrow on_download_image_finished; 6000 } 6001 6002 6003 6004 /// 6005 // Structure used to represent the browser process aspects of a browser. The 6006 // functions of this structure can only be called in the browser process. They 6007 // may be called on any thread in that process unless otherwise indicated in the 6008 // comments. 6009 /// 6010 struct cef_browser_host_t 6011 { 6012 /// 6013 // Base structure. 6014 /// 6015 cef_base_ref_counted_t base; 6016 6017 /// 6018 // Returns the hosted browser object. 6019 /// 6020 extern(System) cef_browser_t* function (cef_browser_host_t* self) nothrow get_browser; 6021 6022 /// 6023 // Request that the browser close. The JavaScript 'onbeforeunload' event will 6024 // be fired. If |force_close| is false (0) the event handler, if any, will be 6025 // allowed to prompt the user and the user can optionally cancel the close. If 6026 // |force_close| is true (1) the prompt will not be displayed and the close 6027 // will proceed. Results in a call to cef_life_span_handler_t::do_close() if 6028 // the event handler allows the close or if |force_close| is true (1). See 6029 // cef_life_span_handler_t::do_close() documentation for additional usage 6030 // information. 6031 /// 6032 extern(System) void function (cef_browser_host_t* self, int force_close) nothrow close_browser; 6033 6034 /// 6035 // Helper for closing a browser. Call this function from the top-level window 6036 // close handler (if any). Internally this calls CloseBrowser(false (0)) if 6037 // the close has not yet been initiated. This function returns false (0) while 6038 // the close is pending and true (1) after the close has completed. See 6039 // close_browser() and cef_life_span_handler_t::do_close() documentation for 6040 // additional usage information. This function must be called on the browser 6041 // process UI thread. 6042 /// 6043 extern(System) int function (cef_browser_host_t* self) nothrow try_close_browser; 6044 6045 /// 6046 // Set whether the browser is focused. 6047 /// 6048 extern(System) void function (cef_browser_host_t* self, int focus) nothrow set_focus; 6049 6050 /// 6051 // Retrieve the window handle (if any) for this browser. If this browser is 6052 // wrapped in a cef_browser_view_t this function should be called on the 6053 // browser process UI thread and it will return the handle for the top-level 6054 // native window. 6055 /// 6056 extern(System) c_ulong function (cef_browser_host_t* self) nothrow get_window_handle; 6057 6058 /// 6059 // Retrieve the window handle (if any) of the browser that opened this 6060 // browser. Will return NULL for non-popup browsers or if this browser is 6061 // wrapped in a cef_browser_view_t. This function can be used in combination 6062 // with custom handling of modal windows. 6063 /// 6064 extern(System) c_ulong function (cef_browser_host_t* self) nothrow get_opener_window_handle; 6065 6066 /// 6067 // Returns true (1) if this browser is wrapped in a cef_browser_view_t. 6068 /// 6069 extern(System) int function (cef_browser_host_t* self) nothrow has_view; 6070 6071 /// 6072 // Returns the client for this browser. 6073 /// 6074 extern(System) cef_client_t* function (cef_browser_host_t* self) nothrow get_client; 6075 6076 /// 6077 // Returns the request context for this browser. 6078 /// 6079 extern(System) cef_request_context_t* function ( 6080 cef_browser_host_t* self) nothrow get_request_context; 6081 6082 /// 6083 // Get the current zoom level. The default zoom level is 0.0. This function 6084 // can only be called on the UI thread. 6085 /// 6086 extern(System) double function (cef_browser_host_t* self) nothrow get_zoom_level; 6087 6088 /// 6089 // Change the zoom level to the specified value. Specify 0.0 to reset the zoom 6090 // level. If called on the UI thread the change will be applied immediately. 6091 // Otherwise, the change will be applied asynchronously on the UI thread. 6092 /// 6093 extern(System) void function (cef_browser_host_t* self, double zoomLevel) nothrow set_zoom_level; 6094 6095 /// 6096 // Call to run a file chooser dialog. Only a single file chooser dialog may be 6097 // pending at any given time. |mode| represents the type of dialog to display. 6098 // |title| to the title to be used for the dialog and may be NULL to show the 6099 // default title ("Open" or "Save" depending on the mode). |default_file_path| 6100 // is the path with optional directory and/or file name component that will be 6101 // initially selected in the dialog. |accept_filters| are used to restrict the 6102 // selectable file types and may any combination of (a) valid lower-cased MIME 6103 // types (e.g. "text/*" or "image/*"), (b) individual file extensions (e.g. 6104 // ".txt" or ".png"), or (c) combined description and file extension delimited 6105 // using "|" and ";" (e.g. "Image Types|.png;.gif;.jpg"). 6106 // |selected_accept_filter| is the 0-based index of the filter that will be 6107 // selected by default. |callback| will be executed after the dialog is 6108 // dismissed or immediately if another dialog is already pending. The dialog 6109 // will be initiated asynchronously on the UI thread. 6110 /// 6111 extern(System) void function ( 6112 cef_browser_host_t* self, 6113 cef_file_dialog_mode_t mode, 6114 const(cef_string_t)* title, 6115 const(cef_string_t)* default_file_path, 6116 cef_string_list_t accept_filters, 6117 int selected_accept_filter, 6118 cef_run_file_dialog_callback_t* callback) nothrow run_file_dialog; 6119 6120 /// 6121 // Download the file at |url| using cef_download_handler_t. 6122 /// 6123 extern(System) void function ( 6124 cef_browser_host_t* self, 6125 const(cef_string_t)* url) nothrow start_download; 6126 6127 /// 6128 // Download |image_url| and execute |callback| on completion with the images 6129 // received from the renderer. If |is_favicon| is true (1) then cookies are 6130 // not sent and not accepted during download. Images with density independent 6131 // pixel (DIP) sizes larger than |max_image_size| are filtered out from the 6132 // image results. Versions of the image at different scale factors may be 6133 // downloaded up to the maximum scale factor supported by the system. If there 6134 // are no image results <= |max_image_size| then the smallest image is resized 6135 // to |max_image_size| and is the only result. A |max_image_size| of 0 means 6136 // unlimited. If |bypass_cache| is true (1) then |image_url| is requested from 6137 // the server even if it is present in the browser cache. 6138 /// 6139 extern(System) void function ( 6140 cef_browser_host_t* self, 6141 const(cef_string_t)* image_url, 6142 int is_favicon, 6143 uint32 max_image_size, 6144 int bypass_cache, 6145 cef_download_image_callback_t* callback) nothrow download_image; 6146 6147 /// 6148 // Print the current browser contents. 6149 /// 6150 extern(System) void function (cef_browser_host_t* self) nothrow print; 6151 6152 /// 6153 // Print the current browser contents to the PDF file specified by |path| and 6154 // execute |callback| on completion. The caller is responsible for deleting 6155 // |path| when done. For PDF printing to work on Linux you must implement the 6156 // cef_print_handler_t::GetPdfPaperSize function. 6157 /// 6158 extern(System) void function ( 6159 cef_browser_host_t* self, 6160 const(cef_string_t)* path, 6161 const(cef_pdf_print_settings_t)* settings, 6162 cef_pdf_print_callback_t* callback) nothrow print_to_pdf; 6163 6164 /// 6165 // Search for |searchText|. |identifier| must be a unique ID and these IDs 6166 // must strictly increase so that newer requests always have greater IDs than 6167 // older requests. If |identifier| is zero or less than the previous ID value 6168 // then it will be automatically assigned a new valid ID. |forward| indicates 6169 // whether to search forward or backward within the page. |matchCase| 6170 // indicates whether the search should be case-sensitive. |findNext| indicates 6171 // whether this is the first request or a follow-up. The cef_find_handler_t 6172 // instance, if any, returned via cef_client_t::GetFindHandler will be called 6173 // to report find results. 6174 /// 6175 extern(System) void function ( 6176 cef_browser_host_t* self, 6177 int identifier, 6178 const(cef_string_t)* searchText, 6179 int forward, 6180 int matchCase, 6181 int findNext) nothrow find; 6182 6183 /// 6184 // Cancel all searches that are currently going on. 6185 /// 6186 extern(System) void function (cef_browser_host_t* self, int clearSelection) nothrow stop_finding; 6187 6188 /// 6189 // Open developer tools (DevTools) in its own browser. The DevTools browser 6190 // will remain associated with this browser. If the DevTools browser is 6191 // already open then it will be focused, in which case the |windowInfo|, 6192 // |client| and |settings| parameters will be ignored. If |inspect_element_at| 6193 // is non-NULL then the element at the specified (x,y) location will be 6194 // inspected. The |windowInfo| parameter will be ignored if this browser is 6195 // wrapped in a cef_browser_view_t. 6196 /// 6197 extern(System) void function ( 6198 cef_browser_host_t* self, 6199 const(cef_window_info_t)* windowInfo, 6200 cef_client_t* client, 6201 const(cef_browser_settings_t)* settings, 6202 const(cef_point_t)* inspect_element_at) nothrow show_dev_tools; 6203 6204 /// 6205 // Explicitly close the associated DevTools browser, if any. 6206 /// 6207 extern(System) void function (cef_browser_host_t* self) nothrow close_dev_tools; 6208 6209 /// 6210 // Returns true (1) if this browser currently has an associated DevTools 6211 // browser. Must be called on the browser process UI thread. 6212 /// 6213 extern(System) int function (cef_browser_host_t* self) nothrow has_dev_tools; 6214 6215 /// 6216 // Send a function call message over the DevTools protocol. |message| must be 6217 // a UTF8-encoded JSON dictionary that contains "id" (int), "function" 6218 // (string) and "params" (dictionary, optional) values. See the DevTools 6219 // protocol documentation at https://chromedevtools.github.io/devtools- 6220 // protocol/ for details of supported functions and the expected "params" 6221 // dictionary contents. |message| will be copied if necessary. This function 6222 // will return true (1) if called on the UI thread and the message was 6223 // successfully submitted for validation, otherwise false (0). Validation will 6224 // be applied asynchronously and any messages that fail due to formatting 6225 // errors or missing parameters may be discarded without notification. Prefer 6226 // ExecuteDevToolsMethod if a more structured approach to message formatting 6227 // is desired. 6228 // 6229 // Every valid function call will result in an asynchronous function result or 6230 // error message that references the sent message "id". Event messages are 6231 // received while notifications are enabled (for example, between function 6232 // calls for "Page.enable" and "Page.disable"). All received messages will be 6233 // delivered to the observer(s) registered with AddDevToolsMessageObserver. 6234 // See cef_dev_tools_message_observer_t::OnDevToolsMessage documentation for 6235 // details of received message contents. 6236 // 6237 // Usage of the SendDevToolsMessage, ExecuteDevToolsMethod and 6238 // AddDevToolsMessageObserver functions does not require an active DevTools 6239 // front-end or remote-debugging session. Other active DevTools sessions will 6240 // continue to function independently. However, any modification of global 6241 // browser state by one session may not be reflected in the UI of other 6242 // sessions. 6243 // 6244 // Communication with the DevTools front-end (when displayed) can be logged 6245 // for development purposes by passing the `--devtools-protocol-log- 6246 // file=<path>` command-line flag. 6247 /// 6248 extern(System) int function ( 6249 cef_browser_host_t* self, 6250 const(void)* message, 6251 size_t message_size) nothrow send_dev_tools_message; 6252 6253 /// 6254 // Execute a function call over the DevTools protocol. This is a more 6255 // structured version of SendDevToolsMessage. |message_id| is an incremental 6256 // number that uniquely identifies the message (pass 0 to have the next number 6257 // assigned automatically based on previous values). |function| is the 6258 // function name. |params| are the function parameters, which may be NULL. See 6259 // the DevTools protocol documentation (linked above) for details of supported 6260 // functions and the expected |params| dictionary contents. This function will 6261 // return the assigned message ID if called on the UI thread and the message 6262 // was successfully submitted for validation, otherwise 0. See the 6263 // SendDevToolsMessage documentation for additional usage information. 6264 /// 6265 extern(System) int function ( 6266 cef_browser_host_t* self, 6267 int message_id, 6268 const(cef_string_t)* method, 6269 cef_dictionary_value_t* params) nothrow execute_dev_tools_method; 6270 6271 /// 6272 // Add an observer for DevTools protocol messages (function results and 6273 // events). The observer will remain registered until the returned 6274 // Registration object is destroyed. See the SendDevToolsMessage documentation 6275 // for additional usage information. 6276 /// 6277 extern(System) cef_registration_t* function ( 6278 cef_browser_host_t* self, 6279 cef_dev_tools_message_observer_t* observer) nothrow add_dev_tools_message_observer; 6280 6281 /// 6282 // Retrieve a snapshot of current navigation entries as values sent to the 6283 // specified visitor. If |current_only| is true (1) only the current 6284 // navigation entry will be sent, otherwise all navigation entries will be 6285 // sent. 6286 /// 6287 extern(System) void function ( 6288 cef_browser_host_t* self, 6289 cef_navigation_entry_visitor_t* visitor, 6290 int current_only) nothrow get_navigation_entries; 6291 6292 /// 6293 // If a misspelled word is currently selected in an editable node calling this 6294 // function will replace it with the specified |word|. 6295 /// 6296 extern(System) void function ( 6297 cef_browser_host_t* self, 6298 const(cef_string_t)* word) nothrow replace_misspelling; 6299 6300 /// 6301 // Add the specified |word| to the spelling dictionary. 6302 /// 6303 extern(System) void function ( 6304 cef_browser_host_t* self, 6305 const(cef_string_t)* word) nothrow add_word_to_dictionary; 6306 6307 /// 6308 // Returns true (1) if window rendering is disabled. 6309 /// 6310 extern(System) int function (cef_browser_host_t* self) nothrow is_window_rendering_disabled; 6311 6312 /// 6313 // Notify the browser that the widget has been resized. The browser will first 6314 // call cef_render_handler_t::GetViewRect to get the new size and then call 6315 // cef_render_handler_t::OnPaint asynchronously with the updated regions. This 6316 // function is only used when window rendering is disabled. 6317 /// 6318 extern(System) void function (cef_browser_host_t* self) nothrow was_resized; 6319 6320 /// 6321 // Notify the browser that it has been hidden or shown. Layouting and 6322 // cef_render_handler_t::OnPaint notification will stop when the browser is 6323 // hidden. This function is only used when window rendering is disabled. 6324 /// 6325 extern(System) void function (cef_browser_host_t* self, int hidden) nothrow was_hidden; 6326 6327 /// 6328 // Send a notification to the browser that the screen info has changed. The 6329 // browser will then call cef_render_handler_t::GetScreenInfo to update the 6330 // screen information with the new values. This simulates moving the webview 6331 // window from one display to another, or changing the properties of the 6332 // current display. This function is only used when window rendering is 6333 // disabled. 6334 /// 6335 extern(System) void function (cef_browser_host_t* self) nothrow notify_screen_info_changed; 6336 6337 /// 6338 // Invalidate the view. The browser will call cef_render_handler_t::OnPaint 6339 // asynchronously. This function is only used when window rendering is 6340 // disabled. 6341 /// 6342 extern(System) void function ( 6343 cef_browser_host_t* self, 6344 cef_paint_element_type_t type) nothrow invalidate; 6345 6346 /// 6347 // Issue a BeginFrame request to Chromium. Only valid when 6348 // cef_window_tInfo::external_begin_frame_enabled is set to true (1). 6349 /// 6350 extern(System) void function (cef_browser_host_t* self) nothrow send_external_begin_frame; 6351 6352 /// 6353 // Send a key event to the browser. 6354 /// 6355 extern(System) void function ( 6356 cef_browser_host_t* self, 6357 const(cef_key_event_t)* event) nothrow send_key_event; 6358 6359 /// 6360 // Send a mouse click event to the browser. The |x| and |y| coordinates are 6361 // relative to the upper-left corner of the view. 6362 /// 6363 extern(System) void function ( 6364 cef_browser_host_t* self, 6365 const(cef_mouse_event_t)* event, 6366 cef_mouse_button_type_t type, 6367 int mouseUp, 6368 int clickCount) nothrow send_mouse_click_event; 6369 6370 /// 6371 // Send a mouse move event to the browser. The |x| and |y| coordinates are 6372 // relative to the upper-left corner of the view. 6373 /// 6374 extern(System) void function ( 6375 cef_browser_host_t* self, 6376 const(cef_mouse_event_t)* event, 6377 int mouseLeave) nothrow send_mouse_move_event; 6378 6379 /// 6380 // Send a mouse wheel event to the browser. The |x| and |y| coordinates are 6381 // relative to the upper-left corner of the view. The |deltaX| and |deltaY| 6382 // values represent the movement delta in the X and Y directions respectively. 6383 // In order to scroll inside select popups with window rendering disabled 6384 // cef_render_handler_t::GetScreenPoint should be implemented properly. 6385 /// 6386 extern(System) void function ( 6387 cef_browser_host_t* self, 6388 const(cef_mouse_event_t)* event, 6389 int deltaX, 6390 int deltaY) nothrow send_mouse_wheel_event; 6391 6392 /// 6393 // Send a touch event to the browser for a windowless browser. 6394 /// 6395 extern(System) void function ( 6396 cef_browser_host_t* self, 6397 const(cef_touch_event_t)* event) nothrow send_touch_event; 6398 6399 /// 6400 // Send a capture lost event to the browser. 6401 /// 6402 extern(System) void function (cef_browser_host_t* self) nothrow send_capture_lost_event; 6403 6404 /// 6405 // Notify the browser that the window hosting it is about to be moved or 6406 // resized. This function is only used on Windows and Linux. 6407 /// 6408 extern(System) void function (cef_browser_host_t* self) nothrow notify_move_or_resize_started; 6409 6410 /// 6411 // Returns the maximum rate in frames per second (fps) that 6412 // cef_render_handler_t:: OnPaint will be called for a windowless browser. The 6413 // actual fps may be lower if the browser cannot generate frames at the 6414 // requested rate. The minimum value is 1 and the maximum value is 60 (default 6415 // 30). This function can only be called on the UI thread. 6416 /// 6417 extern(System) int function (cef_browser_host_t* self) nothrow get_windowless_frame_rate; 6418 6419 /// 6420 // Set the maximum rate in frames per second (fps) that cef_render_handler_t:: 6421 // OnPaint will be called for a windowless browser. The actual fps may be 6422 // lower if the browser cannot generate frames at the requested rate. The 6423 // minimum value is 1 and the maximum value is 60 (default 30). Can also be 6424 // set at browser creation via cef_browser_tSettings.windowless_frame_rate. 6425 /// 6426 extern(System) void function ( 6427 cef_browser_host_t* self, 6428 int frame_rate) nothrow set_windowless_frame_rate; 6429 6430 /// 6431 // Begins a new composition or updates the existing composition. Blink has a 6432 // special node (a composition node) that allows the input function to change 6433 // text without affecting other DOM nodes. |text| is the optional text that 6434 // will be inserted into the composition node. |underlines| is an optional set 6435 // of ranges that will be underlined in the resulting text. 6436 // |replacement_range| is an optional range of the existing text that will be 6437 // replaced. |selection_range| is an optional range of the resulting text that 6438 // will be selected after insertion or replacement. The |replacement_range| 6439 // value is only used on OS X. 6440 // 6441 // This function may be called multiple times as the composition changes. When 6442 // the client is done making changes the composition should either be canceled 6443 // or completed. To cancel the composition call ImeCancelComposition. To 6444 // complete the composition call either ImeCommitText or 6445 // ImeFinishComposingText. Completion is usually signaled when: 6446 // A. The client receives a WM_IME_COMPOSITION message with a GCS_RESULTSTR 6447 // flag (on Windows), or; 6448 // B. The client receives a "commit" signal of GtkIMContext (on Linux), or; 6449 // C. insertText of NSTextInput is called (on Mac). 6450 // 6451 // This function is only used when window rendering is disabled. 6452 /// 6453 extern(System) void function ( 6454 cef_browser_host_t* self, 6455 const(cef_string_t)* text, 6456 size_t underlinesCount, 6457 const(cef_composition_underline_t)* underlines, 6458 const(cef_range_t)* replacement_range, 6459 const(cef_range_t)* selection_range) nothrow ime_set_composition; 6460 6461 /// 6462 // Completes the existing composition by optionally inserting the specified 6463 // |text| into the composition node. |replacement_range| is an optional range 6464 // of the existing text that will be replaced. |relative_cursor_pos| is where 6465 // the cursor will be positioned relative to the current cursor position. See 6466 // comments on ImeSetComposition for usage. The |replacement_range| and 6467 // |relative_cursor_pos| values are only used on OS X. This function is only 6468 // used when window rendering is disabled. 6469 /// 6470 extern(System) void function ( 6471 cef_browser_host_t* self, 6472 const(cef_string_t)* text, 6473 const(cef_range_t)* replacement_range, 6474 int relative_cursor_pos) nothrow ime_commit_text; 6475 6476 /// 6477 // Completes the existing composition by applying the current composition node 6478 // contents. If |keep_selection| is false (0) the current selection, if any, 6479 // will be discarded. See comments on ImeSetComposition for usage. This 6480 // function is only used when window rendering is disabled. 6481 /// 6482 extern(System) void function ( 6483 cef_browser_host_t* self, 6484 int keep_selection) nothrow ime_finish_composing_text; 6485 6486 /// 6487 // Cancels the existing composition and discards the composition node contents 6488 // without applying them. See comments on ImeSetComposition for usage. This 6489 // function is only used when window rendering is disabled. 6490 /// 6491 extern(System) void function (cef_browser_host_t* self) nothrow ime_cancel_composition; 6492 6493 /// 6494 // Call this function when the user drags the mouse into the web view (before 6495 // calling DragTargetDragOver/DragTargetLeave/DragTargetDrop). |drag_data| 6496 // should not contain file contents as this type of data is not allowed to be 6497 // dragged into the web view. File contents can be removed using 6498 // cef_drag_data_t::ResetFileContents (for example, if |drag_data| comes from 6499 // cef_render_handler_t::StartDragging). This function is only used when 6500 // window rendering is disabled. 6501 /// 6502 extern(System) void function ( 6503 cef_browser_host_t* self, 6504 cef_drag_data_t* drag_data, 6505 const(cef_mouse_event_t)* event, 6506 cef_drag_operations_mask_t allowed_ops) nothrow drag_target_drag_enter; 6507 6508 /// 6509 // Call this function each time the mouse is moved across the web view during 6510 // a drag operation (after calling DragTargetDragEnter and before calling 6511 // DragTargetDragLeave/DragTargetDrop). This function is only used when window 6512 // rendering is disabled. 6513 /// 6514 extern(System) void function ( 6515 cef_browser_host_t* self, 6516 const(cef_mouse_event_t)* event, 6517 cef_drag_operations_mask_t allowed_ops) nothrow drag_target_drag_over; 6518 6519 /// 6520 // Call this function when the user drags the mouse out of the web view (after 6521 // calling DragTargetDragEnter). This function is only used when window 6522 // rendering is disabled. 6523 /// 6524 extern(System) void function (cef_browser_host_t* self) nothrow drag_target_drag_leave; 6525 6526 /// 6527 // Call this function when the user completes the drag operation by dropping 6528 // the object onto the web view (after calling DragTargetDragEnter). The 6529 // object being dropped is |drag_data|, given as an argument to the previous 6530 // DragTargetDragEnter call. This function is only used when window rendering 6531 // is disabled. 6532 /// 6533 extern(System) void function ( 6534 cef_browser_host_t* self, 6535 const(cef_mouse_event_t)* event) nothrow drag_target_drop; 6536 6537 /// 6538 // Call this function when the drag operation started by a 6539 // cef_render_handler_t::StartDragging call has ended either in a drop or by 6540 // being cancelled. |x| and |y| are mouse coordinates relative to the upper- 6541 // left corner of the view. If the web view is both the drag source and the 6542 // drag target then all DragTarget* functions should be called before 6543 // DragSource* mthods. This function is only used when window rendering is 6544 // disabled. 6545 /// 6546 extern(System) void function ( 6547 cef_browser_host_t* self, 6548 int x, 6549 int y, 6550 cef_drag_operations_mask_t op) nothrow drag_source_ended_at; 6551 6552 /// 6553 // Call this function when the drag operation started by a 6554 // cef_render_handler_t::StartDragging call has completed. This function may 6555 // be called immediately without first calling DragSourceEndedAt to cancel a 6556 // drag operation. If the web view is both the drag source and the drag target 6557 // then all DragTarget* functions should be called before DragSource* mthods. 6558 // This function is only used when window rendering is disabled. 6559 /// 6560 extern(System) void function (cef_browser_host_t* self) nothrow drag_source_system_drag_ended; 6561 6562 /// 6563 // Returns the current visible navigation entry for this browser. This 6564 // function can only be called on the UI thread. 6565 /// 6566 extern(System) cef_navigation_entry_t* function ( 6567 cef_browser_host_t* self) nothrow get_visible_navigation_entry; 6568 6569 /// 6570 // Set accessibility state for all frames. |accessibility_state| may be 6571 // default, enabled or disabled. If |accessibility_state| is STATE_DEFAULT 6572 // then accessibility will be disabled by default and the state may be further 6573 // controlled with the "force-renderer-accessibility" and "disable-renderer- 6574 // accessibility" command-line switches. If |accessibility_state| is 6575 // STATE_ENABLED then accessibility will be enabled. If |accessibility_state| 6576 // is STATE_DISABLED then accessibility will be completely disabled. 6577 // 6578 // For windowed browsers accessibility will be enabled in Complete mode (which 6579 // corresponds to kAccessibilityModeComplete in Chromium). In this mode all 6580 // platform accessibility objects will be created and managed by Chromium's 6581 // internal implementation. The client needs only to detect the screen reader 6582 // and call this function appropriately. For example, on macOS the client can 6583 // handle the @"AXEnhancedUserStructure" accessibility attribute to detect 6584 // VoiceOver state changes and on Windows the client can handle WM_GETOBJECT 6585 // with OBJID_CLIENT to detect accessibility readers. 6586 // 6587 // For windowless browsers accessibility will be enabled in TreeOnly mode 6588 // (which corresponds to kAccessibilityModeWebContentsOnly in Chromium). In 6589 // this mode renderer accessibility is enabled, the full tree is computed, and 6590 // events are passed to CefAccessibiltyHandler, but platform accessibility 6591 // objects are not created. The client may implement platform accessibility 6592 // objects using CefAccessibiltyHandler callbacks if desired. 6593 /// 6594 extern(System) void function ( 6595 cef_browser_host_t* self, 6596 cef_state_t accessibility_state) nothrow set_accessibility_state; 6597 6598 /// 6599 // Enable notifications of auto resize via 6600 // cef_display_handler_t::OnAutoResize. Notifications are disabled by default. 6601 // |min_size| and |max_size| define the range of allowed sizes. 6602 /// 6603 extern(System) void function ( 6604 cef_browser_host_t* self, 6605 int enabled, 6606 const(cef_size_t)* min_size, 6607 const(cef_size_t)* max_size) nothrow set_auto_resize_enabled; 6608 6609 /// 6610 // Returns the extension hosted in this browser or NULL if no extension is 6611 // hosted. See cef_request_context_t::LoadExtension for details. 6612 /// 6613 extern(System) cef_extension_t* function (cef_browser_host_t* self) nothrow get_extension; 6614 6615 /// 6616 // Returns true (1) if this browser is hosting an extension background script. 6617 // Background hosts do not have a window and are not displayable. See 6618 // cef_request_context_t::LoadExtension for details. 6619 /// 6620 extern(System) int function (cef_browser_host_t* self) nothrow is_background_host; 6621 6622 /// 6623 // Set whether the browser's audio is muted. 6624 /// 6625 extern(System) void function (cef_browser_host_t* self, int mute) nothrow set_audio_muted; 6626 6627 /// 6628 // Returns true (1) if the browser's audio is muted. This function can only 6629 // be called on the UI thread. 6630 /// 6631 extern(System) int function (cef_browser_host_t* self) nothrow is_audio_muted; 6632 } 6633 6634 6635 6636 /// 6637 // Create a new browser using the window parameters specified by |windowInfo|. 6638 // All values will be copied internally and the actual window (if any) will be 6639 // created on the UI thread. If |request_context| is NULL the global request 6640 // context will be used. This function can be called on any browser process 6641 // thread and will not block. The optional |extra_info| parameter provides an 6642 // opportunity to specify extra information specific to the created browser that 6643 // will be passed to cef_render_process_handler_t::on_browser_created() in the 6644 // render process. 6645 /// 6646 int cef_browser_host_create_browser ( 6647 const(cef_window_info_t)* windowInfo, 6648 cef_client_t* client, 6649 const(cef_string_t)* url, 6650 const(cef_browser_settings_t)* settings, 6651 cef_dictionary_value_t* extra_info, 6652 cef_request_context_t* request_context); 6653 6654 /// 6655 // Create a new browser using the window parameters specified by |windowInfo|. 6656 // If |request_context| is NULL the global request context will be used. This 6657 // function can only be called on the browser process UI thread. The optional 6658 // |extra_info| parameter provides an opportunity to specify extra information 6659 // specific to the created browser that will be passed to 6660 // cef_render_process_handler_t::on_browser_created() in the render process. 6661 /// 6662 cef_browser_t* cef_browser_host_create_browser_sync ( 6663 const(cef_window_info_t)* windowInfo, 6664 cef_client_t* client, 6665 const(cef_string_t)* url, 6666 const(cef_browser_settings_t)* settings, 6667 cef_dictionary_value_t* extra_info, 6668 cef_request_context_t* request_context); 6669 6670 // CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_ 6671 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 6672 // 6673 // Redistribution and use in source and binary forms, with or without 6674 // modification, are permitted provided that the following conditions are 6675 // met: 6676 // 6677 // * Redistributions of source code must retain the above copyright 6678 // notice, this list of conditions and the following disclaimer. 6679 // * Redistributions in binary form must reproduce the above 6680 // copyright notice, this list of conditions and the following disclaimer 6681 // in the documentation and/or other materials provided with the 6682 // distribution. 6683 // * Neither the name of Google Inc. nor the name Chromium Embedded 6684 // Framework nor the names of its contributors may be used to endorse 6685 // or promote products derived from this software without specific prior 6686 // written permission. 6687 // 6688 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 6689 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 6690 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 6691 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 6692 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 6693 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 6694 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 6695 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 6696 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 6697 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 6698 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 6699 // 6700 // --------------------------------------------------------------------------- 6701 // 6702 // This file was generated by the CEF translator tool and should not edited 6703 // by hand. See the translator.README.txt file in the tools directory for 6704 // more information. 6705 // 6706 // $hash=ade537f836add7fe0b5fd94ceba26d678abb3e43$ 6707 // 6708 6709 extern (C): 6710 6711 /// 6712 // Structure used to implement browser process callbacks. The functions of this 6713 // structure will be called on the browser process main thread unless otherwise 6714 // indicated. 6715 /// 6716 struct cef_browser_process_handler_t 6717 { 6718 /// 6719 // Base structure. 6720 /// 6721 cef_base_ref_counted_t base; 6722 6723 /// 6724 // Called on the browser process UI thread immediately after the CEF context 6725 // has been initialized. 6726 /// 6727 extern(System) void function ( 6728 cef_browser_process_handler_t* self) nothrow on_context_initialized; 6729 6730 /// 6731 // Called before a child process is launched. Will be called on the browser 6732 // process UI thread when launching a render process and on the browser 6733 // process IO thread when launching a GPU or plugin process. Provides an 6734 // opportunity to modify the child process command line. Do not keep a 6735 // reference to |command_line| outside of this function. 6736 /// 6737 extern(System) void function ( 6738 cef_browser_process_handler_t* self, 6739 cef_command_line_t* command_line) nothrow on_before_child_process_launch; 6740 6741 /// 6742 // Called from any thread when work has been scheduled for the browser process 6743 // main (UI) thread. This callback is used in combination with CefSettings. 6744 // external_message_pump and cef_do_message_loop_work() in cases where the CEF 6745 // message loop must be integrated into an existing application message loop 6746 // (see additional comments and warnings on CefDoMessageLoopWork). This 6747 // callback should schedule a cef_do_message_loop_work() call to happen on the 6748 // main (UI) thread. |delay_ms| is the requested delay in milliseconds. If 6749 // |delay_ms| is <= 0 then the call should happen reasonably soon. If 6750 // |delay_ms| is > 0 then the call should be scheduled to happen after the 6751 // specified delay and any currently pending scheduled call should be 6752 // cancelled. 6753 /// 6754 extern(System) void function ( 6755 cef_browser_process_handler_t* self, 6756 int64 delay_ms) nothrow on_schedule_message_pump_work; 6757 6758 /// 6759 // Return the default client for use with a newly created browser window. If 6760 // null is returned the browser will be unmanaged (no callbacks will be 6761 // executed for that browser) and application shutdown will be blocked until 6762 // the browser window is closed manually. This function is currently only used 6763 // with the chrome runtime. 6764 /// 6765 extern(System) cef_client_t* function ( 6766 cef_browser_process_handler_t* self) nothrow get_default_client; 6767 } 6768 6769 6770 6771 // CEF_INCLUDE_CAPI_CEF_BROWSER_PROCESS_HANDLER_CAPI_H_ 6772 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 6773 // 6774 // Redistribution and use in source and binary forms, with or without 6775 // modification, are permitted provided that the following conditions are 6776 // met: 6777 // 6778 // * Redistributions of source code must retain the above copyright 6779 // notice, this list of conditions and the following disclaimer. 6780 // * Redistributions in binary form must reproduce the above 6781 // copyright notice, this list of conditions and the following disclaimer 6782 // in the documentation and/or other materials provided with the 6783 // distribution. 6784 // * Neither the name of Google Inc. nor the name Chromium Embedded 6785 // Framework nor the names of its contributors may be used to endorse 6786 // or promote products derived from this software without specific prior 6787 // written permission. 6788 // 6789 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 6790 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 6791 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 6792 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 6793 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 6794 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 6795 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 6796 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 6797 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 6798 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 6799 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 6800 // 6801 // --------------------------------------------------------------------------- 6802 // 6803 // This file was generated by the CEF translator tool and should not edited 6804 // by hand. See the translator.README.txt file in the tools directory for 6805 // more information. 6806 // 6807 // $hash=cd8c183355a6808abd763ecc0396b5da6c15b3f9$ 6808 // 6809 6810 extern (C): 6811 6812 /// 6813 // Generic callback structure used for asynchronous continuation. 6814 /// 6815 struct cef_callback_t 6816 { 6817 /// 6818 // Base structure. 6819 /// 6820 cef_base_ref_counted_t base; 6821 6822 /// 6823 // Continue processing. 6824 /// 6825 extern(System) void function (cef_callback_t* self) nothrow cont; 6826 6827 /// 6828 // Cancel processing. 6829 /// 6830 extern(System) void function (cef_callback_t* self) nothrow cancel; 6831 } 6832 6833 6834 6835 /// 6836 // Generic callback structure used for asynchronous completion. 6837 /// 6838 struct cef_completion_callback_t 6839 { 6840 /// 6841 // Base structure. 6842 /// 6843 cef_base_ref_counted_t base; 6844 6845 /// 6846 // Method that will be called once the task is complete. 6847 /// 6848 extern(System) void function (cef_completion_callback_t* self) nothrow on_complete; 6849 } 6850 6851 6852 6853 // CEF_INCLUDE_CAPI_CEF_CALLBACK_CAPI_H_ 6854 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 6855 // 6856 // Redistribution and use in source and binary forms, with or without 6857 // modification, are permitted provided that the following conditions are 6858 // met: 6859 // 6860 // * Redistributions of source code must retain the above copyright 6861 // notice, this list of conditions and the following disclaimer. 6862 // * Redistributions in binary form must reproduce the above 6863 // copyright notice, this list of conditions and the following disclaimer 6864 // in the documentation and/or other materials provided with the 6865 // distribution. 6866 // * Neither the name of Google Inc. nor the name Chromium Embedded 6867 // Framework nor the names of its contributors may be used to endorse 6868 // or promote products derived from this software without specific prior 6869 // written permission. 6870 // 6871 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 6872 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 6873 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 6874 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 6875 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 6876 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 6877 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 6878 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 6879 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 6880 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 6881 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 6882 // 6883 // --------------------------------------------------------------------------- 6884 // 6885 // This file was generated by the CEF translator tool and should not edited 6886 // by hand. See the translator.README.txt file in the tools directory for 6887 // more information. 6888 // 6889 // $hash=845a1d1dda63a06f4ae33ed39acfd2599b46a885$ 6890 // 6891 6892 extern (C): 6893 6894 /// 6895 // Implement this structure to provide handler implementations. 6896 /// 6897 struct cef_client_t 6898 { 6899 /// 6900 // Base structure. 6901 /// 6902 cef_base_ref_counted_t base; 6903 6904 /// 6905 // Return the handler for audio rendering events. 6906 /// 6907 extern(System) cef_audio_handler_t* function (cef_client_t* self) nothrow get_audio_handler; 6908 6909 /// 6910 // Return the handler for context menus. If no handler is provided the default 6911 // implementation will be used. 6912 /// 6913 extern(System) cef_context_menu_handler_t* function ( 6914 cef_client_t* self) nothrow get_context_menu_handler; 6915 6916 /// 6917 // Return the handler for dialogs. If no handler is provided the default 6918 // implementation will be used. 6919 /// 6920 extern(System) cef_dialog_handler_t* function (cef_client_t* self) nothrow get_dialog_handler; 6921 6922 /// 6923 // Return the handler for browser display state events. 6924 /// 6925 extern(System) cef_display_handler_t* function (cef_client_t* self) nothrow get_display_handler; 6926 6927 /// 6928 // Return the handler for download events. If no handler is returned downloads 6929 // will not be allowed. 6930 /// 6931 extern(System) cef_download_handler_t* function ( 6932 cef_client_t* self) nothrow get_download_handler; 6933 6934 /// 6935 // Return the handler for drag events. 6936 /// 6937 extern(System) cef_drag_handler_t* function (cef_client_t* self) nothrow get_drag_handler; 6938 6939 /// 6940 // Return the handler for find result events. 6941 /// 6942 extern(System) cef_find_handler_t* function (cef_client_t* self) nothrow get_find_handler; 6943 6944 /// 6945 // Return the handler for focus events. 6946 /// 6947 extern(System) cef_focus_handler_t* function (cef_client_t* self) nothrow get_focus_handler; 6948 6949 /// 6950 // Return the handler for events related to cef_frame_t lifespan. This 6951 // function will be called once during cef_browser_t creation and the result 6952 // will be cached for performance reasons. 6953 /// 6954 extern(System) cef_frame_handler_t* function (cef_client_t* self) nothrow get_frame_handler; 6955 6956 /// 6957 // Return the handler for JavaScript dialogs. If no handler is provided the 6958 // default implementation will be used. 6959 /// 6960 extern(System) cef_jsdialog_handler_t* function ( 6961 cef_client_t* self) nothrow get_jsdialog_handler; 6962 6963 /// 6964 // Return the handler for keyboard events. 6965 /// 6966 extern(System) cef_keyboard_handler_t* function ( 6967 cef_client_t* self) nothrow get_keyboard_handler; 6968 6969 /// 6970 // Return the handler for browser life span events. 6971 /// 6972 extern(System) cef_life_span_handler_t* function ( 6973 cef_client_t* self) nothrow get_life_span_handler; 6974 6975 /// 6976 // Return the handler for browser load status events. 6977 /// 6978 extern(System) cef_load_handler_t* function (cef_client_t* self) nothrow get_load_handler; 6979 6980 /// 6981 // Return the handler for printing on Linux. If a print handler is not 6982 // provided then printing will not be supported on the Linux platform. 6983 /// 6984 extern(System) cef_print_handler_t* function (cef_client_t* self) nothrow get_print_handler; 6985 6986 /// 6987 // Return the handler for off-screen rendering events. 6988 /// 6989 extern(System) cef_render_handler_t* function (cef_client_t* self) nothrow get_render_handler; 6990 6991 /// 6992 // Return the handler for browser request events. 6993 /// 6994 extern(System) cef_request_handler_t* function (cef_client_t* self) nothrow get_request_handler; 6995 6996 /// 6997 // Called when a new message is received from a different process. Return true 6998 // (1) if the message was handled or false (0) otherwise. It is safe to keep 6999 // a reference to |message| outside of this callback. 7000 /// 7001 extern(System) int function ( 7002 cef_client_t* self, 7003 cef_browser_t* browser, 7004 cef_frame_t* frame, 7005 cef_process_id_t source_process, 7006 cef_process_message_t* message) nothrow on_process_message_received; 7007 } 7008 7009 7010 7011 // CEF_INCLUDE_CAPI_CEF_CLIENT_CAPI_H_ 7012 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 7013 // 7014 // Redistribution and use in source and binary forms, with or without 7015 // modification, are permitted provided that the following conditions are 7016 // met: 7017 // 7018 // * Redistributions of source code must retain the above copyright 7019 // notice, this list of conditions and the following disclaimer. 7020 // * Redistributions in binary form must reproduce the above 7021 // copyright notice, this list of conditions and the following disclaimer 7022 // in the documentation and/or other materials provided with the 7023 // distribution. 7024 // * Neither the name of Google Inc. nor the name Chromium Embedded 7025 // Framework nor the names of its contributors may be used to endorse 7026 // or promote products derived from this software without specific prior 7027 // written permission. 7028 // 7029 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 7030 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 7031 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 7032 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 7033 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 7034 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 7035 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 7036 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 7037 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 7038 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 7039 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 7040 // 7041 // --------------------------------------------------------------------------- 7042 // 7043 // This file was generated by the CEF translator tool and should not edited 7044 // by hand. See the translator.README.txt file in the tools directory for 7045 // more information. 7046 // 7047 // $hash=3ecebd6b30bb8fb837e062eacd021c1a1ff3620a$ 7048 // 7049 7050 extern (C): 7051 7052 /// 7053 // Structure used to create and/or parse command line arguments. Arguments with 7054 // '--', '-' and, on Windows, '/' prefixes are considered switches. Switches 7055 // will always precede any arguments without switch prefixes. Switches can 7056 // optionally have a value specified using the '=' delimiter (e.g. 7057 // "-switch=value"). An argument of "--" will terminate switch parsing with all 7058 // subsequent tokens, regardless of prefix, being interpreted as non-switch 7059 // arguments. Switch names should be lowercase ASCII and will be converted to 7060 // such if necessary. Switch values will retain the original case and UTF8 7061 // encoding. This structure can be used before cef_initialize() is called. 7062 /// 7063 struct cef_command_line_t 7064 { 7065 /// 7066 // Base structure. 7067 /// 7068 cef_base_ref_counted_t base; 7069 7070 /// 7071 // Returns true (1) if this object is valid. Do not call any other functions 7072 // if this function returns false (0). 7073 /// 7074 extern(System) int function (cef_command_line_t* self) nothrow is_valid; 7075 7076 /// 7077 // Returns true (1) if the values of this object are read-only. Some APIs may 7078 // expose read-only objects. 7079 /// 7080 extern(System) int function (cef_command_line_t* self) nothrow is_read_only; 7081 7082 /// 7083 // Returns a writable copy of this object. 7084 /// 7085 extern(System) cef_command_line_t* function (cef_command_line_t* self) nothrow copy; 7086 7087 /// 7088 // Initialize the command line with the specified |argc| and |argv| values. 7089 // The first argument must be the name of the program. This function is only 7090 // supported on non-Windows platforms. 7091 /// 7092 extern(System) void function ( 7093 cef_command_line_t* self, 7094 int argc, 7095 const(char*)* argv) nothrow init_from_argv; 7096 7097 /// 7098 // Initialize the command line with the string returned by calling 7099 // GetCommandLineW(). This function is only supported on Windows. 7100 /// 7101 extern(System) void function ( 7102 cef_command_line_t* self, 7103 const(cef_string_t)* command_line) nothrow init_from_string; 7104 7105 /// 7106 // Reset the command-line switches and arguments but leave the program 7107 // component unchanged. 7108 /// 7109 extern(System) void function (cef_command_line_t* self) nothrow reset; 7110 7111 /// 7112 // Retrieve the original command line string as a vector of strings. The argv 7113 // array: { program, [(--|-|/)switch[=value]]*, [--], [argument]* } 7114 /// 7115 extern(System) void function (cef_command_line_t* self, cef_string_list_t argv) nothrow get_argv; 7116 7117 /// 7118 // Constructs and returns the represented command line string. Use this 7119 // function cautiously because quoting behavior is unclear. 7120 /// 7121 // The resulting string must be freed by calling cef_string_userfree_free(). 7122 extern(System) cef_string_userfree_t function ( 7123 cef_command_line_t* self) nothrow get_command_line_string; 7124 7125 /// 7126 // Get the program part of the command line string (the first item). 7127 /// 7128 // The resulting string must be freed by calling cef_string_userfree_free(). 7129 extern(System) cef_string_userfree_t function (cef_command_line_t* self) nothrow get_program; 7130 7131 /// 7132 // Set the program part of the command line string (the first item). 7133 /// 7134 extern(System) void function ( 7135 cef_command_line_t* self, 7136 const(cef_string_t)* program) nothrow set_program; 7137 7138 /// 7139 // Returns true (1) if the command line has switches. 7140 /// 7141 extern(System) int function (cef_command_line_t* self) nothrow has_switches; 7142 7143 /// 7144 // Returns true (1) if the command line contains the given switch. 7145 /// 7146 extern(System) int function ( 7147 cef_command_line_t* self, 7148 const(cef_string_t)* name) nothrow has_switch; 7149 7150 /// 7151 // Returns the value associated with the given switch. If the switch has no 7152 // value or isn't present this function returns the NULL string. 7153 /// 7154 // The resulting string must be freed by calling cef_string_userfree_free(). 7155 extern(System) cef_string_userfree_t function ( 7156 cef_command_line_t* self, 7157 const(cef_string_t)* name) nothrow get_switch_value; 7158 7159 /// 7160 // Returns the map of switch names and values. If a switch has no value an 7161 // NULL string is returned. 7162 /// 7163 extern(System) void function ( 7164 cef_command_line_t* self, 7165 cef_string_map_t switches) nothrow get_switches; 7166 7167 /// 7168 // Add a switch to the end of the command line. If the switch has no value 7169 // pass an NULL value string. 7170 /// 7171 extern(System) void function ( 7172 cef_command_line_t* self, 7173 const(cef_string_t)* name) nothrow append_switch; 7174 7175 /// 7176 // Add a switch with the specified value to the end of the command line. 7177 /// 7178 extern(System) void function ( 7179 cef_command_line_t* self, 7180 const(cef_string_t)* name, 7181 const(cef_string_t)* value) nothrow append_switch_with_value; 7182 7183 /// 7184 // True if there are remaining command line arguments. 7185 /// 7186 extern(System) int function (cef_command_line_t* self) nothrow has_arguments; 7187 7188 /// 7189 // Get the remaining command line arguments. 7190 /// 7191 extern(System) void function ( 7192 cef_command_line_t* self, 7193 cef_string_list_t arguments) nothrow get_arguments; 7194 7195 /// 7196 // Add an argument to the end of the command line. 7197 /// 7198 extern(System) void function ( 7199 cef_command_line_t* self, 7200 const(cef_string_t)* argument) nothrow append_argument; 7201 7202 /// 7203 // Insert a command before the current command. Common for debuggers, like 7204 // "valgrind" or "gdb --args". 7205 /// 7206 extern(System) void function ( 7207 cef_command_line_t* self, 7208 const(cef_string_t)* wrapper) nothrow prepend_wrapper; 7209 } 7210 7211 7212 7213 /// 7214 // Create a new cef_command_line_t instance. 7215 /// 7216 cef_command_line_t* cef_command_line_create (); 7217 7218 /// 7219 // Returns the singleton global cef_command_line_t object. The returned object 7220 // will be read-only. 7221 /// 7222 cef_command_line_t* cef_command_line_get_global (); 7223 7224 // CEF_INCLUDE_CAPI_CEF_COMMAND_LINE_CAPI_H_ 7225 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 7226 // 7227 // Redistribution and use in source and binary forms, with or without 7228 // modification, are permitted provided that the following conditions are 7229 // met: 7230 // 7231 // * Redistributions of source code must retain the above copyright 7232 // notice, this list of conditions and the following disclaimer. 7233 // * Redistributions in binary form must reproduce the above 7234 // copyright notice, this list of conditions and the following disclaimer 7235 // in the documentation and/or other materials provided with the 7236 // distribution. 7237 // * Neither the name of Google Inc. nor the name Chromium Embedded 7238 // Framework nor the names of its contributors may be used to endorse 7239 // or promote products derived from this software without specific prior 7240 // written permission. 7241 // 7242 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 7243 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 7244 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 7245 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 7246 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 7247 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 7248 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 7249 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 7250 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 7251 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 7252 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 7253 // 7254 // --------------------------------------------------------------------------- 7255 // 7256 // This file was generated by the CEF translator tool and should not edited 7257 // by hand. See the translator.README.txt file in the tools directory for 7258 // more information. 7259 // 7260 // $hash=175779df75a1405fcc5c337a09e6322c556698ba$ 7261 // 7262 7263 extern (C): 7264 7265 /// 7266 // Callback structure used for continuation of custom context menu display. 7267 /// 7268 struct cef_run_context_menu_callback_t 7269 { 7270 /// 7271 // Base structure. 7272 /// 7273 cef_base_ref_counted_t base; 7274 7275 /// 7276 // Complete context menu display by selecting the specified |command_id| and 7277 // |event_flags|. 7278 /// 7279 extern(System) void function ( 7280 cef_run_context_menu_callback_t* self, 7281 int command_id, 7282 cef_event_flags_t event_flags) nothrow cont; 7283 7284 /// 7285 // Cancel context menu display. 7286 /// 7287 extern(System) void function (cef_run_context_menu_callback_t* self) nothrow cancel; 7288 } 7289 7290 7291 7292 /// 7293 // Implement this structure to handle context menu events. The functions of this 7294 // structure will be called on the UI thread. 7295 /// 7296 struct cef_context_menu_handler_t 7297 { 7298 /// 7299 // Base structure. 7300 /// 7301 cef_base_ref_counted_t base; 7302 7303 /// 7304 // Called before a context menu is displayed. |params| provides information 7305 // about the context menu state. |model| initially contains the default 7306 // context menu. The |model| can be cleared to show no context menu or 7307 // modified to show a custom menu. Do not keep references to |params| or 7308 // |model| outside of this callback. 7309 /// 7310 extern(System) void function ( 7311 cef_context_menu_handler_t* self, 7312 cef_browser_t* browser, 7313 cef_frame_t* frame, 7314 cef_context_menu_params_t* params, 7315 cef_menu_model_t* model) nothrow on_before_context_menu; 7316 7317 /// 7318 // Called to allow custom display of the context menu. |params| provides 7319 // information about the context menu state. |model| contains the context menu 7320 // model resulting from OnBeforeContextMenu. For custom display return true 7321 // (1) and execute |callback| either synchronously or asynchronously with the 7322 // selected command ID. For default display return false (0). Do not keep 7323 // references to |params| or |model| outside of this callback. 7324 /// 7325 extern(System) int function ( 7326 cef_context_menu_handler_t* self, 7327 cef_browser_t* browser, 7328 cef_frame_t* frame, 7329 cef_context_menu_params_t* params, 7330 cef_menu_model_t* model, 7331 cef_run_context_menu_callback_t* callback) nothrow run_context_menu; 7332 7333 /// 7334 // Called to execute a command selected from the context menu. Return true (1) 7335 // if the command was handled or false (0) for the default implementation. See 7336 // cef_menu_id_t for the command ids that have default implementations. All 7337 // user-defined command ids should be between MENU_ID_USER_FIRST and 7338 // MENU_ID_USER_LAST. |params| will have the same values as what was passed to 7339 // on_before_context_menu(). Do not keep a reference to |params| outside of 7340 // this callback. 7341 /// 7342 extern(System) int function ( 7343 cef_context_menu_handler_t* self, 7344 cef_browser_t* browser, 7345 cef_frame_t* frame, 7346 cef_context_menu_params_t* params, 7347 int command_id, 7348 cef_event_flags_t event_flags) nothrow on_context_menu_command; 7349 7350 /// 7351 // Called when the context menu is dismissed irregardless of whether the menu 7352 // was NULL or a command was selected. 7353 /// 7354 extern(System) void function ( 7355 cef_context_menu_handler_t* self, 7356 cef_browser_t* browser, 7357 cef_frame_t* frame) nothrow on_context_menu_dismissed; 7358 } 7359 7360 7361 7362 /// 7363 // Provides information about the context menu state. The ethods of this 7364 // structure can only be accessed on browser process the UI thread. 7365 /// 7366 struct cef_context_menu_params_t 7367 { 7368 /// 7369 // Base structure. 7370 /// 7371 cef_base_ref_counted_t base; 7372 7373 /// 7374 // Returns the X coordinate of the mouse where the context menu was invoked. 7375 // Coords are relative to the associated RenderView's origin. 7376 /// 7377 extern(System) int function (cef_context_menu_params_t* self) nothrow get_xcoord; 7378 7379 /// 7380 // Returns the Y coordinate of the mouse where the context menu was invoked. 7381 // Coords are relative to the associated RenderView's origin. 7382 /// 7383 extern(System) int function (cef_context_menu_params_t* self) nothrow get_ycoord; 7384 7385 /// 7386 // Returns flags representing the type of node that the context menu was 7387 // invoked on. 7388 /// 7389 extern(System) cef_context_menu_type_flags_t function ( 7390 cef_context_menu_params_t* self) nothrow get_type_flags; 7391 7392 /// 7393 // Returns the URL of the link, if any, that encloses the node that the 7394 // context menu was invoked on. 7395 /// 7396 // The resulting string must be freed by calling cef_string_userfree_free(). 7397 extern(System) cef_string_userfree_t function ( 7398 cef_context_menu_params_t* self) nothrow get_link_url; 7399 7400 /// 7401 // Returns the link URL, if any, to be used ONLY for "copy link address". We 7402 // don't validate this field in the frontend process. 7403 /// 7404 // The resulting string must be freed by calling cef_string_userfree_free(). 7405 extern(System) cef_string_userfree_t function ( 7406 cef_context_menu_params_t* self) nothrow get_unfiltered_link_url; 7407 7408 /// 7409 // Returns the source URL, if any, for the element that the context menu was 7410 // invoked on. Example of elements with source URLs are img, audio, and video. 7411 /// 7412 // The resulting string must be freed by calling cef_string_userfree_free(). 7413 extern(System) cef_string_userfree_t function ( 7414 cef_context_menu_params_t* self) nothrow get_source_url; 7415 7416 /// 7417 // Returns true (1) if the context menu was invoked on an image which has non- 7418 // NULL contents. 7419 /// 7420 extern(System) int function (cef_context_menu_params_t* self) nothrow has_image_contents; 7421 7422 /// 7423 // Returns the title text or the alt text if the context menu was invoked on 7424 // an image. 7425 /// 7426 // The resulting string must be freed by calling cef_string_userfree_free(). 7427 extern(System) cef_string_userfree_t function ( 7428 cef_context_menu_params_t* self) nothrow get_title_text; 7429 7430 /// 7431 // Returns the URL of the top level page that the context menu was invoked on. 7432 /// 7433 // The resulting string must be freed by calling cef_string_userfree_free(). 7434 extern(System) cef_string_userfree_t function ( 7435 cef_context_menu_params_t* self) nothrow get_page_url; 7436 7437 /// 7438 // Returns the URL of the subframe that the context menu was invoked on. 7439 /// 7440 // The resulting string must be freed by calling cef_string_userfree_free(). 7441 extern(System) cef_string_userfree_t function ( 7442 cef_context_menu_params_t* self) nothrow get_frame_url; 7443 7444 /// 7445 // Returns the character encoding of the subframe that the context menu was 7446 // invoked on. 7447 /// 7448 // The resulting string must be freed by calling cef_string_userfree_free(). 7449 extern(System) cef_string_userfree_t function ( 7450 cef_context_menu_params_t* self) nothrow get_frame_charset; 7451 7452 /// 7453 // Returns the type of context node that the context menu was invoked on. 7454 /// 7455 extern(System) cef_context_menu_media_type_t function ( 7456 cef_context_menu_params_t* self) nothrow get_media_type; 7457 7458 /// 7459 // Returns flags representing the actions supported by the media element, if 7460 // any, that the context menu was invoked on. 7461 /// 7462 extern(System) cef_context_menu_media_state_flags_t function ( 7463 cef_context_menu_params_t* self) nothrow get_media_state_flags; 7464 7465 /// 7466 // Returns the text of the selection, if any, that the context menu was 7467 // invoked on. 7468 /// 7469 // The resulting string must be freed by calling cef_string_userfree_free(). 7470 extern(System) cef_string_userfree_t function ( 7471 cef_context_menu_params_t* self) nothrow get_selection_text; 7472 7473 /// 7474 // Returns the text of the misspelled word, if any, that the context menu was 7475 // invoked on. 7476 /// 7477 // The resulting string must be freed by calling cef_string_userfree_free(). 7478 extern(System) cef_string_userfree_t function ( 7479 cef_context_menu_params_t* self) nothrow get_misspelled_word; 7480 7481 /// 7482 // Returns true (1) if suggestions exist, false (0) otherwise. Fills in 7483 // |suggestions| from the spell check service for the misspelled word if there 7484 // is one. 7485 /// 7486 extern(System) int function ( 7487 cef_context_menu_params_t* self, 7488 cef_string_list_t suggestions) nothrow get_dictionary_suggestions; 7489 7490 /// 7491 // Returns true (1) if the context menu was invoked on an editable node. 7492 /// 7493 extern(System) int function (cef_context_menu_params_t* self) nothrow is_editable; 7494 7495 /// 7496 // Returns true (1) if the context menu was invoked on an editable node where 7497 // spell-check is enabled. 7498 /// 7499 extern(System) int function (cef_context_menu_params_t* self) nothrow is_spell_check_enabled; 7500 7501 /// 7502 // Returns flags representing the actions supported by the editable node, if 7503 // any, that the context menu was invoked on. 7504 /// 7505 extern(System) cef_context_menu_edit_state_flags_t function ( 7506 cef_context_menu_params_t* self) nothrow get_edit_state_flags; 7507 7508 /// 7509 // Returns true (1) if the context menu contains items specified by the 7510 // renderer process (for example, plugin placeholder or pepper plugin menu 7511 // items). 7512 /// 7513 extern(System) int function (cef_context_menu_params_t* self) nothrow is_custom_menu; 7514 } 7515 7516 7517 7518 // CEF_INCLUDE_CAPI_CEF_CONTEXT_MENU_HANDLER_CAPI_H_ 7519 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 7520 // 7521 // Redistribution and use in source and binary forms, with or without 7522 // modification, are permitted provided that the following conditions are 7523 // met: 7524 // 7525 // * Redistributions of source code must retain the above copyright 7526 // notice, this list of conditions and the following disclaimer. 7527 // * Redistributions in binary form must reproduce the above 7528 // copyright notice, this list of conditions and the following disclaimer 7529 // in the documentation and/or other materials provided with the 7530 // distribution. 7531 // * Neither the name of Google Inc. nor the name Chromium Embedded 7532 // Framework nor the names of its contributors may be used to endorse 7533 // or promote products derived from this software without specific prior 7534 // written permission. 7535 // 7536 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 7537 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 7538 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 7539 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 7540 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 7541 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 7542 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 7543 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 7544 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 7545 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 7546 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 7547 // 7548 // --------------------------------------------------------------------------- 7549 // 7550 // This file was generated by the CEF translator tool and should not edited 7551 // by hand. See the translator.README.txt file in the tools directory for 7552 // more information. 7553 // 7554 // $hash=b19ef1c8a781f8d59276357609fe64370bb8a107$ 7555 // 7556 7557 extern (C): 7558 7559 /// 7560 // Structure used for managing cookies. The functions of this structure may be 7561 // called on any thread unless otherwise indicated. 7562 /// 7563 struct cef_cookie_manager_t 7564 { 7565 /// 7566 // Base structure. 7567 /// 7568 cef_base_ref_counted_t base; 7569 7570 /// 7571 // Visit all cookies on the UI thread. The returned cookies are ordered by 7572 // longest path, then by earliest creation date. Returns false (0) if cookies 7573 // cannot be accessed. 7574 /// 7575 extern(System) int function ( 7576 cef_cookie_manager_t* self, 7577 cef_cookie_visitor_t* visitor) nothrow visit_all_cookies; 7578 7579 /// 7580 // Visit a subset of cookies on the UI thread. The results are filtered by the 7581 // given url scheme, host, domain and path. If |includeHttpOnly| is true (1) 7582 // HTTP-only cookies will also be included in the results. The returned 7583 // cookies are ordered by longest path, then by earliest creation date. 7584 // Returns false (0) if cookies cannot be accessed. 7585 /// 7586 extern(System) int function ( 7587 cef_cookie_manager_t* self, 7588 const(cef_string_t)* url, 7589 int includeHttpOnly, 7590 cef_cookie_visitor_t* visitor) nothrow visit_url_cookies; 7591 7592 /// 7593 // Sets a cookie given a valid URL and explicit user-provided cookie 7594 // attributes. This function expects each attribute to be well-formed. It will 7595 // check for disallowed characters (e.g. the ';' character is disallowed 7596 // within the cookie value attribute) and fail without setting the cookie if 7597 // such characters are found. If |callback| is non-NULL it will be executed 7598 // asnychronously on the UI thread after the cookie has been set. Returns 7599 // false (0) if an invalid URL is specified or if cookies cannot be accessed. 7600 /// 7601 extern(System) int function ( 7602 cef_cookie_manager_t* self, 7603 const(cef_string_t)* url, 7604 const(cef_cookie_t)* cookie, 7605 cef_set_cookie_callback_t* callback) nothrow set_cookie; 7606 7607 /// 7608 // Delete all cookies that match the specified parameters. If both |url| and 7609 // |cookie_name| values are specified all host and domain cookies matching 7610 // both will be deleted. If only |url| is specified all host cookies (but not 7611 // domain cookies) irrespective of path will be deleted. If |url| is NULL all 7612 // cookies for all hosts and domains will be deleted. If |callback| is non- 7613 // NULL it will be executed asnychronously on the UI thread after the cookies 7614 // have been deleted. Returns false (0) if a non-NULL invalid URL is specified 7615 // or if cookies cannot be accessed. Cookies can alternately be deleted using 7616 // the Visit*Cookies() functions. 7617 /// 7618 extern(System) int function ( 7619 cef_cookie_manager_t* self, 7620 const(cef_string_t)* url, 7621 const(cef_string_t)* cookie_name, 7622 cef_delete_cookies_callback_t* callback) nothrow delete_cookies; 7623 7624 /// 7625 // Flush the backing store (if any) to disk. If |callback| is non-NULL it will 7626 // be executed asnychronously on the UI thread after the flush is complete. 7627 // Returns false (0) if cookies cannot be accessed. 7628 /// 7629 extern(System) int function ( 7630 cef_cookie_manager_t* self, 7631 cef_completion_callback_t* callback) nothrow flush_store; 7632 } 7633 7634 7635 7636 /// 7637 // Returns the global cookie manager. By default data will be stored at 7638 // CefSettings.cache_path if specified or in memory otherwise. If |callback| is 7639 // non-NULL it will be executed asnychronously on the UI thread after the 7640 // manager's storage has been initialized. Using this function is equivalent to 7641 // calling cef_request_context_t::cef_request_context_get_global_context()->GetD 7642 // efaultCookieManager(). 7643 /// 7644 cef_cookie_manager_t* cef_cookie_manager_get_global_manager ( 7645 cef_completion_callback_t* callback); 7646 7647 /// 7648 // Structure to implement for visiting cookie values. The functions of this 7649 // structure will always be called on the UI thread. 7650 /// 7651 struct cef_cookie_visitor_t 7652 { 7653 /// 7654 // Base structure. 7655 /// 7656 cef_base_ref_counted_t base; 7657 7658 /// 7659 // Method that will be called once for each cookie. |count| is the 0-based 7660 // index for the current cookie. |total| is the total number of cookies. Set 7661 // |deleteCookie| to true (1) to delete the cookie currently being visited. 7662 // Return false (0) to stop visiting cookies. This function may never be 7663 // called if no cookies are found. 7664 /// 7665 extern(System) int function ( 7666 cef_cookie_visitor_t* self, 7667 const(cef_cookie_t)* cookie, 7668 int count, 7669 int total, 7670 int* deleteCookie) nothrow visit; 7671 } 7672 7673 7674 7675 /// 7676 // Structure to implement to be notified of asynchronous completion via 7677 // cef_cookie_manager_t::set_cookie(). 7678 /// 7679 struct cef_set_cookie_callback_t 7680 { 7681 /// 7682 // Base structure. 7683 /// 7684 cef_base_ref_counted_t base; 7685 7686 /// 7687 // Method that will be called upon completion. |success| will be true (1) if 7688 // the cookie was set successfully. 7689 /// 7690 extern(System) void function (cef_set_cookie_callback_t* self, int success) nothrow on_complete; 7691 } 7692 7693 7694 7695 /// 7696 // Structure to implement to be notified of asynchronous completion via 7697 // cef_cookie_manager_t::delete_cookies(). 7698 /// 7699 struct cef_delete_cookies_callback_t 7700 { 7701 /// 7702 // Base structure. 7703 /// 7704 cef_base_ref_counted_t base; 7705 7706 /// 7707 // Method that will be called upon completion. |num_deleted| will be the 7708 // number of cookies that were deleted. 7709 /// 7710 extern(System) void function ( 7711 cef_delete_cookies_callback_t* self, 7712 int num_deleted) nothrow on_complete; 7713 } 7714 7715 7716 7717 // CEF_INCLUDE_CAPI_CEF_COOKIE_CAPI_H_ 7718 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 7719 // 7720 // Redistribution and use in source and binary forms, with or without 7721 // modification, are permitted provided that the following conditions are 7722 // met: 7723 // 7724 // * Redistributions of source code must retain the above copyright 7725 // notice, this list of conditions and the following disclaimer. 7726 // * Redistributions in binary form must reproduce the above 7727 // copyright notice, this list of conditions and the following disclaimer 7728 // in the documentation and/or other materials provided with the 7729 // distribution. 7730 // * Neither the name of Google Inc. nor the name Chromium Embedded 7731 // Framework nor the names of its contributors may be used to endorse 7732 // or promote products derived from this software without specific prior 7733 // written permission. 7734 // 7735 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 7736 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 7737 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 7738 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 7739 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 7740 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 7741 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 7742 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 7743 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 7744 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 7745 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 7746 // 7747 // --------------------------------------------------------------------------- 7748 // 7749 // This file was generated by the CEF translator tool and should not edited 7750 // by hand. See the translator.README.txt file in the tools directory for 7751 // more information. 7752 // 7753 // $hash=5e19231e3476eef376c2742e8d375bee7bd4ea2d$ 7754 // 7755 7756 extern (C): 7757 7758 /// 7759 // Crash reporting is configured using an INI-style config file named 7760 // "crash_reporter.cfg". On Windows and Linux this file must be placed next to 7761 // the main application executable. On macOS this file must be placed in the 7762 // top-level app bundle Resources directory (e.g. 7763 // "<appname>.app/Contents/Resources"). File contents are as follows: 7764 // 7765 // # Comments start with a hash character and must be on their own line. 7766 // 7767 // [Config] 7768 // ProductName=<Value of the "prod" crash key; defaults to "cef"> 7769 // ProductVersion=<Value of the "ver" crash key; defaults to the CEF version> 7770 // AppName=<Windows only; App-specific folder name component for storing crash 7771 // information; default to "CEF"> 7772 // ExternalHandler=<Windows only; Name of the external handler exe to use 7773 // instead of re-launching the main exe; default to empty> 7774 // BrowserCrashForwardingEnabled=<macOS only; True if browser process crashes 7775 // should be forwarded to the system crash 7776 // reporter; default to false> 7777 // ServerURL=<crash server URL; default to empty> 7778 // RateLimitEnabled=<True if uploads should be rate limited; default to true> 7779 // MaxUploadsPerDay=<Max uploads per 24 hours, used if rate limit is enabled; 7780 // default to 5> 7781 // MaxDatabaseSizeInMb=<Total crash report disk usage greater than this value 7782 // will cause older reports to be deleted; default to 20> 7783 // MaxDatabaseAgeInDays=<Crash reports older than this value will be deleted; 7784 // default to 5> 7785 // 7786 // [CrashKeys] 7787 // my_key1=<small|medium|large> 7788 // my_key2=<small|medium|large> 7789 // 7790 // Config section: 7791 // 7792 // If "ProductName" and/or "ProductVersion" are set then the specified values 7793 // will be included in the crash dump metadata. On macOS if these values are set 7794 // to NULL then they will be retrieved from the Info.plist file using the 7795 // "CFBundleName" and "CFBundleShortVersionString" keys respectively. 7796 // 7797 // If "AppName" is set on Windows then crash report information (metrics, 7798 // database and dumps) will be stored locally on disk under the 7799 // "C:\Users\[CurrentUser]\AppData\Local\[AppName]\User Data" folder. On other 7800 // platforms the CefSettings.user_data_path value will be used. 7801 // 7802 // If "ExternalHandler" is set on Windows then the specified exe will be 7803 // launched as the crashpad-handler instead of re-launching the main process 7804 // exe. The value can be an absolute path or a path relative to the main exe 7805 // directory. On Linux the CefSettings.browser_subprocess_path value will be 7806 // used. On macOS the existing subprocess app bundle will be used. 7807 // 7808 // If "BrowserCrashForwardingEnabled" is set to true (1) on macOS then browser 7809 // process crashes will be forwarded to the system crash reporter. This results 7810 // in the crash UI dialog being displayed to the user and crash reports being 7811 // logged under "~/Library/Logs/DiagnosticReports". Forwarding of crash reports 7812 // from non-browser processes and Debug builds is always disabled. 7813 // 7814 // If "ServerURL" is set then crashes will be uploaded as a multi-part POST 7815 // request to the specified URL. Otherwise, reports will only be stored locally 7816 // on disk. 7817 // 7818 // If "RateLimitEnabled" is set to true (1) then crash report uploads will be 7819 // rate limited as follows: 7820 // 1. If "MaxUploadsPerDay" is set to a positive value then at most the 7821 // specified number of crashes will be uploaded in each 24 hour period. 7822 // 2. If crash upload fails due to a network or server error then an 7823 // incremental backoff delay up to a maximum of 24 hours will be applied for 7824 // retries. 7825 // 3. If a backoff delay is applied and "MaxUploadsPerDay" is > 1 then the 7826 // "MaxUploadsPerDay" value will be reduced to 1 until the client is 7827 // restarted. This helps to avoid an upload flood when the network or 7828 // server error is resolved. 7829 // Rate limiting is not supported on Linux. 7830 // 7831 // If "MaxDatabaseSizeInMb" is set to a positive value then crash report storage 7832 // on disk will be limited to that size in megabytes. For example, on Windows 7833 // each dump is about 600KB so a "MaxDatabaseSizeInMb" value of 20 equates to 7834 // about 34 crash reports stored on disk. Not supported on Linux. 7835 // 7836 // If "MaxDatabaseAgeInDays" is set to a positive value then crash reports older 7837 // than the specified age in days will be deleted. Not supported on Linux. 7838 // 7839 // CrashKeys section: 7840 // 7841 // A maximum of 26 crash keys of each size can be specified for use by the 7842 // application. Crash key values will be truncated based on the specified size 7843 // (small = 64 bytes, medium = 256 bytes, large = 1024 bytes). The value of 7844 // crash keys can be set from any thread or process using the 7845 // CefSetCrashKeyValue function. These key/value pairs will be sent to the crash 7846 // server along with the crash dump file. 7847 /// 7848 int cef_crash_reporting_enabled (); 7849 7850 /// 7851 // Sets or clears a specific key-value pair from the crash metadata. 7852 /// 7853 void cef_set_crash_key_value ( 7854 const(cef_string_t)* key, 7855 const(cef_string_t)* value); 7856 7857 // CEF_INCLUDE_CAPI_CEF_CRASH_UTIL_CAPI_H_ 7858 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 7859 // 7860 // Redistribution and use in source and binary forms, with or without 7861 // modification, are permitted provided that the following conditions are 7862 // met: 7863 // 7864 // * Redistributions of source code must retain the above copyright 7865 // notice, this list of conditions and the following disclaimer. 7866 // * Redistributions in binary form must reproduce the above 7867 // copyright notice, this list of conditions and the following disclaimer 7868 // in the documentation and/or other materials provided with the 7869 // distribution. 7870 // * Neither the name of Google Inc. nor the name Chromium Embedded 7871 // Framework nor the names of its contributors may be used to endorse 7872 // or promote products derived from this software without specific prior 7873 // written permission. 7874 // 7875 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 7876 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 7877 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 7878 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 7879 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 7880 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 7881 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 7882 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 7883 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 7884 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 7885 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 7886 // 7887 // --------------------------------------------------------------------------- 7888 // 7889 // This file was generated by the CEF translator tool and should not edited 7890 // by hand. See the translator.README.txt file in the tools directory for 7891 // more information. 7892 // 7893 // $hash=1a256c04042ebd4867f39e1c31def558871b2bab$ 7894 // 7895 7896 extern (C): 7897 7898 7899 7900 /// 7901 // Callback structure for cef_browser_host_t::AddDevToolsMessageObserver. The 7902 // functions of this structure will be called on the browser process UI thread. 7903 /// 7904 struct cef_dev_tools_message_observer_t 7905 { 7906 /// 7907 // Base structure. 7908 /// 7909 cef_base_ref_counted_t base; 7910 7911 /// 7912 // Method that will be called on receipt of a DevTools protocol message. 7913 // |browser| is the originating browser instance. |message| is a UTF8-encoded 7914 // JSON dictionary representing either a function result or an event. 7915 // |message| is only valid for the scope of this callback and should be copied 7916 // if necessary. Return true (1) if the message was handled or false (0) if 7917 // the message should be further processed and passed to the 7918 // OnDevToolsMethodResult or OnDevToolsEvent functions as appropriate. 7919 // 7920 // Method result dictionaries include an "id" (int) value that identifies the 7921 // orginating function call sent from cef_browser_host_t::SendDevToolsMessage, 7922 // and optionally either a "result" (dictionary) or "error" (dictionary) 7923 // value. The "error" dictionary will contain "code" (int) and "message" 7924 // (string) values. Event dictionaries include a "function" (string) value and 7925 // optionally a "params" (dictionary) value. See the DevTools protocol 7926 // documentation at https://chromedevtools.github.io/devtools-protocol/ for 7927 // details of supported function calls and the expected "result" or "params" 7928 // dictionary contents. JSON dictionaries can be parsed using the CefParseJSON 7929 // function if desired, however be aware of performance considerations when 7930 // parsing large messages (some of which may exceed 1MB in size). 7931 /// 7932 extern(System) int function ( 7933 cef_dev_tools_message_observer_t* self, 7934 cef_browser_t* browser, 7935 const(void)* message, 7936 size_t message_size) nothrow on_dev_tools_message; 7937 7938 /// 7939 // Method that will be called after attempted execution of a DevTools protocol 7940 // function. |browser| is the originating browser instance. |message_id| is 7941 // the "id" value that identifies the originating function call message. If 7942 // the function succeeded |success| will be true (1) and |result| will be the 7943 // UTF8-encoded JSON "result" dictionary value (which may be NULL). If the 7944 // function failed |success| will be false (0) and |result| will be the 7945 // UTF8-encoded JSON "error" dictionary value. |result| is only valid for the 7946 // scope of this callback and should be copied if necessary. See the 7947 // OnDevToolsMessage documentation for additional details on |result| 7948 // contents. 7949 /// 7950 extern(System) void function ( 7951 cef_dev_tools_message_observer_t* self, 7952 cef_browser_t* browser, 7953 int message_id, 7954 int success, 7955 const(void)* result, 7956 size_t result_size) nothrow on_dev_tools_method_result; 7957 7958 /// 7959 // Method that will be called on receipt of a DevTools protocol event. 7960 // |browser| is the originating browser instance. |function| is the "function" 7961 // value. |params| is the UTF8-encoded JSON "params" dictionary value (which 7962 // may be NULL). |params| is only valid for the scope of this callback and 7963 // should be copied if necessary. See the OnDevToolsMessage documentation for 7964 // additional details on |params| contents. 7965 /// 7966 extern(System) void function ( 7967 cef_dev_tools_message_observer_t* self, 7968 cef_browser_t* browser, 7969 const(cef_string_t)* method, 7970 const(void)* params, 7971 size_t params_size) nothrow on_dev_tools_event; 7972 7973 /// 7974 // Method that will be called when the DevTools agent has attached. |browser| 7975 // is the originating browser instance. This will generally occur in response 7976 // to the first message sent while the agent is detached. 7977 /// 7978 extern(System) void function ( 7979 cef_dev_tools_message_observer_t* self, 7980 cef_browser_t* browser) nothrow on_dev_tools_agent_attached; 7981 7982 /// 7983 // Method that will be called when the DevTools agent has detached. |browser| 7984 // is the originating browser instance. Any function results that were pending 7985 // before the agent became detached will not be delivered, and any active 7986 // event subscriptions will be canceled. 7987 /// 7988 extern(System) void function ( 7989 cef_dev_tools_message_observer_t* self, 7990 cef_browser_t* browser) nothrow on_dev_tools_agent_detached; 7991 } 7992 7993 7994 7995 // CEF_INCLUDE_CAPI_CEF_DEVTOOLS_MESSAGE_OBSERVER_CAPI_H_ 7996 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 7997 // 7998 // Redistribution and use in source and binary forms, with or without 7999 // modification, are permitted provided that the following conditions are 8000 // met: 8001 // 8002 // * Redistributions of source code must retain the above copyright 8003 // notice, this list of conditions and the following disclaimer. 8004 // * Redistributions in binary form must reproduce the above 8005 // copyright notice, this list of conditions and the following disclaimer 8006 // in the documentation and/or other materials provided with the 8007 // distribution. 8008 // * Neither the name of Google Inc. nor the name Chromium Embedded 8009 // Framework nor the names of its contributors may be used to endorse 8010 // or promote products derived from this software without specific prior 8011 // written permission. 8012 // 8013 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 8014 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 8015 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 8016 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 8017 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 8018 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 8019 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 8020 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 8021 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 8022 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 8023 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 8024 // 8025 // --------------------------------------------------------------------------- 8026 // 8027 // This file was generated by the CEF translator tool and should not edited 8028 // by hand. See the translator.README.txt file in the tools directory for 8029 // more information. 8030 // 8031 // $hash=5ae5556e4085faf8cf17ee757f5eeac9197f75c0$ 8032 // 8033 8034 extern (C): 8035 8036 /// 8037 // Callback structure for asynchronous continuation of file dialog requests. 8038 /// 8039 struct cef_file_dialog_callback_t 8040 { 8041 /// 8042 // Base structure. 8043 /// 8044 cef_base_ref_counted_t base; 8045 8046 /// 8047 // Continue the file selection. |selected_accept_filter| should be the 0-based 8048 // index of the value selected from the accept filters array passed to 8049 // cef_dialog_handler_t::OnFileDialog. |file_paths| should be a single value 8050 // or a list of values depending on the dialog mode. An NULL |file_paths| 8051 // value is treated the same as calling cancel(). 8052 /// 8053 extern(System) void function ( 8054 cef_file_dialog_callback_t* self, 8055 int selected_accept_filter, 8056 cef_string_list_t file_paths) nothrow cont; 8057 8058 /// 8059 // Cancel the file selection. 8060 /// 8061 extern(System) void function (cef_file_dialog_callback_t* self) nothrow cancel; 8062 } 8063 8064 8065 8066 /// 8067 // Implement this structure to handle dialog events. The functions of this 8068 // structure will be called on the browser process UI thread. 8069 /// 8070 struct cef_dialog_handler_t 8071 { 8072 /// 8073 // Base structure. 8074 /// 8075 cef_base_ref_counted_t base; 8076 8077 /// 8078 // Called to run a file chooser dialog. |mode| represents the type of dialog 8079 // to display. |title| to the title to be used for the dialog and may be NULL 8080 // to show the default title ("Open" or "Save" depending on the mode). 8081 // |default_file_path| is the path with optional directory and/or file name 8082 // component that should be initially selected in the dialog. |accept_filters| 8083 // are used to restrict the selectable file types and may any combination of 8084 // (a) valid lower-cased MIME types (e.g. "text/*" or "image/*"), (b) 8085 // individual file extensions (e.g. ".txt" or ".png"), or (c) combined 8086 // description and file extension delimited using "|" and ";" (e.g. "Image 8087 // Types|.png;.gif;.jpg"). |selected_accept_filter| is the 0-based index of 8088 // the filter that should be selected by default. To display a custom dialog 8089 // return true (1) and execute |callback| either inline or at a later time. To 8090 // display the default dialog return false (0). 8091 /// 8092 extern(System) int function ( 8093 cef_dialog_handler_t* self, 8094 cef_browser_t* browser, 8095 cef_file_dialog_mode_t mode, 8096 const(cef_string_t)* title, 8097 const(cef_string_t)* default_file_path, 8098 cef_string_list_t accept_filters, 8099 int selected_accept_filter, 8100 cef_file_dialog_callback_t* callback) nothrow on_file_dialog; 8101 } 8102 8103 8104 8105 // CEF_INCLUDE_CAPI_CEF_DIALOG_HANDLER_CAPI_H_ 8106 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 8107 // 8108 // Redistribution and use in source and binary forms, with or without 8109 // modification, are permitted provided that the following conditions are 8110 // met: 8111 // 8112 // * Redistributions of source code must retain the above copyright 8113 // notice, this list of conditions and the following disclaimer. 8114 // * Redistributions in binary form must reproduce the above 8115 // copyright notice, this list of conditions and the following disclaimer 8116 // in the documentation and/or other materials provided with the 8117 // distribution. 8118 // * Neither the name of Google Inc. nor the name Chromium Embedded 8119 // Framework nor the names of its contributors may be used to endorse 8120 // or promote products derived from this software without specific prior 8121 // written permission. 8122 // 8123 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 8124 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 8125 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 8126 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 8127 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 8128 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 8129 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 8130 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 8131 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 8132 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 8133 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 8134 // 8135 // --------------------------------------------------------------------------- 8136 // 8137 // This file was generated by the CEF translator tool and should not edited 8138 // by hand. See the translator.README.txt file in the tools directory for 8139 // more information. 8140 // 8141 // $hash=067fd169a30bec1ad8eeacc5ab1ac750cf59640e$ 8142 // 8143 8144 import core.stdc.config; 8145 8146 extern (C): 8147 8148 /// 8149 // Implement this structure to handle events related to browser display state. 8150 // The functions of this structure will be called on the UI thread. 8151 /// 8152 struct cef_display_handler_t 8153 { 8154 /// 8155 // Base structure. 8156 /// 8157 cef_base_ref_counted_t base; 8158 8159 /// 8160 // Called when a frame's address has changed. 8161 /// 8162 extern(System) void function ( 8163 cef_display_handler_t* self, 8164 cef_browser_t* browser, 8165 cef_frame_t* frame, 8166 const(cef_string_t)* url) nothrow on_address_change; 8167 8168 /// 8169 // Called when the page title changes. 8170 /// 8171 extern(System) void function ( 8172 cef_display_handler_t* self, 8173 cef_browser_t* browser, 8174 const(cef_string_t)* title) nothrow on_title_change; 8175 8176 /// 8177 // Called when the page icon changes. 8178 /// 8179 extern(System) void function ( 8180 cef_display_handler_t* self, 8181 cef_browser_t* browser, 8182 cef_string_list_t icon_urls) nothrow on_favicon_urlchange; 8183 8184 /// 8185 // Called when web content in the page has toggled fullscreen mode. If 8186 // |fullscreen| is true (1) the content will automatically be sized to fill 8187 // the browser content area. If |fullscreen| is false (0) the content will 8188 // automatically return to its original size and position. The client is 8189 // responsible for resizing the browser if desired. 8190 /// 8191 extern(System) void function ( 8192 cef_display_handler_t* self, 8193 cef_browser_t* browser, 8194 int fullscreen) nothrow on_fullscreen_mode_change; 8195 8196 /// 8197 // Called when the browser is about to display a tooltip. |text| contains the 8198 // text that will be displayed in the tooltip. To handle the display of the 8199 // tooltip yourself return true (1). Otherwise, you can optionally modify 8200 // |text| and then return false (0) to allow the browser to display the 8201 // tooltip. When window rendering is disabled the application is responsible 8202 // for drawing tooltips and the return value is ignored. 8203 /// 8204 extern(System) int function ( 8205 cef_display_handler_t* self, 8206 cef_browser_t* browser, 8207 cef_string_t* text) nothrow on_tooltip; 8208 8209 /// 8210 // Called when the browser receives a status message. |value| contains the 8211 // text that will be displayed in the status message. 8212 /// 8213 extern(System) void function ( 8214 cef_display_handler_t* self, 8215 cef_browser_t* browser, 8216 const(cef_string_t)* value) nothrow on_status_message; 8217 8218 /// 8219 // Called to display a console message. Return true (1) to stop the message 8220 // from being output to the console. 8221 /// 8222 extern(System) int function ( 8223 cef_display_handler_t* self, 8224 cef_browser_t* browser, 8225 cef_log_severity_t level, 8226 const(cef_string_t)* message, 8227 const(cef_string_t)* source, 8228 int line) nothrow on_console_message; 8229 8230 /// 8231 // Called when auto-resize is enabled via 8232 // cef_browser_host_t::SetAutoResizeEnabled and the contents have auto- 8233 // resized. |new_size| will be the desired size in view coordinates. Return 8234 // true (1) if the resize was handled or false (0) for default handling. 8235 /// 8236 extern(System) int function ( 8237 cef_display_handler_t* self, 8238 cef_browser_t* browser, 8239 const(cef_size_t)* new_size) nothrow on_auto_resize; 8240 8241 /// 8242 // Called when the overall page loading progress has changed. |progress| 8243 // ranges from 0.0 to 1.0. 8244 /// 8245 extern(System) void function ( 8246 cef_display_handler_t* self, 8247 cef_browser_t* browser, 8248 double progress) nothrow on_loading_progress_change; 8249 8250 /// 8251 // Called when the browser's cursor has changed. If |type| is CT_CUSTOM then 8252 // |custom_cursor_info| will be populated with the custom cursor information. 8253 // Return true (1) if the cursor change was handled or false (0) for default 8254 // handling. 8255 /// 8256 extern(System) int function ( 8257 cef_display_handler_t* self, 8258 cef_browser_t* browser, 8259 c_ulong cursor, 8260 cef_cursor_type_t type, 8261 const(cef_cursor_info_t)* custom_cursor_info) nothrow on_cursor_change; 8262 } 8263 8264 8265 8266 // CEF_INCLUDE_CAPI_CEF_DISPLAY_HANDLER_CAPI_H_ 8267 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 8268 // 8269 // Redistribution and use in source and binary forms, with or without 8270 // modification, are permitted provided that the following conditions are 8271 // met: 8272 // 8273 // * Redistributions of source code must retain the above copyright 8274 // notice, this list of conditions and the following disclaimer. 8275 // * Redistributions in binary form must reproduce the above 8276 // copyright notice, this list of conditions and the following disclaimer 8277 // in the documentation and/or other materials provided with the 8278 // distribution. 8279 // * Neither the name of Google Inc. nor the name Chromium Embedded 8280 // Framework nor the names of its contributors may be used to endorse 8281 // or promote products derived from this software without specific prior 8282 // written permission. 8283 // 8284 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 8285 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 8286 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 8287 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 8288 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 8289 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 8290 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 8291 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 8292 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 8293 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 8294 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 8295 // 8296 // --------------------------------------------------------------------------- 8297 // 8298 // This file was generated by the CEF translator tool and should not edited 8299 // by hand. See the translator.README.txt file in the tools directory for 8300 // more information. 8301 // 8302 // $hash=0517dc6c42fdde9fecfc4549fab1ea12b614e143$ 8303 // 8304 8305 extern (C): 8306 8307 /// 8308 // Structure to implement for visiting the DOM. The functions of this structure 8309 // will be called on the render process main thread. 8310 /// 8311 struct cef_domvisitor_t 8312 { 8313 /// 8314 // Base structure. 8315 /// 8316 cef_base_ref_counted_t base; 8317 8318 /// 8319 // Method executed for visiting the DOM. The document object passed to this 8320 // function represents a snapshot of the DOM at the time this function is 8321 // executed. DOM objects are only valid for the scope of this function. Do not 8322 // keep references to or attempt to access any DOM objects outside the scope 8323 // of this function. 8324 /// 8325 extern(System) void function ( 8326 cef_domvisitor_t* self, 8327 cef_domdocument_t* document) nothrow visit; 8328 } 8329 8330 8331 8332 /// 8333 // Structure used to represent a DOM document. The functions of this structure 8334 // should only be called on the render process main thread thread. 8335 /// 8336 struct cef_domdocument_t 8337 { 8338 /// 8339 // Base structure. 8340 /// 8341 cef_base_ref_counted_t base; 8342 8343 /// 8344 // Returns the document type. 8345 /// 8346 extern(System) cef_dom_document_type_t function (cef_domdocument_t* self) nothrow get_type; 8347 8348 /// 8349 // Returns the root document node. 8350 /// 8351 extern(System) cef_domnode_t* function (cef_domdocument_t* self) nothrow get_document; 8352 8353 /// 8354 // Returns the BODY node of an HTML document. 8355 /// 8356 extern(System) cef_domnode_t* function (cef_domdocument_t* self) nothrow get_body; 8357 8358 /// 8359 // Returns the HEAD node of an HTML document. 8360 /// 8361 extern(System) cef_domnode_t* function (cef_domdocument_t* self) nothrow get_head; 8362 8363 /// 8364 // Returns the title of an HTML document. 8365 /// 8366 // The resulting string must be freed by calling cef_string_userfree_free(). 8367 extern(System) cef_string_userfree_t function (cef_domdocument_t* self) nothrow get_title; 8368 8369 /// 8370 // Returns the document element with the specified ID value. 8371 /// 8372 extern(System) cef_domnode_t* function ( 8373 cef_domdocument_t* self, 8374 const(cef_string_t)* id) nothrow get_element_by_id; 8375 8376 /// 8377 // Returns the node that currently has keyboard focus. 8378 /// 8379 extern(System) cef_domnode_t* function (cef_domdocument_t* self) nothrow get_focused_node; 8380 8381 /// 8382 // Returns true (1) if a portion of the document is selected. 8383 /// 8384 extern(System) int function (cef_domdocument_t* self) nothrow has_selection; 8385 8386 /// 8387 // Returns the selection offset within the start node. 8388 /// 8389 extern(System) int function (cef_domdocument_t* self) nothrow get_selection_start_offset; 8390 8391 /// 8392 // Returns the selection offset within the end node. 8393 /// 8394 extern(System) int function (cef_domdocument_t* self) nothrow get_selection_end_offset; 8395 8396 /// 8397 // Returns the contents of this selection as markup. 8398 /// 8399 // The resulting string must be freed by calling cef_string_userfree_free(). 8400 extern(System) cef_string_userfree_t function ( 8401 cef_domdocument_t* self) nothrow get_selection_as_markup; 8402 8403 /// 8404 // Returns the contents of this selection as text. 8405 /// 8406 // The resulting string must be freed by calling cef_string_userfree_free(). 8407 extern(System) cef_string_userfree_t function ( 8408 cef_domdocument_t* self) nothrow get_selection_as_text; 8409 8410 /// 8411 // Returns the base URL for the document. 8412 /// 8413 // The resulting string must be freed by calling cef_string_userfree_free(). 8414 extern(System) cef_string_userfree_t function (cef_domdocument_t* self) nothrow get_base_url; 8415 8416 /// 8417 // Returns a complete URL based on the document base URL and the specified 8418 // partial URL. 8419 /// 8420 // The resulting string must be freed by calling cef_string_userfree_free(). 8421 extern(System) cef_string_userfree_t function ( 8422 cef_domdocument_t* self, 8423 const(cef_string_t)* partialURL) nothrow get_complete_url; 8424 } 8425 8426 8427 8428 /// 8429 // Structure used to represent a DOM node. The functions of this structure 8430 // should only be called on the render process main thread. 8431 /// 8432 struct cef_domnode_t 8433 { 8434 /// 8435 // Base structure. 8436 /// 8437 cef_base_ref_counted_t base; 8438 8439 /// 8440 // Returns the type for this node. 8441 /// 8442 extern(System) cef_dom_node_type_t function (cef_domnode_t* self) nothrow get_type; 8443 8444 /// 8445 // Returns true (1) if this is a text node. 8446 /// 8447 extern(System) int function (cef_domnode_t* self) nothrow is_text; 8448 8449 /// 8450 // Returns true (1) if this is an element node. 8451 /// 8452 extern(System) int function (cef_domnode_t* self) nothrow is_element; 8453 8454 /// 8455 // Returns true (1) if this is an editable node. 8456 /// 8457 extern(System) int function (cef_domnode_t* self) nothrow is_editable; 8458 8459 /// 8460 // Returns true (1) if this is a form control element node. 8461 /// 8462 extern(System) int function (cef_domnode_t* self) nothrow is_form_control_element; 8463 8464 /// 8465 // Returns the type of this form control element node. 8466 /// 8467 // The resulting string must be freed by calling cef_string_userfree_free(). 8468 extern(System) cef_string_userfree_t function ( 8469 cef_domnode_t* self) nothrow get_form_control_element_type; 8470 8471 /// 8472 // Returns true (1) if this object is pointing to the same handle as |that| 8473 // object. 8474 /// 8475 extern(System) int function (cef_domnode_t* self, cef_domnode_t* that) nothrow is_same; 8476 8477 /// 8478 // Returns the name of this node. 8479 /// 8480 // The resulting string must be freed by calling cef_string_userfree_free(). 8481 extern(System) cef_string_userfree_t function (cef_domnode_t* self) nothrow get_name; 8482 8483 /// 8484 // Returns the value of this node. 8485 /// 8486 // The resulting string must be freed by calling cef_string_userfree_free(). 8487 extern(System) cef_string_userfree_t function (cef_domnode_t* self) nothrow get_value; 8488 8489 /// 8490 // Set the value of this node. Returns true (1) on success. 8491 /// 8492 extern(System) int function (cef_domnode_t* self, const(cef_string_t)* value) nothrow set_value; 8493 8494 /// 8495 // Returns the contents of this node as markup. 8496 /// 8497 // The resulting string must be freed by calling cef_string_userfree_free(). 8498 extern(System) cef_string_userfree_t function (cef_domnode_t* self) nothrow get_as_markup; 8499 8500 /// 8501 // Returns the document associated with this node. 8502 /// 8503 extern(System) cef_domdocument_t* function (cef_domnode_t* self) nothrow get_document; 8504 8505 /// 8506 // Returns the parent node. 8507 /// 8508 extern(System) cef_domnode_t* function (cef_domnode_t* self) nothrow get_parent; 8509 8510 /// 8511 // Returns the previous sibling node. 8512 /// 8513 extern(System) cef_domnode_t* function (cef_domnode_t* self) nothrow get_previous_sibling; 8514 8515 /// 8516 // Returns the next sibling node. 8517 /// 8518 extern(System) cef_domnode_t* function (cef_domnode_t* self) nothrow get_next_sibling; 8519 8520 /// 8521 // Returns true (1) if this node has child nodes. 8522 /// 8523 extern(System) int function (cef_domnode_t* self) nothrow has_children; 8524 8525 /// 8526 // Return the first child node. 8527 /// 8528 extern(System) cef_domnode_t* function (cef_domnode_t* self) nothrow get_first_child; 8529 8530 /// 8531 // Returns the last child node. 8532 /// 8533 extern(System) cef_domnode_t* function (cef_domnode_t* self) nothrow get_last_child; 8534 8535 // The following functions are valid only for element nodes. 8536 8537 /// 8538 // Returns the tag name of this element. 8539 /// 8540 // The resulting string must be freed by calling cef_string_userfree_free(). 8541 extern(System) cef_string_userfree_t function (cef_domnode_t* self) nothrow get_element_tag_name; 8542 8543 /// 8544 // Returns true (1) if this element has attributes. 8545 /// 8546 extern(System) int function (cef_domnode_t* self) nothrow has_element_attributes; 8547 8548 /// 8549 // Returns true (1) if this element has an attribute named |attrName|. 8550 /// 8551 extern(System) int function ( 8552 cef_domnode_t* self, 8553 const(cef_string_t)* attrName) nothrow has_element_attribute; 8554 8555 /// 8556 // Returns the element attribute named |attrName|. 8557 /// 8558 // The resulting string must be freed by calling cef_string_userfree_free(). 8559 extern(System) cef_string_userfree_t function ( 8560 cef_domnode_t* self, 8561 const(cef_string_t)* attrName) nothrow get_element_attribute; 8562 8563 /// 8564 // Returns a map of all element attributes. 8565 /// 8566 extern(System) void function ( 8567 cef_domnode_t* self, 8568 cef_string_map_t attrMap) nothrow get_element_attributes; 8569 8570 /// 8571 // Set the value for the element attribute named |attrName|. Returns true (1) 8572 // on success. 8573 /// 8574 extern(System) int function ( 8575 cef_domnode_t* self, 8576 const(cef_string_t)* attrName, 8577 const(cef_string_t)* value) nothrow set_element_attribute; 8578 8579 /// 8580 // Returns the inner text of the element. 8581 /// 8582 // The resulting string must be freed by calling cef_string_userfree_free(). 8583 extern(System) cef_string_userfree_t function ( 8584 cef_domnode_t* self) nothrow get_element_inner_text; 8585 8586 /// 8587 // Returns the bounds of the element. 8588 /// 8589 extern(System) cef_rect_t function (cef_domnode_t* self) nothrow get_element_bounds; 8590 } 8591 8592 8593 8594 // CEF_INCLUDE_CAPI_CEF_DOM_CAPI_H_ 8595 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 8596 // 8597 // Redistribution and use in source and binary forms, with or without 8598 // modification, are permitted provided that the following conditions are 8599 // met: 8600 // 8601 // * Redistributions of source code must retain the above copyright 8602 // notice, this list of conditions and the following disclaimer. 8603 // * Redistributions in binary form must reproduce the above 8604 // copyright notice, this list of conditions and the following disclaimer 8605 // in the documentation and/or other materials provided with the 8606 // distribution. 8607 // * Neither the name of Google Inc. nor the name Chromium Embedded 8608 // Framework nor the names of its contributors may be used to endorse 8609 // or promote products derived from this software without specific prior 8610 // written permission. 8611 // 8612 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 8613 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 8614 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 8615 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 8616 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 8617 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 8618 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 8619 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 8620 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 8621 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 8622 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 8623 // 8624 // --------------------------------------------------------------------------- 8625 // 8626 // This file was generated by the CEF translator tool and should not edited 8627 // by hand. See the translator.README.txt file in the tools directory for 8628 // more information. 8629 // 8630 // $hash=f0ceb73b289072a01c45c6e7abf339a4ec924d29$ 8631 // 8632 8633 extern (C): 8634 8635 /// 8636 // Callback structure used to asynchronously continue a download. 8637 /// 8638 struct cef_before_download_callback_t 8639 { 8640 /// 8641 // Base structure. 8642 /// 8643 cef_base_ref_counted_t base; 8644 8645 /// 8646 // Call to continue the download. Set |download_path| to the full file path 8647 // for the download including the file name or leave blank to use the 8648 // suggested name and the default temp directory. Set |show_dialog| to true 8649 // (1) if you do wish to show the default "Save As" dialog. 8650 /// 8651 extern(System) void function ( 8652 cef_before_download_callback_t* self, 8653 const(cef_string_t)* download_path, 8654 int show_dialog) nothrow cont; 8655 } 8656 8657 8658 8659 /// 8660 // Callback structure used to asynchronously cancel a download. 8661 /// 8662 struct cef_download_item_callback_t 8663 { 8664 /// 8665 // Base structure. 8666 /// 8667 cef_base_ref_counted_t base; 8668 8669 /// 8670 // Call to cancel the download. 8671 /// 8672 extern(System) void function (cef_download_item_callback_t* self) nothrow cancel; 8673 8674 /// 8675 // Call to pause the download. 8676 /// 8677 extern(System) void function (cef_download_item_callback_t* self) nothrow pause; 8678 8679 /// 8680 // Call to resume the download. 8681 /// 8682 extern(System) void function (cef_download_item_callback_t* self) nothrow resume; 8683 } 8684 8685 8686 8687 /// 8688 // Structure used to handle file downloads. The functions of this structure will 8689 // called on the browser process UI thread. 8690 /// 8691 struct cef_download_handler_t 8692 { 8693 /// 8694 // Base structure. 8695 /// 8696 cef_base_ref_counted_t base; 8697 8698 /// 8699 // Called before a download begins. |suggested_name| is the suggested name for 8700 // the download file. By default the download will be canceled. Execute 8701 // |callback| either asynchronously or in this function to continue the 8702 // download if desired. Do not keep a reference to |download_item| outside of 8703 // this function. 8704 /// 8705 extern(System) void function ( 8706 cef_download_handler_t* self, 8707 cef_browser_t* browser, 8708 cef_download_item_t* download_item, 8709 const(cef_string_t)* suggested_name, 8710 cef_before_download_callback_t* callback) nothrow on_before_download; 8711 8712 /// 8713 // Called when a download's status or progress information has been updated. 8714 // This may be called multiple times before and after on_before_download(). 8715 // Execute |callback| either asynchronously or in this function to cancel the 8716 // download if desired. Do not keep a reference to |download_item| outside of 8717 // this function. 8718 /// 8719 extern(System) void function ( 8720 cef_download_handler_t* self, 8721 cef_browser_t* browser, 8722 cef_download_item_t* download_item, 8723 cef_download_item_callback_t* callback) nothrow on_download_updated; 8724 } 8725 8726 8727 8728 // CEF_INCLUDE_CAPI_CEF_DOWNLOAD_HANDLER_CAPI_H_ 8729 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 8730 // 8731 // Redistribution and use in source and binary forms, with or without 8732 // modification, are permitted provided that the following conditions are 8733 // met: 8734 // 8735 // * Redistributions of source code must retain the above copyright 8736 // notice, this list of conditions and the following disclaimer. 8737 // * Redistributions in binary form must reproduce the above 8738 // copyright notice, this list of conditions and the following disclaimer 8739 // in the documentation and/or other materials provided with the 8740 // distribution. 8741 // * Neither the name of Google Inc. nor the name Chromium Embedded 8742 // Framework nor the names of its contributors may be used to endorse 8743 // or promote products derived from this software without specific prior 8744 // written permission. 8745 // 8746 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 8747 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 8748 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 8749 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 8750 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 8751 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 8752 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 8753 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 8754 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 8755 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 8756 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 8757 // 8758 // --------------------------------------------------------------------------- 8759 // 8760 // This file was generated by the CEF translator tool and should not edited 8761 // by hand. See the translator.README.txt file in the tools directory for 8762 // more information. 8763 // 8764 // $hash=d84044bb582b029af5fa46c75f35b3da948dffd2$ 8765 // 8766 8767 extern (C): 8768 8769 /// 8770 // Structure used to represent a download item. 8771 /// 8772 struct cef_download_item_t 8773 { 8774 /// 8775 // Base structure. 8776 /// 8777 cef_base_ref_counted_t base; 8778 8779 /// 8780 // Returns true (1) if this object is valid. Do not call any other functions 8781 // if this function returns false (0). 8782 /// 8783 extern(System) int function (cef_download_item_t* self) nothrow is_valid; 8784 8785 /// 8786 // Returns true (1) if the download is in progress. 8787 /// 8788 extern(System) int function (cef_download_item_t* self) nothrow is_in_progress; 8789 8790 /// 8791 // Returns true (1) if the download is complete. 8792 /// 8793 extern(System) int function (cef_download_item_t* self) nothrow is_complete; 8794 8795 /// 8796 // Returns true (1) if the download has been canceled or interrupted. 8797 /// 8798 extern(System) int function (cef_download_item_t* self) nothrow is_canceled; 8799 8800 /// 8801 // Returns a simple speed estimate in bytes/s. 8802 /// 8803 extern(System) int64 function (cef_download_item_t* self) nothrow get_current_speed; 8804 8805 /// 8806 // Returns the rough percent complete or -1 if the receive total size is 8807 // unknown. 8808 /// 8809 extern(System) int function (cef_download_item_t* self) nothrow get_percent_complete; 8810 8811 /// 8812 // Returns the total number of bytes. 8813 /// 8814 extern(System) int64 function (cef_download_item_t* self) nothrow get_total_bytes; 8815 8816 /// 8817 // Returns the number of received bytes. 8818 /// 8819 extern(System) int64 function (cef_download_item_t* self) nothrow get_received_bytes; 8820 8821 /// 8822 // Returns the time that the download started. 8823 /// 8824 extern(System) cef_time_t function (cef_download_item_t* self) nothrow get_start_time; 8825 8826 /// 8827 // Returns the time that the download ended. 8828 /// 8829 extern(System) cef_time_t function (cef_download_item_t* self) nothrow get_end_time; 8830 8831 /// 8832 // Returns the full path to the downloaded or downloading file. 8833 /// 8834 // The resulting string must be freed by calling cef_string_userfree_free(). 8835 extern(System) cef_string_userfree_t function (cef_download_item_t* self) nothrow get_full_path; 8836 8837 /// 8838 // Returns the unique identifier for this download. 8839 /// 8840 extern(System) uint32 function (cef_download_item_t* self) nothrow get_id; 8841 8842 /// 8843 // Returns the URL. 8844 /// 8845 // The resulting string must be freed by calling cef_string_userfree_free(). 8846 extern(System) cef_string_userfree_t function (cef_download_item_t* self) nothrow get_url; 8847 8848 /// 8849 // Returns the original URL before any redirections. 8850 /// 8851 // The resulting string must be freed by calling cef_string_userfree_free(). 8852 extern(System) cef_string_userfree_t function ( 8853 cef_download_item_t* self) nothrow get_original_url; 8854 8855 /// 8856 // Returns the suggested file name. 8857 /// 8858 // The resulting string must be freed by calling cef_string_userfree_free(). 8859 extern(System) cef_string_userfree_t function ( 8860 cef_download_item_t* self) nothrow get_suggested_file_name; 8861 8862 /// 8863 // Returns the content disposition. 8864 /// 8865 // The resulting string must be freed by calling cef_string_userfree_free(). 8866 extern(System) cef_string_userfree_t function ( 8867 cef_download_item_t* self) nothrow get_content_disposition; 8868 8869 /// 8870 // Returns the mime type. 8871 /// 8872 // The resulting string must be freed by calling cef_string_userfree_free(). 8873 extern(System) cef_string_userfree_t function (cef_download_item_t* self) nothrow get_mime_type; 8874 } 8875 8876 8877 8878 // CEF_INCLUDE_CAPI_CEF_DOWNLOAD_ITEM_CAPI_H_ 8879 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 8880 // 8881 // Redistribution and use in source and binary forms, with or without 8882 // modification, are permitted provided that the following conditions are 8883 // met: 8884 // 8885 // * Redistributions of source code must retain the above copyright 8886 // notice, this list of conditions and the following disclaimer. 8887 // * Redistributions in binary form must reproduce the above 8888 // copyright notice, this list of conditions and the following disclaimer 8889 // in the documentation and/or other materials provided with the 8890 // distribution. 8891 // * Neither the name of Google Inc. nor the name Chromium Embedded 8892 // Framework nor the names of its contributors may be used to endorse 8893 // or promote products derived from this software without specific prior 8894 // written permission. 8895 // 8896 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 8897 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 8898 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 8899 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 8900 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 8901 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 8902 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 8903 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 8904 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 8905 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 8906 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 8907 // 8908 // --------------------------------------------------------------------------- 8909 // 8910 // This file was generated by the CEF translator tool and should not edited 8911 // by hand. See the translator.README.txt file in the tools directory for 8912 // more information. 8913 // 8914 // $hash=9663321e2be1d000ac54e195c81f210ae40773d1$ 8915 // 8916 8917 extern (C): 8918 8919 /// 8920 // Structure used to represent drag data. The functions of this structure may be 8921 // called on any thread. 8922 /// 8923 struct cef_drag_data_t 8924 { 8925 /// 8926 // Base structure. 8927 /// 8928 cef_base_ref_counted_t base; 8929 8930 /// 8931 // Returns a copy of the current object. 8932 /// 8933 extern(System) cef_drag_data_t* function (cef_drag_data_t* self) nothrow clone; 8934 8935 /// 8936 // Returns true (1) if this object is read-only. 8937 /// 8938 extern(System) int function (cef_drag_data_t* self) nothrow is_read_only; 8939 8940 /// 8941 // Returns true (1) if the drag data is a link. 8942 /// 8943 extern(System) int function (cef_drag_data_t* self) nothrow is_link; 8944 8945 /// 8946 // Returns true (1) if the drag data is a text or html fragment. 8947 /// 8948 extern(System) int function (cef_drag_data_t* self) nothrow is_fragment; 8949 8950 /// 8951 // Returns true (1) if the drag data is a file. 8952 /// 8953 extern(System) int function (cef_drag_data_t* self) nothrow is_file; 8954 8955 /// 8956 // Return the link URL that is being dragged. 8957 /// 8958 // The resulting string must be freed by calling cef_string_userfree_free(). 8959 extern(System) cef_string_userfree_t function (cef_drag_data_t* self) nothrow get_link_url; 8960 8961 /// 8962 // Return the title associated with the link being dragged. 8963 /// 8964 // The resulting string must be freed by calling cef_string_userfree_free(). 8965 extern(System) cef_string_userfree_t function (cef_drag_data_t* self) nothrow get_link_title; 8966 8967 /// 8968 // Return the metadata, if any, associated with the link being dragged. 8969 /// 8970 // The resulting string must be freed by calling cef_string_userfree_free(). 8971 extern(System) cef_string_userfree_t function (cef_drag_data_t* self) nothrow get_link_metadata; 8972 8973 /// 8974 // Return the plain text fragment that is being dragged. 8975 /// 8976 // The resulting string must be freed by calling cef_string_userfree_free(). 8977 extern(System) cef_string_userfree_t function (cef_drag_data_t* self) nothrow get_fragment_text; 8978 8979 /// 8980 // Return the text/html fragment that is being dragged. 8981 /// 8982 // The resulting string must be freed by calling cef_string_userfree_free(). 8983 extern(System) cef_string_userfree_t function (cef_drag_data_t* self) nothrow get_fragment_html; 8984 8985 /// 8986 // Return the base URL that the fragment came from. This value is used for 8987 // resolving relative URLs and may be NULL. 8988 /// 8989 // The resulting string must be freed by calling cef_string_userfree_free(). 8990 extern(System) cef_string_userfree_t function ( 8991 cef_drag_data_t* self) nothrow get_fragment_base_url; 8992 8993 /// 8994 // Return the name of the file being dragged out of the browser window. 8995 /// 8996 // The resulting string must be freed by calling cef_string_userfree_free(). 8997 extern(System) cef_string_userfree_t function (cef_drag_data_t* self) nothrow get_file_name; 8998 8999 /// 9000 // Write the contents of the file being dragged out of the web view into 9001 // |writer|. Returns the number of bytes sent to |writer|. If |writer| is NULL 9002 // this function will return the size of the file contents in bytes. Call 9003 // get_file_name() to get a suggested name for the file. 9004 /// 9005 extern(System) size_t function ( 9006 cef_drag_data_t* self, 9007 cef_stream_writer_t* writer) nothrow get_file_contents; 9008 9009 /// 9010 // Retrieve the list of file names that are being dragged into the browser 9011 // window. 9012 /// 9013 extern(System) int function ( 9014 cef_drag_data_t* self, 9015 cef_string_list_t names) nothrow get_file_names; 9016 9017 /// 9018 // Set the link URL that is being dragged. 9019 /// 9020 extern(System) void function ( 9021 cef_drag_data_t* self, 9022 const(cef_string_t)* url) nothrow set_link_url; 9023 9024 /// 9025 // Set the title associated with the link being dragged. 9026 /// 9027 extern(System) void function ( 9028 cef_drag_data_t* self, 9029 const(cef_string_t)* title) nothrow set_link_title; 9030 9031 /// 9032 // Set the metadata associated with the link being dragged. 9033 /// 9034 extern(System) void function ( 9035 cef_drag_data_t* self, 9036 const(cef_string_t)* data) nothrow set_link_metadata; 9037 9038 /// 9039 // Set the plain text fragment that is being dragged. 9040 /// 9041 extern(System) void function ( 9042 cef_drag_data_t* self, 9043 const(cef_string_t)* text) nothrow set_fragment_text; 9044 9045 /// 9046 // Set the text/html fragment that is being dragged. 9047 /// 9048 extern(System) void function ( 9049 cef_drag_data_t* self, 9050 const(cef_string_t)* html) nothrow set_fragment_html; 9051 9052 /// 9053 // Set the base URL that the fragment came from. 9054 /// 9055 extern(System) void function ( 9056 cef_drag_data_t* self, 9057 const(cef_string_t)* base_url) nothrow set_fragment_base_url; 9058 9059 /// 9060 // Reset the file contents. You should do this before calling 9061 // cef_browser_host_t::DragTargetDragEnter as the web view does not allow us 9062 // to drag in this kind of data. 9063 /// 9064 extern(System) void function (cef_drag_data_t* self) nothrow reset_file_contents; 9065 9066 /// 9067 // Add a file that is being dragged into the webview. 9068 /// 9069 extern(System) void function ( 9070 cef_drag_data_t* self, 9071 const(cef_string_t)* path, 9072 const(cef_string_t)* display_name) nothrow add_file; 9073 9074 /// 9075 // Get the image representation of drag data. May return NULL if no image 9076 // representation is available. 9077 /// 9078 extern(System) cef_image_t* function (cef_drag_data_t* self) nothrow get_image; 9079 9080 /// 9081 // Get the image hotspot (drag start location relative to image dimensions). 9082 /// 9083 extern(System) cef_point_t function (cef_drag_data_t* self) nothrow get_image_hotspot; 9084 9085 /// 9086 // Returns true (1) if an image representation of drag data is available. 9087 /// 9088 extern(System) int function (cef_drag_data_t* self) nothrow has_image; 9089 } 9090 9091 9092 9093 /// 9094 // Create a new cef_drag_data_t object. 9095 /// 9096 cef_drag_data_t* cef_drag_data_create (); 9097 9098 // CEF_INCLUDE_CAPI_CEF_DRAG_DATA_CAPI_H_ 9099 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 9100 // 9101 // Redistribution and use in source and binary forms, with or without 9102 // modification, are permitted provided that the following conditions are 9103 // met: 9104 // 9105 // * Redistributions of source code must retain the above copyright 9106 // notice, this list of conditions and the following disclaimer. 9107 // * Redistributions in binary form must reproduce the above 9108 // copyright notice, this list of conditions and the following disclaimer 9109 // in the documentation and/or other materials provided with the 9110 // distribution. 9111 // * Neither the name of Google Inc. nor the name Chromium Embedded 9112 // Framework nor the names of its contributors may be used to endorse 9113 // or promote products derived from this software without specific prior 9114 // written permission. 9115 // 9116 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 9117 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 9118 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 9119 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 9120 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 9121 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 9122 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 9123 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 9124 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 9125 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 9126 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 9127 // 9128 // --------------------------------------------------------------------------- 9129 // 9130 // This file was generated by the CEF translator tool and should not edited 9131 // by hand. See the translator.README.txt file in the tools directory for 9132 // more information. 9133 // 9134 // $hash=1cc1f134e68406ae3b05f7e181e12f27262772f0$ 9135 // 9136 9137 extern (C): 9138 9139 /// 9140 // Implement this structure to handle events related to dragging. The functions 9141 // of this structure will be called on the UI thread. 9142 /// 9143 struct cef_drag_handler_t 9144 { 9145 /// 9146 // Base structure. 9147 /// 9148 cef_base_ref_counted_t base; 9149 9150 /// 9151 // Called when an external drag event enters the browser window. |dragData| 9152 // contains the drag event data and |mask| represents the type of drag 9153 // operation. Return false (0) for default drag handling behavior or true (1) 9154 // to cancel the drag event. 9155 /// 9156 extern(System) int function ( 9157 cef_drag_handler_t* self, 9158 cef_browser_t* browser, 9159 cef_drag_data_t* dragData, 9160 cef_drag_operations_mask_t mask) nothrow on_drag_enter; 9161 9162 /// 9163 // Called whenever draggable regions for the browser window change. These can 9164 // be specified using the '-webkit-app-region: drag/no-drag' CSS-property. If 9165 // draggable regions are never defined in a document this function will also 9166 // never be called. If the last draggable region is removed from a document 9167 // this function will be called with an NULL vector. 9168 /// 9169 extern(System) void function ( 9170 cef_drag_handler_t* self, 9171 cef_browser_t* browser, 9172 cef_frame_t* frame, 9173 size_t regionsCount, 9174 const(cef_draggable_region_t)* regions) nothrow on_draggable_regions_changed; 9175 } 9176 9177 9178 9179 // CEF_INCLUDE_CAPI_CEF_DRAG_HANDLER_CAPI_H_ 9180 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 9181 // 9182 // Redistribution and use in source and binary forms, with or without 9183 // modification, are permitted provided that the following conditions are 9184 // met: 9185 // 9186 // * Redistributions of source code must retain the above copyright 9187 // notice, this list of conditions and the following disclaimer. 9188 // * Redistributions in binary form must reproduce the above 9189 // copyright notice, this list of conditions and the following disclaimer 9190 // in the documentation and/or other materials provided with the 9191 // distribution. 9192 // * Neither the name of Google Inc. nor the name Chromium Embedded 9193 // Framework nor the names of its contributors may be used to endorse 9194 // or promote products derived from this software without specific prior 9195 // written permission. 9196 // 9197 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 9198 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 9199 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 9200 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 9201 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 9202 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 9203 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 9204 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 9205 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 9206 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 9207 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 9208 // 9209 // --------------------------------------------------------------------------- 9210 // 9211 // This file was generated by the CEF translator tool and should not edited 9212 // by hand. See the translator.README.txt file in the tools directory for 9213 // more information. 9214 // 9215 // $hash=5d5251098be1477705de2a21502dec2d8338ce00$ 9216 // 9217 9218 extern (C): 9219 9220 9221 9222 9223 /// 9224 // Object representing an extension. Methods may be called on any thread unless 9225 // otherwise indicated. 9226 /// 9227 struct cef_extension_t 9228 { 9229 /// 9230 // Base structure. 9231 /// 9232 cef_base_ref_counted_t base; 9233 9234 /// 9235 // Returns the unique extension identifier. This is calculated based on the 9236 // extension public key, if available, or on the extension path. See 9237 // https://developer.chrome.com/extensions/manifest/key for details. 9238 /// 9239 // The resulting string must be freed by calling cef_string_userfree_free(). 9240 extern(System) cef_string_userfree_t function (cef_extension_t* self) nothrow get_identifier; 9241 9242 /// 9243 // Returns the absolute path to the extension directory on disk. This value 9244 // will be prefixed with PK_DIR_RESOURCES if a relative path was passed to 9245 // cef_request_context_t::LoadExtension. 9246 /// 9247 // The resulting string must be freed by calling cef_string_userfree_free(). 9248 extern(System) cef_string_userfree_t function (cef_extension_t* self) nothrow get_path; 9249 9250 /// 9251 // Returns the extension manifest contents as a cef_dictionary_value_t object. 9252 // See https://developer.chrome.com/extensions/manifest for details. 9253 /// 9254 extern(System) cef_dictionary_value_t* function (cef_extension_t* self) nothrow get_manifest; 9255 9256 /// 9257 // Returns true (1) if this object is the same extension as |that| object. 9258 // Extensions are considered the same if identifier, path and loader context 9259 // match. 9260 /// 9261 extern(System) int function (cef_extension_t* self, cef_extension_t* that) nothrow is_same; 9262 9263 /// 9264 // Returns the handler for this extension. Will return NULL for internal 9265 // extensions or if no handler was passed to 9266 // cef_request_context_t::LoadExtension. 9267 /// 9268 extern(System) cef_extension_handler_t* function (cef_extension_t* self) nothrow get_handler; 9269 9270 /// 9271 // Returns the request context that loaded this extension. Will return NULL 9272 // for internal extensions or if the extension has been unloaded. See the 9273 // cef_request_context_t::LoadExtension documentation for more information 9274 // about loader contexts. Must be called on the browser process UI thread. 9275 /// 9276 extern(System) cef_request_context_t* function ( 9277 cef_extension_t* self) nothrow get_loader_context; 9278 9279 /// 9280 // Returns true (1) if this extension is currently loaded. Must be called on 9281 // the browser process UI thread. 9282 /// 9283 extern(System) int function (cef_extension_t* self) nothrow is_loaded; 9284 9285 /// 9286 // Unload this extension if it is not an internal extension and is currently 9287 // loaded. Will result in a call to 9288 // cef_extension_handler_t::OnExtensionUnloaded on success. 9289 /// 9290 extern(System) void function (cef_extension_t* self) nothrow unload; 9291 } 9292 9293 9294 9295 // CEF_INCLUDE_CAPI_CEF_EXTENSION_CAPI_H_ 9296 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 9297 // 9298 // Redistribution and use in source and binary forms, with or without 9299 // modification, are permitted provided that the following conditions are 9300 // met: 9301 // 9302 // * Redistributions of source code must retain the above copyright 9303 // notice, this list of conditions and the following disclaimer. 9304 // * Redistributions in binary form must reproduce the above 9305 // copyright notice, this list of conditions and the following disclaimer 9306 // in the documentation and/or other materials provided with the 9307 // distribution. 9308 // * Neither the name of Google Inc. nor the name Chromium Embedded 9309 // Framework nor the names of its contributors may be used to endorse 9310 // or promote products derived from this software without specific prior 9311 // written permission. 9312 // 9313 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 9314 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 9315 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 9316 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 9317 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 9318 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 9319 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 9320 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 9321 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 9322 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 9323 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 9324 // 9325 // --------------------------------------------------------------------------- 9326 // 9327 // This file was generated by the CEF translator tool and should not edited 9328 // by hand. See the translator.README.txt file in the tools directory for 9329 // more information. 9330 // 9331 // $hash=c952241dabb9d99109ebb64acba0124e43150628$ 9332 // 9333 9334 extern (C): 9335 9336 9337 9338 /// 9339 // Callback structure used for asynchronous continuation of 9340 // cef_extension_handler_t::GetExtensionResource. 9341 /// 9342 struct cef_get_extension_resource_callback_t 9343 { 9344 /// 9345 // Base structure. 9346 /// 9347 cef_base_ref_counted_t base; 9348 9349 /// 9350 // Continue the request. Read the resource contents from |stream|. 9351 /// 9352 extern(System) void function ( 9353 cef_get_extension_resource_callback_t* self, 9354 cef_stream_reader_t* stream) nothrow cont; 9355 9356 /// 9357 // Cancel the request. 9358 /// 9359 extern(System) void function (cef_get_extension_resource_callback_t* self) nothrow cancel; 9360 } 9361 9362 9363 9364 /// 9365 // Implement this structure to handle events related to browser extensions. The 9366 // functions of this structure will be called on the UI thread. See 9367 // cef_request_context_t::LoadExtension for information about extension loading. 9368 /// 9369 struct cef_extension_handler_t 9370 { 9371 /// 9372 // Base structure. 9373 /// 9374 cef_base_ref_counted_t base; 9375 9376 /// 9377 // Called if the cef_request_context_t::LoadExtension request fails. |result| 9378 // will be the error code. 9379 /// 9380 extern(System) void function ( 9381 cef_extension_handler_t* self, 9382 cef_errorcode_t result) nothrow on_extension_load_failed; 9383 9384 /// 9385 // Called if the cef_request_context_t::LoadExtension request succeeds. 9386 // |extension| is the loaded extension. 9387 /// 9388 extern(System) void function ( 9389 cef_extension_handler_t* self, 9390 cef_extension_t* extension) nothrow on_extension_loaded; 9391 9392 /// 9393 // Called after the cef_extension_t::Unload request has completed. 9394 /// 9395 extern(System) void function ( 9396 cef_extension_handler_t* self, 9397 cef_extension_t* extension) nothrow on_extension_unloaded; 9398 9399 /// 9400 // Called when an extension needs a browser to host a background script 9401 // specified via the "background" manifest key. The browser will have no 9402 // visible window and cannot be displayed. |extension| is the extension that 9403 // is loading the background script. |url| is an internally generated 9404 // reference to an HTML page that will be used to load the background script 9405 // via a <script> src attribute. To allow creation of the browser optionally 9406 // modify |client| and |settings| and return false (0). To cancel creation of 9407 // the browser (and consequently cancel load of the background script) return 9408 // true (1). Successful creation will be indicated by a call to 9409 // cef_life_span_handler_t::OnAfterCreated, and 9410 // cef_browser_host_t::IsBackgroundHost will return true (1) for the resulting 9411 // browser. See https://developer.chrome.com/extensions/event_pages for more 9412 // information about extension background script usage. 9413 /// 9414 extern(System) int function ( 9415 cef_extension_handler_t* self, 9416 cef_extension_t* extension, 9417 const(cef_string_t)* url, 9418 cef_client_t** client, 9419 cef_browser_settings_t* settings) nothrow on_before_background_browser; 9420 9421 /// 9422 // Called when an extension API (e.g. chrome.tabs.create) requests creation of 9423 // a new browser. |extension| and |browser| are the source of the API call. 9424 // |active_browser| may optionally be specified via the windowId property or 9425 // returned via the get_active_browser() callback and provides the default 9426 // |client| and |settings| values for the new browser. |index| is the position 9427 // value optionally specified via the index property. |url| is the URL that 9428 // will be loaded in the browser. |active| is true (1) if the new browser 9429 // should be active when opened. To allow creation of the browser optionally 9430 // modify |windowInfo|, |client| and |settings| and return false (0). To 9431 // cancel creation of the browser return true (1). Successful creation will be 9432 // indicated by a call to cef_life_span_handler_t::OnAfterCreated. Any 9433 // modifications to |windowInfo| will be ignored if |active_browser| is 9434 // wrapped in a cef_browser_view_t. 9435 /// 9436 extern(System) int function ( 9437 cef_extension_handler_t* self, 9438 cef_extension_t* extension, 9439 cef_browser_t* browser, 9440 cef_browser_t* active_browser, 9441 int index, 9442 const(cef_string_t)* url, 9443 int active, 9444 cef_window_info_t* windowInfo, 9445 cef_client_t** client, 9446 cef_browser_settings_t* settings) nothrow on_before_browser; 9447 9448 /// 9449 // Called when no tabId is specified to an extension API call that accepts a 9450 // tabId parameter (e.g. chrome.tabs.*). |extension| and |browser| are the 9451 // source of the API call. Return the browser that will be acted on by the API 9452 // call or return NULL to act on |browser|. The returned browser must share 9453 // the same cef_request_context_t as |browser|. Incognito browsers should not 9454 // be considered unless the source extension has incognito access enabled, in 9455 // which case |include_incognito| will be true (1). 9456 /// 9457 extern(System) cef_browser_t* function ( 9458 cef_extension_handler_t* self, 9459 cef_extension_t* extension, 9460 cef_browser_t* browser, 9461 int include_incognito) nothrow get_active_browser; 9462 9463 /// 9464 // Called when the tabId associated with |target_browser| is specified to an 9465 // extension API call that accepts a tabId parameter (e.g. chrome.tabs.*). 9466 // |extension| and |browser| are the source of the API call. Return true (1) 9467 // to allow access of false (0) to deny access. Access to incognito browsers 9468 // should not be allowed unless the source extension has incognito access 9469 // enabled, in which case |include_incognito| will be true (1). 9470 /// 9471 extern(System) int function ( 9472 cef_extension_handler_t* self, 9473 cef_extension_t* extension, 9474 cef_browser_t* browser, 9475 int include_incognito, 9476 cef_browser_t* target_browser) nothrow can_access_browser; 9477 9478 /// 9479 // Called to retrieve an extension resource that would normally be loaded from 9480 // disk (e.g. if a file parameter is specified to chrome.tabs.executeScript). 9481 // |extension| and |browser| are the source of the resource request. |file| is 9482 // the requested relative file path. To handle the resource request return 9483 // true (1) and execute |callback| either synchronously or asynchronously. For 9484 // the default behavior which reads the resource from the extension directory 9485 // on disk return false (0). Localization substitutions will not be applied to 9486 // resources handled via this function. 9487 /// 9488 extern(System) int function ( 9489 cef_extension_handler_t* self, 9490 cef_extension_t* extension, 9491 cef_browser_t* browser, 9492 const(cef_string_t)* file, 9493 cef_get_extension_resource_callback_t* callback) nothrow get_extension_resource; 9494 } 9495 9496 9497 9498 // CEF_INCLUDE_CAPI_CEF_EXTENSION_HANDLER_CAPI_H_ 9499 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 9500 // 9501 // Redistribution and use in source and binary forms, with or without 9502 // modification, are permitted provided that the following conditions are 9503 // met: 9504 // 9505 // * Redistributions of source code must retain the above copyright 9506 // notice, this list of conditions and the following disclaimer. 9507 // * Redistributions in binary form must reproduce the above 9508 // copyright notice, this list of conditions and the following disclaimer 9509 // in the documentation and/or other materials provided with the 9510 // distribution. 9511 // * Neither the name of Google Inc. nor the name Chromium Embedded 9512 // Framework nor the names of its contributors may be used to endorse 9513 // or promote products derived from this software without specific prior 9514 // written permission. 9515 // 9516 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 9517 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 9518 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 9519 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 9520 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 9521 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 9522 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 9523 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 9524 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 9525 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 9526 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 9527 // 9528 // --------------------------------------------------------------------------- 9529 // 9530 // This file was generated by the CEF translator tool and should not edited 9531 // by hand. See the translator.README.txt file in the tools directory for 9532 // more information. 9533 // 9534 // $hash=00d75d4f1968686cec7db84a59df89d98d8fe146$ 9535 // 9536 9537 extern (C): 9538 9539 /// 9540 // Creates a directory and all parent directories if they don't already exist. 9541 // Returns true (1) on successful creation or if the directory already exists. 9542 // The directory is only readable by the current user. Calling this function on 9543 // the browser process UI or IO threads is not allowed. 9544 /// 9545 int cef_create_directory (const(cef_string_t)* full_path); 9546 9547 /// 9548 // Get the temporary directory provided by the system. 9549 // 9550 // WARNING: In general, you should use the temp directory variants below instead 9551 // of this function. Those variants will ensure that the proper permissions are 9552 // set so that other users on the system can't edit them while they're open 9553 // (which could lead to security issues). 9554 /// 9555 int cef_get_temp_directory (cef_string_t* temp_dir); 9556 9557 /// 9558 // Creates a new directory. On Windows if |prefix| is provided the new directory 9559 // name is in the format of "prefixyyyy". Returns true (1) on success and sets 9560 // |new_temp_path| to the full path of the directory that was created. The 9561 // directory is only readable by the current user. Calling this function on the 9562 // browser process UI or IO threads is not allowed. 9563 /// 9564 int cef_create_new_temp_directory ( 9565 const(cef_string_t)* prefix, 9566 cef_string_t* new_temp_path); 9567 9568 /// 9569 // Creates a directory within another directory. Extra characters will be 9570 // appended to |prefix| to ensure that the new directory does not have the same 9571 // name as an existing directory. Returns true (1) on success and sets |new_dir| 9572 // to the full path of the directory that was created. The directory is only 9573 // readable by the current user. Calling this function on the browser process UI 9574 // or IO threads is not allowed. 9575 /// 9576 int cef_create_temp_directory_in_directory ( 9577 const(cef_string_t)* base_dir, 9578 const(cef_string_t)* prefix, 9579 cef_string_t* new_dir); 9580 9581 /// 9582 // Returns true (1) if the given path exists and is a directory. Calling this 9583 // function on the browser process UI or IO threads is not allowed. 9584 /// 9585 int cef_directory_exists (const(cef_string_t)* path); 9586 9587 /// 9588 // Deletes the given path whether it's a file or a directory. If |path| is a 9589 // directory all contents will be deleted. If |recursive| is true (1) any sub- 9590 // directories and their contents will also be deleted (equivalent to executing 9591 // "rm -rf", so use with caution). On POSIX environments if |path| is a symbolic 9592 // link then only the symlink will be deleted. Returns true (1) on successful 9593 // deletion or if |path| does not exist. Calling this function on the browser 9594 // process UI or IO threads is not allowed. 9595 /// 9596 int cef_delete_file (const(cef_string_t)* path, int recursive); 9597 9598 /// 9599 // Writes the contents of |src_dir| into a zip archive at |dest_file|. If 9600 // |include_hidden_files| is true (1) files starting with "." will be included. 9601 // Returns true (1) on success. Calling this function on the browser process UI 9602 // or IO threads is not allowed. 9603 /// 9604 int cef_zip_directory ( 9605 const(cef_string_t)* src_dir, 9606 const(cef_string_t)* dest_file, 9607 int include_hidden_files); 9608 9609 /// 9610 // Loads the existing "Certificate Revocation Lists" file that is managed by 9611 // Google Chrome. This file can generally be found in Chrome's User Data 9612 // directory (e.g. "C:\Users\[User]\AppData\Local\Google\Chrome\User Data\" on 9613 // Windows) and is updated periodically by Chrome's component updater service. 9614 // Must be called in the browser process after the context has been initialized. 9615 // See https://dev.chromium.org/Home/chromium-security/crlsets for background. 9616 /// 9617 void cef_load_crlsets_file (const(cef_string_t)* path); 9618 9619 // CEF_INCLUDE_CAPI_CEF_FILE_UTIL_CAPI_H_ 9620 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 9621 // 9622 // Redistribution and use in source and binary forms, with or without 9623 // modification, are permitted provided that the following conditions are 9624 // met: 9625 // 9626 // * Redistributions of source code must retain the above copyright 9627 // notice, this list of conditions and the following disclaimer. 9628 // * Redistributions in binary form must reproduce the above 9629 // copyright notice, this list of conditions and the following disclaimer 9630 // in the documentation and/or other materials provided with the 9631 // distribution. 9632 // * Neither the name of Google Inc. nor the name Chromium Embedded 9633 // Framework nor the names of its contributors may be used to endorse 9634 // or promote products derived from this software without specific prior 9635 // written permission. 9636 // 9637 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 9638 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 9639 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 9640 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 9641 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 9642 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 9643 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 9644 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 9645 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 9646 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 9647 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 9648 // 9649 // --------------------------------------------------------------------------- 9650 // 9651 // This file was generated by the CEF translator tool and should not edited 9652 // by hand. See the translator.README.txt file in the tools directory for 9653 // more information. 9654 // 9655 // $hash=03bb69a14868a95abf3bf7b1608dc351480e307f$ 9656 // 9657 9658 extern (C): 9659 9660 /// 9661 // Implement this structure to handle events related to find results. The 9662 // functions of this structure will be called on the UI thread. 9663 /// 9664 struct cef_find_handler_t 9665 { 9666 /// 9667 // Base structure. 9668 /// 9669 cef_base_ref_counted_t base; 9670 9671 /// 9672 // Called to report find results returned by cef_browser_host_t::find(). 9673 // |identifer| is the identifier passed to find(), |count| is the number of 9674 // matches currently identified, |selectionRect| is the location of where the 9675 // match was found (in window coordinates), |activeMatchOrdinal| is the 9676 // current position in the search results, and |finalUpdate| is true (1) if 9677 // this is the last find notification. 9678 /// 9679 extern(System) void function ( 9680 cef_find_handler_t* self, 9681 cef_browser_t* browser, 9682 int identifier, 9683 int count, 9684 const(cef_rect_t)* selectionRect, 9685 int activeMatchOrdinal, 9686 int finalUpdate) nothrow on_find_result; 9687 } 9688 9689 9690 9691 // CEF_INCLUDE_CAPI_CEF_FIND_HANDLER_CAPI_H_ 9692 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 9693 // 9694 // Redistribution and use in source and binary forms, with or without 9695 // modification, are permitted provided that the following conditions are 9696 // met: 9697 // 9698 // * Redistributions of source code must retain the above copyright 9699 // notice, this list of conditions and the following disclaimer. 9700 // * Redistributions in binary form must reproduce the above 9701 // copyright notice, this list of conditions and the following disclaimer 9702 // in the documentation and/or other materials provided with the 9703 // distribution. 9704 // * Neither the name of Google Inc. nor the name Chromium Embedded 9705 // Framework nor the names of its contributors may be used to endorse 9706 // or promote products derived from this software without specific prior 9707 // written permission. 9708 // 9709 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 9710 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 9711 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 9712 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 9713 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 9714 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 9715 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 9716 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 9717 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 9718 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 9719 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 9720 // 9721 // --------------------------------------------------------------------------- 9722 // 9723 // This file was generated by the CEF translator tool and should not edited 9724 // by hand. See the translator.README.txt file in the tools directory for 9725 // more information. 9726 // 9727 // $hash=0fccb41381e922e9d9545ae45ba3e6cf1916c4b0$ 9728 // 9729 9730 extern (C): 9731 9732 /// 9733 // Implement this structure to handle events related to focus. The functions of 9734 // this structure will be called on the UI thread. 9735 /// 9736 struct cef_focus_handler_t 9737 { 9738 /// 9739 // Base structure. 9740 /// 9741 cef_base_ref_counted_t base; 9742 9743 /// 9744 // Called when the browser component is about to loose focus. For instance, if 9745 // focus was on the last HTML element and the user pressed the TAB key. |next| 9746 // will be true (1) if the browser is giving focus to the next component and 9747 // false (0) if the browser is giving focus to the previous component. 9748 /// 9749 extern(System) void function ( 9750 cef_focus_handler_t* self, 9751 cef_browser_t* browser, 9752 int next) nothrow on_take_focus; 9753 9754 /// 9755 // Called when the browser component is requesting focus. |source| indicates 9756 // where the focus request is originating from. Return false (0) to allow the 9757 // focus to be set or true (1) to cancel setting the focus. 9758 /// 9759 extern(System) int function ( 9760 cef_focus_handler_t* self, 9761 cef_browser_t* browser, 9762 cef_focus_source_t source) nothrow on_set_focus; 9763 9764 /// 9765 // Called when the browser component has received focus. 9766 /// 9767 extern(System) void function ( 9768 cef_focus_handler_t* self, 9769 cef_browser_t* browser) nothrow on_got_focus; 9770 } 9771 9772 9773 9774 // CEF_INCLUDE_CAPI_CEF_FOCUS_HANDLER_CAPI_H_ 9775 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 9776 // 9777 // Redistribution and use in source and binary forms, with or without 9778 // modification, are permitted provided that the following conditions are 9779 // met: 9780 // 9781 // * Redistributions of source code must retain the above copyright 9782 // notice, this list of conditions and the following disclaimer. 9783 // * Redistributions in binary form must reproduce the above 9784 // copyright notice, this list of conditions and the following disclaimer 9785 // in the documentation and/or other materials provided with the 9786 // distribution. 9787 // * Neither the name of Google Inc. nor the name Chromium Embedded 9788 // Framework nor the names of its contributors may be used to endorse 9789 // or promote products derived from this software without specific prior 9790 // written permission. 9791 // 9792 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 9793 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 9794 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 9795 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 9796 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 9797 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 9798 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 9799 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 9800 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 9801 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 9802 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 9803 // 9804 // --------------------------------------------------------------------------- 9805 // 9806 // This file was generated by the CEF translator tool and should not edited 9807 // by hand. See the translator.README.txt file in the tools directory for 9808 // more information. 9809 // 9810 // $hash=872fd1e811d41f56f03da0da75a8f2e89cad40cd$ 9811 // 9812 9813 extern (C): 9814 9815 9816 9817 9818 9819 9820 /// 9821 // Structure used to represent a frame in the browser window. When used in the 9822 // browser process the functions of this structure may be called on any thread 9823 // unless otherwise indicated in the comments. When used in the render process 9824 // the functions of this structure may only be called on the main thread. 9825 /// 9826 struct cef_frame_t 9827 { 9828 /// 9829 // Base structure. 9830 /// 9831 cef_base_ref_counted_t base; 9832 9833 /// 9834 // True if this object is currently attached to a valid frame. 9835 /// 9836 extern(System) int function (cef_frame_t* self) nothrow is_valid; 9837 9838 /// 9839 // Execute undo in this frame. 9840 /// 9841 extern(System) void function (cef_frame_t* self) nothrow undo; 9842 9843 /// 9844 // Execute redo in this frame. 9845 /// 9846 extern(System) void function (cef_frame_t* self) nothrow redo; 9847 9848 /// 9849 // Execute cut in this frame. 9850 /// 9851 extern(System) void function (cef_frame_t* self) nothrow cut; 9852 9853 /// 9854 // Execute copy in this frame. 9855 /// 9856 extern(System) void function (cef_frame_t* self) nothrow copy; 9857 9858 /// 9859 // Execute paste in this frame. 9860 /// 9861 extern(System) void function (cef_frame_t* self) nothrow paste; 9862 9863 /// 9864 // Execute delete in this frame. 9865 /// 9866 extern(System) void function (cef_frame_t* self) nothrow del; 9867 9868 /// 9869 // Execute select all in this frame. 9870 /// 9871 extern(System) void function (cef_frame_t* self) nothrow select_all; 9872 9873 /// 9874 // Save this frame's HTML source to a temporary file and open it in the 9875 // default text viewing application. This function can only be called from the 9876 // browser process. 9877 /// 9878 extern(System) void function (cef_frame_t* self) nothrow view_source; 9879 9880 /// 9881 // Retrieve this frame's HTML source as a string sent to the specified 9882 // visitor. 9883 /// 9884 extern(System) void function ( 9885 cef_frame_t* self, 9886 cef_string_visitor_t* visitor) nothrow get_source; 9887 9888 /// 9889 // Retrieve this frame's display text as a string sent to the specified 9890 // visitor. 9891 /// 9892 extern(System) void function ( 9893 cef_frame_t* self, 9894 cef_string_visitor_t* visitor) nothrow get_text; 9895 9896 /// 9897 // Load the request represented by the |request| object. 9898 // 9899 // WARNING: This function will fail with "bad IPC message" reason 9900 // INVALID_INITIATOR_ORIGIN (213) unless you first navigate to the request 9901 // origin using some other mechanism (LoadURL, link click, etc). 9902 /// 9903 extern(System) void function (cef_frame_t* self, cef_request_t* request) nothrow load_request; 9904 9905 /// 9906 // Load the specified |url|. 9907 /// 9908 extern(System) void function (cef_frame_t* self, const(cef_string_t)* url) nothrow load_url; 9909 9910 /// 9911 // Execute a string of JavaScript code in this frame. The |script_url| 9912 // parameter is the URL where the script in question can be found, if any. The 9913 // renderer may request this URL to show the developer the source of the 9914 // error. The |start_line| parameter is the base line number to use for error 9915 // reporting. 9916 /// 9917 extern(System) void function ( 9918 cef_frame_t* self, 9919 const(cef_string_t)* code, 9920 const(cef_string_t)* script_url, 9921 int start_line) nothrow execute_java_script; 9922 9923 /// 9924 // Returns true (1) if this is the main (top-level) frame. 9925 /// 9926 extern(System) int function (cef_frame_t* self) nothrow is_main; 9927 9928 /// 9929 // Returns true (1) if this is the focused frame. 9930 /// 9931 extern(System) int function (cef_frame_t* self) nothrow is_focused; 9932 9933 /// 9934 // Returns the name for this frame. If the frame has an assigned name (for 9935 // example, set via the iframe "name" attribute) then that value will be 9936 // returned. Otherwise a unique name will be constructed based on the frame 9937 // parent hierarchy. The main (top-level) frame will always have an NULL name 9938 // value. 9939 /// 9940 // The resulting string must be freed by calling cef_string_userfree_free(). 9941 extern(System) cef_string_userfree_t function (cef_frame_t* self) nothrow get_name; 9942 9943 /// 9944 // Returns the globally unique identifier for this frame or < 0 if the 9945 // underlying frame does not yet exist. 9946 /// 9947 extern(System) int64 function (cef_frame_t* self) nothrow get_identifier; 9948 9949 /// 9950 // Returns the parent of this frame or NULL if this is the main (top-level) 9951 // frame. 9952 /// 9953 extern(System) cef_frame_t* function (cef_frame_t* self) nothrow get_parent; 9954 9955 /// 9956 // Returns the URL currently loaded in this frame. 9957 /// 9958 // The resulting string must be freed by calling cef_string_userfree_free(). 9959 extern(System) cef_string_userfree_t function (cef_frame_t* self) nothrow get_url; 9960 9961 /// 9962 // Returns the browser that this frame belongs to. 9963 /// 9964 extern(System) cef_browser_t* function (cef_frame_t* self) nothrow get_browser; 9965 9966 /// 9967 // Get the V8 context associated with the frame. This function can only be 9968 // called from the render process. 9969 /// 9970 extern(System) cef_v8context_t* function (cef_frame_t* self) nothrow get_v8context; 9971 9972 /// 9973 // Visit the DOM document. This function can only be called from the render 9974 // process. 9975 /// 9976 extern(System) void function (cef_frame_t* self, cef_domvisitor_t* visitor) nothrow visit_dom; 9977 9978 /// 9979 // Create a new URL request that will be treated as originating from this 9980 // frame and the associated browser. This request may be intercepted by the 9981 // client via cef_resource_request_handler_t or cef_scheme_handler_factory_t. 9982 // Use cef_urlrequest_t::Create instead if you do not want the request to have 9983 // this association, in which case it may be handled differently (see 9984 // documentation on that function). Requests may originate from both the 9985 // browser process and the render process. 9986 // 9987 // For requests originating from the browser process: 9988 // - POST data may only contain a single element of type PDE_TYPE_FILE or 9989 // PDE_TYPE_BYTES. 9990 // For requests originating from the render process: 9991 // - POST data may only contain a single element of type PDE_TYPE_BYTES. 9992 // - If the response contains Content-Disposition or Mime-Type header values 9993 // that would not normally be rendered then the response may receive 9994 // special handling inside the browser (for example, via the file download 9995 // code path instead of the URL request code path). 9996 // 9997 // The |request| object will be marked as read-only after calling this 9998 // function. 9999 /// 10000 extern(System) cef_urlrequest_t* function ( 10001 cef_frame_t* self, 10002 cef_request_t* request, 10003 cef_urlrequest_client_t* client) nothrow create_urlrequest; 10004 10005 /// 10006 // Send a message to the specified |target_process|. Ownership of the message 10007 // contents will be transferred and the |message| reference will be 10008 // invalidated. Message delivery is not guaranteed in all cases (for example, 10009 // if the browser is closing, navigating, or if the target process crashes). 10010 // Send an ACK message back from the target process if confirmation is 10011 // required. 10012 /// 10013 extern(System) void function ( 10014 cef_frame_t* self, 10015 cef_process_id_t target_process, 10016 cef_process_message_t* message) nothrow send_process_message; 10017 } 10018 10019 10020 10021 // CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_ 10022 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 10023 // 10024 // Redistribution and use in source and binary forms, with or without 10025 // modification, are permitted provided that the following conditions are 10026 // met: 10027 // 10028 // * Redistributions of source code must retain the above copyright 10029 // notice, this list of conditions and the following disclaimer. 10030 // * Redistributions in binary form must reproduce the above 10031 // copyright notice, this list of conditions and the following disclaimer 10032 // in the documentation and/or other materials provided with the 10033 // distribution. 10034 // * Neither the name of Google Inc. nor the name Chromium Embedded 10035 // Framework nor the names of its contributors may be used to endorse 10036 // or promote products derived from this software without specific prior 10037 // written permission. 10038 // 10039 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 10040 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 10041 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 10042 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 10043 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 10044 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 10045 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 10046 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 10047 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 10048 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 10049 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 10050 // 10051 // --------------------------------------------------------------------------- 10052 // 10053 // This file was generated by the CEF translator tool and should not edited 10054 // by hand. See the translator.README.txt file in the tools directory for 10055 // more information. 10056 // 10057 // $hash=f6be5f7509ee3ccfe16f226470897223cc131014$ 10058 // 10059 10060 extern (C): 10061 10062 /// 10063 // Implement this structure to handle events related to cef_frame_t life span. 10064 // The order of callbacks is: 10065 // 10066 // (1) During initial cef_browser_host_t creation and navigation of the main 10067 // frame: - cef_frame_handler_t::OnFrameCreated => The initial main frame object 10068 // has been 10069 // created. Any commands will be queued until the frame is attached. 10070 // - cef_frame_handler_t::OnMainFrameChanged => The initial main frame object 10071 // has 10072 // been assigned to the browser. 10073 // - cef_life_span_handler_t::OnAfterCreated => The browser is now valid and can 10074 // be 10075 // used. 10076 // - cef_frame_handler_t::OnFrameAttached => The initial main frame object is 10077 // now 10078 // connected to its peer in the renderer process. Commands can be routed. 10079 // 10080 // (2) During further cef_browser_host_t navigation/loading of the main frame 10081 // and/or sub-frames: - cef_frame_handler_t::OnFrameCreated => A new main frame 10082 // or sub-frame object has 10083 // been created. Any commands will be queued until the frame is attached. 10084 // - cef_frame_handler_t::OnFrameAttached => A new main frame or sub-frame 10085 // object is 10086 // now connected to its peer in the renderer process. Commands can be routed. 10087 // - cef_frame_handler_t::OnFrameDetached => An existing main frame or sub-frame 10088 // object has lost its connection to the renderer process. If multiple objects 10089 // are detached at the same time then notifications will be sent for any 10090 // sub-frame objects before the main frame object. Commands can no longer be 10091 // routed and will be discarded. 10092 // - cef_frame_handler_t::OnMainFrameChanged => A new main frame object has been 10093 // assigned to the browser. This will only occur with cross-origin navigation 10094 // or re-navigation after renderer process termination (due to crashes, etc). 10095 // 10096 // (3) During final cef_browser_host_t destruction of the main frame: - 10097 // cef_frame_handler_t::OnFrameDetached => Any sub-frame objects have lost their 10098 // connection to the renderer process. Commands can no longer be routed and 10099 // will be discarded. 10100 // - cef_life_span_handler_t::OnBeforeClose => The browser has been destroyed. - 10101 // cef_frame_handler_t::OnFrameDetached => The main frame object have lost its 10102 // connection to the renderer process. Notifications will be sent for any 10103 // sub-frame objects before the main frame object. Commands can no longer be 10104 // routed and will be discarded. 10105 // - cef_frame_handler_t::OnMainFrameChanged => The final main frame object has 10106 // been 10107 // removed from the browser. 10108 // 10109 // Cross-origin navigation and/or loading receives special handling. 10110 // 10111 // When the main frame navigates to a different origin the OnMainFrameChanged 10112 // callback (2) will be executed with the old and new main frame objects. 10113 // 10114 // When a new sub-frame is loaded in, or an existing sub-frame is navigated to, 10115 // a different origin from the parent frame, a temporary sub-frame object will 10116 // first be created in the parent's renderer process. That temporary sub-frame 10117 // will then be discarded after the real cross-origin sub-frame is created in 10118 // the new/target renderer process. The client will receive cross-origin 10119 // navigation callbacks (2) for the transition from the temporary sub-frame to 10120 // the real sub-frame. The temporary sub-frame will not recieve or execute 10121 // commands during this transitional period (any sent commands will be 10122 // discarded). 10123 // 10124 // When a new popup browser is created in a different origin from the parent 10125 // browser, a temporary main frame object for the popup will first be created in 10126 // the parent's renderer process. That temporary main frame will then be 10127 // discarded after the real cross-origin main frame is created in the new/target 10128 // renderer process. The client will recieve creation and initial navigation 10129 // callbacks (1) for the temporary main frame, followed by cross-origin 10130 // navigation callbacks (2) for the transition from the temporary main frame to 10131 // the real main frame. The temporary main frame may receive and execute 10132 // commands during this transitional period (any sent commands may be executed, 10133 // but the behavior is potentially undesirable since they execute in the parent 10134 // browser's renderer process and not the new/target renderer process). 10135 // 10136 // Callbacks will not be executed for placeholders that may be created during 10137 // pre-commit navigation for sub-frames that do not yet exist in the renderer 10138 // process. Placeholders will have cef_frame_t::get_identifier() == -4. 10139 // 10140 // The functions of this structure will be called on the UI thread unless 10141 // otherwise indicated. 10142 /// 10143 struct cef_frame_handler_t 10144 { 10145 /// 10146 // Base structure. 10147 /// 10148 cef_base_ref_counted_t base; 10149 10150 /// 10151 // Called when a new frame is created. This will be the first notification 10152 // that references |frame|. Any commands that require transport to the 10153 // associated renderer process (LoadRequest, SendProcessMessage, GetSource, 10154 // etc.) will be queued until OnFrameAttached is called for |frame|. 10155 /// 10156 extern(System) void function ( 10157 cef_frame_handler_t* self, 10158 cef_browser_t* browser, 10159 cef_frame_t* frame) nothrow on_frame_created; 10160 10161 /// 10162 // Called when a frame can begin routing commands to/from the associated 10163 // renderer process. |reattached| will be true (1) if the frame was re- 10164 // attached after exiting the BackForwardCache. Any commands that were queued 10165 // have now been dispatched. 10166 /// 10167 extern(System) void function ( 10168 cef_frame_handler_t* self, 10169 cef_browser_t* browser, 10170 cef_frame_t* frame, 10171 int reattached) nothrow on_frame_attached; 10172 10173 /// 10174 // Called when a frame loses its connection to the renderer process and will 10175 // be destroyed. Any pending or future commands will be discarded and 10176 // cef_frame_t::is_valid() will now return false (0) for |frame|. If called 10177 // after cef_life_span_handler_t::on_before_close() during browser destruction 10178 // then cef_browser_t::is_valid() will return false (0) for |browser|. 10179 /// 10180 extern(System) void function ( 10181 cef_frame_handler_t* self, 10182 cef_browser_t* browser, 10183 cef_frame_t* frame) nothrow on_frame_detached; 10184 10185 /// 10186 // Called when the main frame changes due to (a) initial browser creation, (b) 10187 // final browser destruction, (c) cross-origin navigation or (d) re-navigation 10188 // after renderer process termination (due to crashes, etc). |old_frame| will 10189 // be NULL and |new_frame| will be non-NULL when a main frame is assigned to 10190 // |browser| for the first time. |old_frame| will be non-NULL and |new_frame| 10191 // will be NULL and when a main frame is removed from |browser| for the last 10192 // time. Both |old_frame| and |new_frame| will be non-NULL for cross-origin 10193 // navigations or re-navigation after renderer process termination. This 10194 // function will be called after on_frame_created() for |new_frame| and/or 10195 // after on_frame_detached() for |old_frame|. If called after 10196 // cef_life_span_handler_t::on_before_close() during browser destruction then 10197 // cef_browser_t::is_valid() will return false (0) for |browser|. 10198 /// 10199 extern(System) void function ( 10200 cef_frame_handler_t* self, 10201 cef_browser_t* browser, 10202 cef_frame_t* old_frame, 10203 cef_frame_t* new_frame) nothrow on_main_frame_changed; 10204 } 10205 10206 10207 10208 // CEF_INCLUDE_CAPI_CEF_FRAME_HANDLER_CAPI_H_ 10209 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 10210 // 10211 // Redistribution and use in source and binary forms, with or without 10212 // modification, are permitted provided that the following conditions are 10213 // met: 10214 // 10215 // * Redistributions of source code must retain the above copyright 10216 // notice, this list of conditions and the following disclaimer. 10217 // * Redistributions in binary form must reproduce the above 10218 // copyright notice, this list of conditions and the following disclaimer 10219 // in the documentation and/or other materials provided with the 10220 // distribution. 10221 // * Neither the name of Google Inc. nor the name Chromium Embedded 10222 // Framework nor the names of its contributors may be used to endorse 10223 // or promote products derived from this software without specific prior 10224 // written permission. 10225 // 10226 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 10227 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 10228 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 10229 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 10230 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 10231 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 10232 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 10233 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 10234 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 10235 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 10236 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 10237 // 10238 // --------------------------------------------------------------------------- 10239 // 10240 // This file was generated by the CEF translator tool and should not edited 10241 // by hand. See the translator.README.txt file in the tools directory for 10242 // more information. 10243 // 10244 // $hash=bf890f7b8e8edd423d71ad5a4d5bd43d81f1eb01$ 10245 // 10246 10247 extern (C): 10248 10249 /// 10250 // Returns true (1) if the application text direction is right-to-left. 10251 /// 10252 int cef_is_rtl (); 10253 10254 // CEF_INCLUDE_CAPI_CEF_I18N_UTIL_CAPI_H_ 10255 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 10256 // 10257 // Redistribution and use in source and binary forms, with or without 10258 // modification, are permitted provided that the following conditions are 10259 // met: 10260 // 10261 // * Redistributions of source code must retain the above copyright 10262 // notice, this list of conditions and the following disclaimer. 10263 // * Redistributions in binary form must reproduce the above 10264 // copyright notice, this list of conditions and the following disclaimer 10265 // in the documentation and/or other materials provided with the 10266 // distribution. 10267 // * Neither the name of Google Inc. nor the name Chromium Embedded 10268 // Framework nor the names of its contributors may be used to endorse 10269 // or promote products derived from this software without specific prior 10270 // written permission. 10271 // 10272 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 10273 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 10274 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 10275 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 10276 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 10277 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 10278 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 10279 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 10280 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 10281 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 10282 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 10283 // 10284 // --------------------------------------------------------------------------- 10285 // 10286 // This file was generated by the CEF translator tool and should not edited 10287 // by hand. See the translator.README.txt file in the tools directory for 10288 // more information. 10289 // 10290 // $hash=d9da8862142742e780086714bbd4fb44ac95cf2c$ 10291 // 10292 10293 extern (C): 10294 10295 /// 10296 // Container for a single image represented at different scale factors. All 10297 // image representations should be the same size in density independent pixel 10298 // (DIP) units. For example, if the image at scale factor 1.0 is 100x100 pixels 10299 // then the image at scale factor 2.0 should be 200x200 pixels -- both images 10300 // will display with a DIP size of 100x100 units. The functions of this 10301 // structure can be called on any browser process thread. 10302 /// 10303 struct cef_image_t 10304 { 10305 /// 10306 // Base structure. 10307 /// 10308 cef_base_ref_counted_t base; 10309 10310 /// 10311 // Returns true (1) if this Image is NULL. 10312 /// 10313 extern(System) int function (cef_image_t* self) nothrow is_empty; 10314 10315 /// 10316 // Returns true (1) if this Image and |that| Image share the same underlying 10317 // storage. Will also return true (1) if both images are NULL. 10318 /// 10319 extern(System) int function (cef_image_t* self, cef_image_t* that) nothrow is_same; 10320 10321 /// 10322 // Add a bitmap image representation for |scale_factor|. Only 32-bit RGBA/BGRA 10323 // formats are supported. |pixel_width| and |pixel_height| are the bitmap 10324 // representation size in pixel coordinates. |pixel_data| is the array of 10325 // pixel data and should be |pixel_width| x |pixel_height| x 4 bytes in size. 10326 // |color_type| and |alpha_type| values specify the pixel format. 10327 /// 10328 extern(System) int function ( 10329 cef_image_t* self, 10330 float scale_factor, 10331 int pixel_width, 10332 int pixel_height, 10333 cef_color_type_t color_type, 10334 cef_alpha_type_t alpha_type, 10335 const(void)* pixel_data, 10336 size_t pixel_data_size) nothrow add_bitmap; 10337 10338 /// 10339 // Add a PNG image representation for |scale_factor|. |png_data| is the image 10340 // data of size |png_data_size|. Any alpha transparency in the PNG data will 10341 // be maintained. 10342 /// 10343 extern(System) int function ( 10344 cef_image_t* self, 10345 float scale_factor, 10346 const(void)* png_data, 10347 size_t png_data_size) nothrow add_png; 10348 10349 /// 10350 // Create a JPEG image representation for |scale_factor|. |jpeg_data| is the 10351 // image data of size |jpeg_data_size|. The JPEG format does not support 10352 // transparency so the alpha byte will be set to 0xFF for all pixels. 10353 /// 10354 extern(System) int function ( 10355 cef_image_t* self, 10356 float scale_factor, 10357 const(void)* jpeg_data, 10358 size_t jpeg_data_size) nothrow add_jpeg; 10359 10360 /// 10361 // Returns the image width in density independent pixel (DIP) units. 10362 /// 10363 extern(System) size_t function (cef_image_t* self) nothrow get_width; 10364 10365 /// 10366 // Returns the image height in density independent pixel (DIP) units. 10367 /// 10368 extern(System) size_t function (cef_image_t* self) nothrow get_height; 10369 10370 /// 10371 // Returns true (1) if this image contains a representation for 10372 // |scale_factor|. 10373 /// 10374 extern(System) int function (cef_image_t* self, float scale_factor) nothrow has_representation; 10375 10376 /// 10377 // Removes the representation for |scale_factor|. Returns true (1) on success. 10378 /// 10379 extern(System) int function ( 10380 cef_image_t* self, 10381 float scale_factor) nothrow remove_representation; 10382 10383 /// 10384 // Returns information for the representation that most closely matches 10385 // |scale_factor|. |actual_scale_factor| is the actual scale factor for the 10386 // representation. |pixel_width| and |pixel_height| are the representation 10387 // size in pixel coordinates. Returns true (1) on success. 10388 /// 10389 extern(System) int function ( 10390 cef_image_t* self, 10391 float scale_factor, 10392 float* actual_scale_factor, 10393 int* pixel_width, 10394 int* pixel_height) nothrow get_representation_info; 10395 10396 /// 10397 // Returns the bitmap representation that most closely matches |scale_factor|. 10398 // Only 32-bit RGBA/BGRA formats are supported. |color_type| and |alpha_type| 10399 // values specify the desired output pixel format. |pixel_width| and 10400 // |pixel_height| are the output representation size in pixel coordinates. 10401 // Returns a cef_binary_value_t containing the pixel data on success or NULL 10402 // on failure. 10403 /// 10404 extern(System) cef_binary_value_t* function ( 10405 cef_image_t* self, 10406 float scale_factor, 10407 cef_color_type_t color_type, 10408 cef_alpha_type_t alpha_type, 10409 int* pixel_width, 10410 int* pixel_height) nothrow get_as_bitmap; 10411 10412 /// 10413 // Returns the PNG representation that most closely matches |scale_factor|. If 10414 // |with_transparency| is true (1) any alpha transparency in the image will be 10415 // represented in the resulting PNG data. |pixel_width| and |pixel_height| are 10416 // the output representation size in pixel coordinates. Returns a 10417 // cef_binary_value_t containing the PNG image data on success or NULL on 10418 // failure. 10419 /// 10420 extern(System) cef_binary_value_t* function ( 10421 cef_image_t* self, 10422 float scale_factor, 10423 int with_transparency, 10424 int* pixel_width, 10425 int* pixel_height) nothrow get_as_png; 10426 10427 /// 10428 // Returns the JPEG representation that most closely matches |scale_factor|. 10429 // |quality| determines the compression level with 0 == lowest and 100 == 10430 // highest. The JPEG format does not support alpha transparency and the alpha 10431 // channel, if any, will be discarded. |pixel_width| and |pixel_height| are 10432 // the output representation size in pixel coordinates. Returns a 10433 // cef_binary_value_t containing the JPEG image data on success or NULL on 10434 // failure. 10435 /// 10436 extern(System) cef_binary_value_t* function ( 10437 cef_image_t* self, 10438 float scale_factor, 10439 int quality, 10440 int* pixel_width, 10441 int* pixel_height) nothrow get_as_jpeg; 10442 } 10443 10444 10445 10446 /// 10447 // Create a new cef_image_t. It will initially be NULL. Use the Add*() functions 10448 // to add representations at different scale factors. 10449 /// 10450 cef_image_t* cef_image_create (); 10451 10452 // CEF_INCLUDE_CAPI_CEF_IMAGE_CAPI_H_ 10453 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 10454 // 10455 // Redistribution and use in source and binary forms, with or without 10456 // modification, are permitted provided that the following conditions are 10457 // met: 10458 // 10459 // * Redistributions of source code must retain the above copyright 10460 // notice, this list of conditions and the following disclaimer. 10461 // * Redistributions in binary form must reproduce the above 10462 // copyright notice, this list of conditions and the following disclaimer 10463 // in the documentation and/or other materials provided with the 10464 // distribution. 10465 // * Neither the name of Google Inc. nor the name Chromium Embedded 10466 // Framework nor the names of its contributors may be used to endorse 10467 // or promote products derived from this software without specific prior 10468 // written permission. 10469 // 10470 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 10471 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 10472 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 10473 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 10474 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 10475 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 10476 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 10477 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 10478 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 10479 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 10480 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 10481 // 10482 // --------------------------------------------------------------------------- 10483 // 10484 // This file was generated by the CEF translator tool and should not edited 10485 // by hand. See the translator.README.txt file in the tools directory for 10486 // more information. 10487 // 10488 // $hash=d991e2a7d1a58a013e4d3a963361fed6918f4ec3$ 10489 // 10490 10491 extern (C): 10492 10493 /// 10494 // Callback structure used for asynchronous continuation of JavaScript dialog 10495 // requests. 10496 /// 10497 struct cef_jsdialog_callback_t 10498 { 10499 /// 10500 // Base structure. 10501 /// 10502 cef_base_ref_counted_t base; 10503 10504 /// 10505 // Continue the JS dialog request. Set |success| to true (1) if the OK button 10506 // was pressed. The |user_input| value should be specified for prompt dialogs. 10507 /// 10508 extern(System) void function ( 10509 cef_jsdialog_callback_t* self, 10510 int success, 10511 const(cef_string_t)* user_input) nothrow cont; 10512 } 10513 10514 10515 10516 /// 10517 // Implement this structure to handle events related to JavaScript dialogs. The 10518 // functions of this structure will be called on the UI thread. 10519 /// 10520 struct cef_jsdialog_handler_t 10521 { 10522 /// 10523 // Base structure. 10524 /// 10525 cef_base_ref_counted_t base; 10526 10527 /// 10528 // Called to run a JavaScript dialog. If |origin_url| is non-NULL it can be 10529 // passed to the CefFormatUrlForSecurityDisplay function to retrieve a secure 10530 // and user-friendly display string. The |default_prompt_text| value will be 10531 // specified for prompt dialogs only. Set |suppress_message| to true (1) and 10532 // return false (0) to suppress the message (suppressing messages is 10533 // preferable to immediately executing the callback as this is used to detect 10534 // presumably malicious behavior like spamming alert messages in 10535 // onbeforeunload). Set |suppress_message| to false (0) and return false (0) 10536 // to use the default implementation (the default implementation will show one 10537 // modal dialog at a time and suppress any additional dialog requests until 10538 // the displayed dialog is dismissed). Return true (1) if the application will 10539 // use a custom dialog or if the callback has been executed immediately. 10540 // Custom dialogs may be either modal or modeless. If a custom dialog is used 10541 // the application must execute |callback| once the custom dialog is 10542 // dismissed. 10543 /// 10544 extern(System) int function ( 10545 cef_jsdialog_handler_t* self, 10546 cef_browser_t* browser, 10547 const(cef_string_t)* origin_url, 10548 cef_jsdialog_type_t dialog_type, 10549 const(cef_string_t)* message_text, 10550 const(cef_string_t)* default_prompt_text, 10551 cef_jsdialog_callback_t* callback, 10552 int* suppress_message) nothrow on_jsdialog; 10553 10554 /// 10555 // Called to run a dialog asking the user if they want to leave a page. Return 10556 // false (0) to use the default dialog implementation. Return true (1) if the 10557 // application will use a custom dialog or if the callback has been executed 10558 // immediately. Custom dialogs may be either modal or modeless. If a custom 10559 // dialog is used the application must execute |callback| once the custom 10560 // dialog is dismissed. 10561 /// 10562 extern(System) int function ( 10563 cef_jsdialog_handler_t* self, 10564 cef_browser_t* browser, 10565 const(cef_string_t)* message_text, 10566 int is_reload, 10567 cef_jsdialog_callback_t* callback) nothrow on_before_unload_dialog; 10568 10569 /// 10570 // Called to cancel any pending dialogs and reset any saved dialog state. Will 10571 // be called due to events like page navigation irregardless of whether any 10572 // dialogs are currently pending. 10573 /// 10574 extern(System) void function ( 10575 cef_jsdialog_handler_t* self, 10576 cef_browser_t* browser) nothrow on_reset_dialog_state; 10577 10578 /// 10579 // Called when the default implementation dialog is closed. 10580 /// 10581 extern(System) void function ( 10582 cef_jsdialog_handler_t* self, 10583 cef_browser_t* browser) nothrow on_dialog_closed; 10584 } 10585 10586 10587 10588 // CEF_INCLUDE_CAPI_CEF_JSDIALOG_HANDLER_CAPI_H_ 10589 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 10590 // 10591 // Redistribution and use in source and binary forms, with or without 10592 // modification, are permitted provided that the following conditions are 10593 // met: 10594 // 10595 // * Redistributions of source code must retain the above copyright 10596 // notice, this list of conditions and the following disclaimer. 10597 // * Redistributions in binary form must reproduce the above 10598 // copyright notice, this list of conditions and the following disclaimer 10599 // in the documentation and/or other materials provided with the 10600 // distribution. 10601 // * Neither the name of Google Inc. nor the name Chromium Embedded 10602 // Framework nor the names of its contributors may be used to endorse 10603 // or promote products derived from this software without specific prior 10604 // written permission. 10605 // 10606 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 10607 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 10608 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 10609 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 10610 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 10611 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 10612 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 10613 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 10614 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 10615 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 10616 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 10617 // 10618 // --------------------------------------------------------------------------- 10619 // 10620 // This file was generated by the CEF translator tool and should not edited 10621 // by hand. See the translator.README.txt file in the tools directory for 10622 // more information. 10623 // 10624 // $hash=d804a2db0f9ac13afd249407c85cb8d5852508ac$ 10625 // 10626 10627 extern (C): 10628 10629 /// 10630 // Implement this structure to handle events related to keyboard input. The 10631 // functions of this structure will be called on the UI thread. 10632 /// 10633 struct cef_keyboard_handler_t 10634 { 10635 /// 10636 // Base structure. 10637 /// 10638 cef_base_ref_counted_t base; 10639 10640 /// 10641 // Called before a keyboard event is sent to the renderer. |event| contains 10642 // information about the keyboard event. |os_event| is the operating system 10643 // event message, if any. Return true (1) if the event was handled or false 10644 // (0) otherwise. If the event will be handled in on_key_event() as a keyboard 10645 // shortcut set |is_keyboard_shortcut| to true (1) and return false (0). 10646 /// 10647 extern(System) int function ( 10648 cef_keyboard_handler_t* self, 10649 cef_browser_t* browser, 10650 const(cef_key_event_t)* event, 10651 XEvent* os_event, 10652 int* is_keyboard_shortcut) nothrow on_pre_key_event; 10653 10654 /// 10655 // Called after the renderer and JavaScript in the page has had a chance to 10656 // handle the event. |event| contains information about the keyboard event. 10657 // |os_event| is the operating system event message, if any. Return true (1) 10658 // if the keyboard event was handled or false (0) otherwise. 10659 /// 10660 extern(System) int function ( 10661 cef_keyboard_handler_t* self, 10662 cef_browser_t* browser, 10663 const(cef_key_event_t)* event, 10664 XEvent* os_event) nothrow on_key_event; 10665 } 10666 10667 10668 10669 // CEF_INCLUDE_CAPI_CEF_KEYBOARD_HANDLER_CAPI_H_ 10670 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 10671 // 10672 // Redistribution and use in source and binary forms, with or without 10673 // modification, are permitted provided that the following conditions are 10674 // met: 10675 // 10676 // * Redistributions of source code must retain the above copyright 10677 // notice, this list of conditions and the following disclaimer. 10678 // * Redistributions in binary form must reproduce the above 10679 // copyright notice, this list of conditions and the following disclaimer 10680 // in the documentation and/or other materials provided with the 10681 // distribution. 10682 // * Neither the name of Google Inc. nor the name Chromium Embedded 10683 // Framework nor the names of its contributors may be used to endorse 10684 // or promote products derived from this software without specific prior 10685 // written permission. 10686 // 10687 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 10688 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 10689 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 10690 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 10691 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 10692 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 10693 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 10694 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 10695 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 10696 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 10697 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 10698 // 10699 // --------------------------------------------------------------------------- 10700 // 10701 // This file was generated by the CEF translator tool and should not edited 10702 // by hand. See the translator.README.txt file in the tools directory for 10703 // more information. 10704 // 10705 // $hash=e44bb89a337942c82bfa246275b4b033821b2782$ 10706 // 10707 10708 extern (C): 10709 10710 10711 10712 /// 10713 // Implement this structure to handle events related to browser life span. The 10714 // functions of this structure will be called on the UI thread unless otherwise 10715 // indicated. 10716 /// 10717 struct cef_life_span_handler_t 10718 { 10719 /// 10720 // Base structure. 10721 /// 10722 cef_base_ref_counted_t base; 10723 10724 /// 10725 // Called on the UI thread before a new popup browser is created. The 10726 // |browser| and |frame| values represent the source of the popup request. The 10727 // |target_url| and |target_frame_name| values indicate where the popup 10728 // browser should navigate and may be NULL if not specified with the request. 10729 // The |target_disposition| value indicates where the user intended to open 10730 // the popup (e.g. current tab, new tab, etc). The |user_gesture| value will 10731 // be true (1) if the popup was opened via explicit user gesture (e.g. 10732 // clicking a link) or false (0) if the popup opened automatically (e.g. via 10733 // the DomContentLoaded event). The |popupFeatures| structure contains 10734 // additional information about the requested popup window. To allow creation 10735 // of the popup browser optionally modify |windowInfo|, |client|, |settings| 10736 // and |no_javascript_access| and return false (0). To cancel creation of the 10737 // popup browser return true (1). The |client| and |settings| values will 10738 // default to the source browser's values. If the |no_javascript_access| value 10739 // is set to false (0) the new browser will not be scriptable and may not be 10740 // hosted in the same renderer process as the source browser. Any 10741 // modifications to |windowInfo| will be ignored if the parent browser is 10742 // wrapped in a cef_browser_view_t. Popup browser creation will be canceled if 10743 // the parent browser is destroyed before the popup browser creation completes 10744 // (indicated by a call to OnAfterCreated for the popup browser). The 10745 // |extra_info| parameter provides an opportunity to specify extra information 10746 // specific to the created popup browser that will be passed to 10747 // cef_render_process_handler_t::on_browser_created() in the render process. 10748 /// 10749 extern(System) int function ( 10750 cef_life_span_handler_t* self, 10751 cef_browser_t* browser, 10752 cef_frame_t* frame, 10753 const(cef_string_t)* target_url, 10754 const(cef_string_t)* target_frame_name, 10755 cef_window_open_disposition_t target_disposition, 10756 int user_gesture, 10757 const(cef_popup_features_t)* popupFeatures, 10758 cef_window_info_t* windowInfo, 10759 cef_client_t** client, 10760 cef_browser_settings_t* settings, 10761 cef_dictionary_value_t** extra_info, 10762 int* no_javascript_access) nothrow on_before_popup; 10763 10764 /// 10765 // Called after a new browser is created. It is now safe to begin performing 10766 // actions with |browser|. cef_frame_handler_t callbacks related to initial 10767 // main frame creation will arrive before this callback. See 10768 // cef_frame_handler_t documentation for additional usage information. 10769 /// 10770 extern(System) void function ( 10771 cef_life_span_handler_t* self, 10772 cef_browser_t* browser) nothrow on_after_created; 10773 10774 /// 10775 // Called when a browser has recieved a request to close. This may result 10776 // directly from a call to cef_browser_host_t::*close_browser() or indirectly 10777 // if the browser is parented to a top-level window created by CEF and the 10778 // user attempts to close that window (by clicking the 'X', for example). The 10779 // do_close() function will be called after the JavaScript 'onunload' event 10780 // has been fired. 10781 // 10782 // An application should handle top-level owner window close notifications by 10783 // calling cef_browser_host_t::try_close_browser() or 10784 // cef_browser_host_t::CloseBrowser(false (0)) instead of allowing the window 10785 // to close immediately (see the examples below). This gives CEF an 10786 // opportunity to process the 'onbeforeunload' event and optionally cancel the 10787 // close before do_close() is called. 10788 // 10789 // When windowed rendering is enabled CEF will internally create a window or 10790 // view to host the browser. In that case returning false (0) from do_close() 10791 // will send the standard close notification to the browser's top-level owner 10792 // window (e.g. WM_CLOSE on Windows, performClose: on OS X, "delete_event" on 10793 // Linux or cef_window_delegate_t::can_close() callback from Views). If the 10794 // browser's host window/view has already been destroyed (via view hierarchy 10795 // tear-down, for example) then do_close() will not be called for that browser 10796 // since is no longer possible to cancel the close. 10797 // 10798 // When windowed rendering is disabled returning false (0) from do_close() 10799 // will cause the browser object to be destroyed immediately. 10800 // 10801 // If the browser's top-level owner window requires a non-standard close 10802 // notification then send that notification from do_close() and return true 10803 // (1). 10804 // 10805 // The cef_life_span_handler_t::on_before_close() function will be called 10806 // after do_close() (if do_close() is called) and immediately before the 10807 // browser object is destroyed. The application should only exit after 10808 // on_before_close() has been called for all existing browsers. 10809 // 10810 // The below examples describe what should happen during window close when the 10811 // browser is parented to an application-provided top-level window. 10812 // 10813 // Example 1: Using cef_browser_host_t::try_close_browser(). This is 10814 // recommended for clients using standard close handling and windows created 10815 // on the browser process UI thread. 1. User clicks the window close button 10816 // which sends a close notification to 10817 // the application's top-level window. 10818 // 2. Application's top-level window receives the close notification and 10819 // calls TryCloseBrowser() (which internally calls CloseBrowser(false)). 10820 // TryCloseBrowser() returns false so the client cancels the window close. 10821 // 3. JavaScript 'onbeforeunload' handler executes and shows the close 10822 // confirmation dialog (which can be overridden via 10823 // CefJSDialogHandler::OnBeforeUnloadDialog()). 10824 // 4. User approves the close. 5. JavaScript 'onunload' handler executes. 6. 10825 // CEF sends a close notification to the application's top-level window 10826 // (because DoClose() returned false by default). 10827 // 7. Application's top-level window receives the close notification and 10828 // calls TryCloseBrowser(). TryCloseBrowser() returns true so the client 10829 // allows the window close. 10830 // 8. Application's top-level window is destroyed. 9. Application's 10831 // on_before_close() handler is called and the browser object 10832 // is destroyed. 10833 // 10. Application exits by calling cef_quit_message_loop() if no other 10834 // browsers 10835 // exist. 10836 // 10837 // Example 2: Using cef_browser_host_t::CloseBrowser(false (0)) and 10838 // implementing the do_close() callback. This is recommended for clients using 10839 // non-standard close handling or windows that were not created on the browser 10840 // process UI thread. 1. User clicks the window close button which sends a 10841 // close notification to 10842 // the application's top-level window. 10843 // 2. Application's top-level window receives the close notification and: 10844 // A. Calls CefBrowserHost::CloseBrowser(false). 10845 // B. Cancels the window close. 10846 // 3. JavaScript 'onbeforeunload' handler executes and shows the close 10847 // confirmation dialog (which can be overridden via 10848 // CefJSDialogHandler::OnBeforeUnloadDialog()). 10849 // 4. User approves the close. 5. JavaScript 'onunload' handler executes. 6. 10850 // Application's do_close() handler is called. Application will: 10851 // A. Set a flag to indicate that the next close attempt will be allowed. 10852 // B. Return false. 10853 // 7. CEF sends an close notification to the application's top-level window. 10854 // 8. Application's top-level window receives the close notification and 10855 // allows the window to close based on the flag from #6B. 10856 // 9. Application's top-level window is destroyed. 10. Application's 10857 // on_before_close() handler is called and the browser object 10858 // is destroyed. 10859 // 11. Application exits by calling cef_quit_message_loop() if no other 10860 // browsers 10861 // exist. 10862 /// 10863 extern(System) int function ( 10864 cef_life_span_handler_t* self, 10865 cef_browser_t* browser) nothrow do_close; 10866 10867 /// 10868 // Called just before a browser is destroyed. Release all references to the 10869 // browser object and do not attempt to execute any functions on the browser 10870 // object (other than IsValid, GetIdentifier or IsSame) after this callback 10871 // returns. cef_frame_handler_t callbacks related to final main frame 10872 // destruction will arrive after this callback and cef_browser_t::IsValid will 10873 // return false (0) at that time. Any in-progress network requests associated 10874 // with |browser| will be aborted when the browser is destroyed, and 10875 // cef_resource_request_handler_t callbacks related to those requests may 10876 // still arrive on the IO thread after this callback. See cef_frame_handler_t 10877 // and do_close() documentation for additional usage information. 10878 /// 10879 extern(System) void function ( 10880 cef_life_span_handler_t* self, 10881 cef_browser_t* browser) nothrow on_before_close; 10882 } 10883 10884 10885 10886 // CEF_INCLUDE_CAPI_CEF_LIFE_SPAN_HANDLER_CAPI_H_ 10887 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 10888 // 10889 // Redistribution and use in source and binary forms, with or without 10890 // modification, are permitted provided that the following conditions are 10891 // met: 10892 // 10893 // * Redistributions of source code must retain the above copyright 10894 // notice, this list of conditions and the following disclaimer. 10895 // * Redistributions in binary form must reproduce the above 10896 // copyright notice, this list of conditions and the following disclaimer 10897 // in the documentation and/or other materials provided with the 10898 // distribution. 10899 // * Neither the name of Google Inc. nor the name Chromium Embedded 10900 // Framework nor the names of its contributors may be used to endorse 10901 // or promote products derived from this software without specific prior 10902 // written permission. 10903 // 10904 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 10905 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 10906 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 10907 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 10908 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 10909 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 10910 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 10911 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 10912 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 10913 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 10914 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 10915 // 10916 // --------------------------------------------------------------------------- 10917 // 10918 // This file was generated by the CEF translator tool and should not edited 10919 // by hand. See the translator.README.txt file in the tools directory for 10920 // more information. 10921 // 10922 // $hash=6c6a719d7cbbc01adfdc9bbe0dff6da10e06e3f3$ 10923 // 10924 10925 extern (C): 10926 10927 /// 10928 // Implement this structure to handle events related to browser load status. The 10929 // functions of this structure will be called on the browser process UI thread 10930 // or render process main thread (TID_RENDERER). 10931 /// 10932 struct cef_load_handler_t 10933 { 10934 /// 10935 // Base structure. 10936 /// 10937 cef_base_ref_counted_t base; 10938 10939 /// 10940 // Called when the loading state has changed. This callback will be executed 10941 // twice -- once when loading is initiated either programmatically or by user 10942 // action, and once when loading is terminated due to completion, cancellation 10943 // of failure. It will be called before any calls to OnLoadStart and after all 10944 // calls to OnLoadError and/or OnLoadEnd. 10945 /// 10946 extern(System) void function ( 10947 cef_load_handler_t* self, 10948 cef_browser_t* browser, 10949 int isLoading, 10950 int canGoBack, 10951 int canGoForward) nothrow on_loading_state_change; 10952 10953 /// 10954 // Called after a navigation has been committed and before the browser begins 10955 // loading contents in the frame. The |frame| value will never be NULL -- call 10956 // the is_main() function to check if this frame is the main frame. 10957 // |transition_type| provides information about the source of the navigation 10958 // and an accurate value is only available in the browser process. Multiple 10959 // frames may be loading at the same time. Sub-frames may start or continue 10960 // loading after the main frame load has ended. This function will not be 10961 // called for same page navigations (fragments, history state, etc.) or for 10962 // navigations that fail or are canceled before commit. For notification of 10963 // overall browser load status use OnLoadingStateChange instead. 10964 /// 10965 extern(System) void function ( 10966 cef_load_handler_t* self, 10967 cef_browser_t* browser, 10968 cef_frame_t* frame, 10969 cef_transition_type_t transition_type) nothrow on_load_start; 10970 10971 /// 10972 // Called when the browser is done loading a frame. The |frame| value will 10973 // never be NULL -- call the is_main() function to check if this frame is the 10974 // main frame. Multiple frames may be loading at the same time. Sub-frames may 10975 // start or continue loading after the main frame load has ended. This 10976 // function will not be called for same page navigations (fragments, history 10977 // state, etc.) or for navigations that fail or are canceled before commit. 10978 // For notification of overall browser load status use OnLoadingStateChange 10979 // instead. 10980 /// 10981 extern(System) void function ( 10982 cef_load_handler_t* self, 10983 cef_browser_t* browser, 10984 cef_frame_t* frame, 10985 int httpStatusCode) nothrow on_load_end; 10986 10987 /// 10988 // Called when a navigation fails or is canceled. This function may be called 10989 // by itself if before commit or in combination with OnLoadStart/OnLoadEnd if 10990 // after commit. |errorCode| is the error code number, |errorText| is the 10991 // error text and |failedUrl| is the URL that failed to load. See 10992 // net\base\net_error_list.h for complete descriptions of the error codes. 10993 /// 10994 extern(System) void function ( 10995 cef_load_handler_t* self, 10996 cef_browser_t* browser, 10997 cef_frame_t* frame, 10998 cef_errorcode_t errorCode, 10999 const(cef_string_t)* errorText, 11000 const(cef_string_t)* failedUrl) nothrow on_load_error; 11001 } 11002 11003 11004 11005 // CEF_INCLUDE_CAPI_CEF_LOAD_HANDLER_CAPI_H_ 11006 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 11007 // 11008 // Redistribution and use in source and binary forms, with or without 11009 // modification, are permitted provided that the following conditions are 11010 // met: 11011 // 11012 // * Redistributions of source code must retain the above copyright 11013 // notice, this list of conditions and the following disclaimer. 11014 // * Redistributions in binary form must reproduce the above 11015 // copyright notice, this list of conditions and the following disclaimer 11016 // in the documentation and/or other materials provided with the 11017 // distribution. 11018 // * Neither the name of Google Inc. nor the name Chromium Embedded 11019 // Framework nor the names of its contributors may be used to endorse 11020 // or promote products derived from this software without specific prior 11021 // written permission. 11022 // 11023 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 11024 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 11025 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 11026 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 11027 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 11028 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 11029 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 11030 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 11031 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 11032 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 11033 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11034 // 11035 // --------------------------------------------------------------------------- 11036 // 11037 // This file was generated by the CEF translator tool and should not edited 11038 // by hand. See the translator.README.txt file in the tools directory for 11039 // more information. 11040 // 11041 // $hash=79e4e38c732c0cfeef495c8a9726e105054012bb$ 11042 // 11043 11044 extern (C): 11045 11046 /// 11047 // Supports discovery of and communication with media devices on the local 11048 // network via the Cast and DIAL protocols. The functions of this structure may 11049 // be called on any browser process thread unless otherwise indicated. 11050 /// 11051 struct cef_media_router_t 11052 { 11053 /// 11054 // Base structure. 11055 /// 11056 cef_base_ref_counted_t base; 11057 11058 /// 11059 // Add an observer for MediaRouter events. The observer will remain registered 11060 // until the returned Registration object is destroyed. 11061 /// 11062 extern(System) cef_registration_t* function ( 11063 cef_media_router_t* self, 11064 cef_media_observer_t* observer) nothrow add_observer; 11065 11066 /// 11067 // Returns a MediaSource object for the specified media source URN. Supported 11068 // URN schemes include "cast:" and "dial:", and will be already known by the 11069 // client application (e.g. "cast:<appId>?clientId=<clientId>"). 11070 /// 11071 extern(System) cef_media_source_t* function ( 11072 cef_media_router_t* self, 11073 const(cef_string_t)* urn) nothrow get_source; 11074 11075 /// 11076 // Trigger an asynchronous call to cef_media_observer_t::OnSinks on all 11077 // registered observers. 11078 /// 11079 extern(System) void function (cef_media_router_t* self) nothrow notify_current_sinks; 11080 11081 /// 11082 // Create a new route between |source| and |sink|. Source and sink must be 11083 // valid, compatible (as reported by cef_media_sink_t::IsCompatibleWith), and 11084 // a route between them must not already exist. |callback| will be executed on 11085 // success or failure. If route creation succeeds it will also trigger an 11086 // asynchronous call to cef_media_observer_t::OnRoutes on all registered 11087 // observers. 11088 /// 11089 extern(System) void function ( 11090 cef_media_router_t* self, 11091 cef_media_source_t* source, 11092 cef_media_sink_t* sink, 11093 cef_media_route_create_callback_t* callback) nothrow create_route; 11094 11095 /// 11096 // Trigger an asynchronous call to cef_media_observer_t::OnRoutes on all 11097 // registered observers. 11098 /// 11099 extern(System) void function (cef_media_router_t* self) nothrow notify_current_routes; 11100 } 11101 11102 11103 11104 /// 11105 // Returns the MediaRouter object associated with the global request context. If 11106 // |callback| is non-NULL it will be executed asnychronously on the UI thread 11107 // after the manager's storage has been initialized. Equivalent to calling cef_r 11108 // equest_context_t::cef_request_context_get_global_context()->get_media_router( 11109 // ). 11110 /// 11111 cef_media_router_t* cef_media_router_get_global ( 11112 cef_completion_callback_t* callback); 11113 11114 /// 11115 // Implemented by the client to observe MediaRouter events and registered via 11116 // cef_media_router_t::AddObserver. The functions of this structure will be 11117 // called on the browser process UI thread. 11118 /// 11119 struct cef_media_observer_t 11120 { 11121 /// 11122 // Base structure. 11123 /// 11124 cef_base_ref_counted_t base; 11125 11126 /// 11127 // The list of available media sinks has changed or 11128 // cef_media_router_t::NotifyCurrentSinks was called. 11129 /// 11130 extern(System) void function ( 11131 cef_media_observer_t* self, 11132 size_t sinksCount, 11133 cef_media_sink_t** sinks) nothrow on_sinks; 11134 11135 /// 11136 // The list of available media routes has changed or 11137 // cef_media_router_t::NotifyCurrentRoutes was called. 11138 /// 11139 extern(System) void function ( 11140 cef_media_observer_t* self, 11141 size_t routesCount, 11142 cef_media_route_t** routes) nothrow on_routes; 11143 11144 /// 11145 // The connection state of |route| has changed. 11146 /// 11147 extern(System) void function ( 11148 cef_media_observer_t* self, 11149 cef_media_route_t* route, 11150 cef_media_route_connection_state_t state) nothrow on_route_state_changed; 11151 11152 /// 11153 // A message was recieved over |route|. |message| is only valid for the scope 11154 // of this callback and should be copied if necessary. 11155 /// 11156 extern(System) void function ( 11157 cef_media_observer_t* self, 11158 cef_media_route_t* route, 11159 const(void)* message, 11160 size_t message_size) nothrow on_route_message_received; 11161 } 11162 11163 11164 11165 /// 11166 // Represents the route between a media source and sink. Instances of this 11167 // object are created via cef_media_router_t::CreateRoute and retrieved via 11168 // cef_media_observer_t::OnRoutes. Contains the status and metadata of a routing 11169 // operation. The functions of this structure may be called on any browser 11170 // process thread unless otherwise indicated. 11171 /// 11172 struct cef_media_route_t 11173 { 11174 /// 11175 // Base structure. 11176 /// 11177 cef_base_ref_counted_t base; 11178 11179 /// 11180 // Returns the ID for this route. 11181 /// 11182 // The resulting string must be freed by calling cef_string_userfree_free(). 11183 extern(System) cef_string_userfree_t function (cef_media_route_t* self) nothrow get_id; 11184 11185 /// 11186 // Returns the source associated with this route. 11187 /// 11188 extern(System) cef_media_source_t* function (cef_media_route_t* self) nothrow get_source; 11189 11190 /// 11191 // Returns the sink associated with this route. 11192 /// 11193 extern(System) cef_media_sink_t* function (cef_media_route_t* self) nothrow get_sink; 11194 11195 /// 11196 // Send a message over this route. |message| will be copied if necessary. 11197 /// 11198 extern(System) void function ( 11199 cef_media_route_t* self, 11200 const(void)* message, 11201 size_t message_size) nothrow send_route_message; 11202 11203 /// 11204 // Terminate this route. Will result in an asynchronous call to 11205 // cef_media_observer_t::OnRoutes on all registered observers. 11206 /// 11207 extern(System) void function (cef_media_route_t* self) nothrow terminate; 11208 } 11209 11210 11211 11212 /// 11213 // Callback structure for cef_media_router_t::CreateRoute. The functions of this 11214 // structure will be called on the browser process UI thread. 11215 /// 11216 struct cef_media_route_create_callback_t 11217 { 11218 /// 11219 // Base structure. 11220 /// 11221 cef_base_ref_counted_t base; 11222 11223 /// 11224 // Method that will be executed when the route creation has finished. |result| 11225 // will be CEF_MRCR_OK if the route creation succeeded. |error| will be a 11226 // description of the error if the route creation failed. |route| is the 11227 // resulting route, or NULL if the route creation failed. 11228 /// 11229 extern(System) void function ( 11230 cef_media_route_create_callback_t* self, 11231 cef_media_route_create_result_t result, 11232 const(cef_string_t)* error, 11233 cef_media_route_t* route) nothrow on_media_route_create_finished; 11234 } 11235 11236 11237 11238 /// 11239 // Represents a sink to which media can be routed. Instances of this object are 11240 // retrieved via cef_media_observer_t::OnSinks. The functions of this structure 11241 // may be called on any browser process thread unless otherwise indicated. 11242 /// 11243 struct cef_media_sink_t 11244 { 11245 /// 11246 // Base structure. 11247 /// 11248 cef_base_ref_counted_t base; 11249 11250 /// 11251 // Returns the ID for this sink. 11252 /// 11253 // The resulting string must be freed by calling cef_string_userfree_free(). 11254 extern(System) cef_string_userfree_t function (cef_media_sink_t* self) nothrow get_id; 11255 11256 /// 11257 // Returns the name of this sink. 11258 /// 11259 // The resulting string must be freed by calling cef_string_userfree_free(). 11260 extern(System) cef_string_userfree_t function (cef_media_sink_t* self) nothrow get_name; 11261 11262 /// 11263 // Returns the description of this sink. 11264 /// 11265 // The resulting string must be freed by calling cef_string_userfree_free(). 11266 extern(System) cef_string_userfree_t function (cef_media_sink_t* self) nothrow get_description; 11267 11268 /// 11269 // Returns the icon type for this sink. 11270 /// 11271 extern(System) cef_media_sink_icon_type_t function ( 11272 cef_media_sink_t* self) nothrow get_icon_type; 11273 11274 /// 11275 // Asynchronously retrieves device info. 11276 /// 11277 extern(System) void function ( 11278 cef_media_sink_t* self, 11279 cef_media_sink_device_info_callback_t* callback) nothrow get_device_info; 11280 11281 /// 11282 // Returns true (1) if this sink accepts content via Cast. 11283 /// 11284 extern(System) int function (cef_media_sink_t* self) nothrow is_cast_sink; 11285 11286 /// 11287 // Returns true (1) if this sink accepts content via DIAL. 11288 /// 11289 extern(System) int function (cef_media_sink_t* self) nothrow is_dial_sink; 11290 11291 /// 11292 // Returns true (1) if this sink is compatible with |source|. 11293 /// 11294 extern(System) int function ( 11295 cef_media_sink_t* self, 11296 cef_media_source_t* source) nothrow is_compatible_with; 11297 } 11298 11299 11300 11301 /// 11302 // Callback structure for cef_media_sink_t::GetDeviceInfo. The functions of this 11303 // structure will be called on the browser process UI thread. 11304 /// 11305 struct cef_media_sink_device_info_callback_t 11306 { 11307 /// 11308 // Base structure. 11309 /// 11310 cef_base_ref_counted_t base; 11311 11312 /// 11313 // Method that will be executed asyncronously once device information has been 11314 // retrieved. 11315 /// 11316 extern(System) void function ( 11317 cef_media_sink_device_info_callback_t* self, 11318 const(cef_media_sink_device_info_t)* device_info) nothrow on_media_sink_device_info; 11319 } 11320 11321 11322 11323 /// 11324 // Represents a source from which media can be routed. Instances of this object 11325 // are retrieved via cef_media_router_t::GetSource. The functions of this 11326 // structure may be called on any browser process thread unless otherwise 11327 // indicated. 11328 /// 11329 struct cef_media_source_t 11330 { 11331 /// 11332 // Base structure. 11333 /// 11334 cef_base_ref_counted_t base; 11335 11336 /// 11337 // Returns the ID (media source URN or URL) for this source. 11338 /// 11339 // The resulting string must be freed by calling cef_string_userfree_free(). 11340 extern(System) cef_string_userfree_t function (cef_media_source_t* self) nothrow get_id; 11341 11342 /// 11343 // Returns true (1) if this source outputs its content via Cast. 11344 /// 11345 extern(System) int function (cef_media_source_t* self) nothrow is_cast_source; 11346 11347 /// 11348 // Returns true (1) if this source outputs its content via DIAL. 11349 /// 11350 extern(System) int function (cef_media_source_t* self) nothrow is_dial_source; 11351 } 11352 11353 11354 11355 // CEF_INCLUDE_CAPI_CEF_MEDIA_ROUTER_CAPI_H_ 11356 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 11357 // 11358 // Redistribution and use in source and binary forms, with or without 11359 // modification, are permitted provided that the following conditions are 11360 // met: 11361 // 11362 // * Redistributions of source code must retain the above copyright 11363 // notice, this list of conditions and the following disclaimer. 11364 // * Redistributions in binary form must reproduce the above 11365 // copyright notice, this list of conditions and the following disclaimer 11366 // in the documentation and/or other materials provided with the 11367 // distribution. 11368 // * Neither the name of Google Inc. nor the name Chromium Embedded 11369 // Framework nor the names of its contributors may be used to endorse 11370 // or promote products derived from this software without specific prior 11371 // written permission. 11372 // 11373 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 11374 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 11375 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 11376 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 11377 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 11378 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 11379 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 11380 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 11381 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 11382 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 11383 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11384 // 11385 // --------------------------------------------------------------------------- 11386 // 11387 // This file was generated by the CEF translator tool and should not edited 11388 // by hand. See the translator.README.txt file in the tools directory for 11389 // more information. 11390 // 11391 // $hash=28fa978051bd3ddff69d58e0dc8f445f64a61480$ 11392 // 11393 11394 extern (C): 11395 11396 /// 11397 // Supports creation and modification of menus. See cef_menu_id_t for the 11398 // command ids that have default implementations. All user-defined command ids 11399 // should be between MENU_ID_USER_FIRST and MENU_ID_USER_LAST. The functions of 11400 // this structure can only be accessed on the browser process the UI thread. 11401 /// 11402 struct cef_menu_model_t 11403 { 11404 /// 11405 // Base structure. 11406 /// 11407 cef_base_ref_counted_t base; 11408 11409 /// 11410 // Returns true (1) if this menu is a submenu. 11411 /// 11412 extern(System) int function (cef_menu_model_t* self) nothrow is_sub_menu; 11413 11414 /// 11415 // Clears the menu. Returns true (1) on success. 11416 /// 11417 extern(System) int function (cef_menu_model_t* self) nothrow clear; 11418 11419 /// 11420 // Returns the number of items in this menu. 11421 /// 11422 extern(System) int function (cef_menu_model_t* self) nothrow get_count; 11423 11424 /// 11425 // Add a separator to the menu. Returns true (1) on success. 11426 /// 11427 extern(System) int function (cef_menu_model_t* self) nothrow add_separator; 11428 11429 /// 11430 // Add an item to the menu. Returns true (1) on success. 11431 /// 11432 extern(System) int function ( 11433 cef_menu_model_t* self, 11434 int command_id, 11435 const(cef_string_t)* label) nothrow add_item; 11436 11437 /// 11438 // Add a check item to the menu. Returns true (1) on success. 11439 /// 11440 extern(System) int function ( 11441 cef_menu_model_t* self, 11442 int command_id, 11443 const(cef_string_t)* label) nothrow add_check_item; 11444 11445 /// 11446 // Add a radio item to the menu. Only a single item with the specified 11447 // |group_id| can be checked at a time. Returns true (1) on success. 11448 /// 11449 extern(System) int function ( 11450 cef_menu_model_t* self, 11451 int command_id, 11452 const(cef_string_t)* label, 11453 int group_id) nothrow add_radio_item; 11454 11455 /// 11456 // Add a sub-menu to the menu. The new sub-menu is returned. 11457 /// 11458 extern(System) cef_menu_model_t* function ( 11459 cef_menu_model_t* self, 11460 int command_id, 11461 const(cef_string_t)* label) nothrow add_sub_menu; 11462 11463 /// 11464 // Insert a separator in the menu at the specified |index|. Returns true (1) 11465 // on success. 11466 /// 11467 extern(System) int function (cef_menu_model_t* self, int index) nothrow insert_separator_at; 11468 11469 /// 11470 // Insert an item in the menu at the specified |index|. Returns true (1) on 11471 // success. 11472 /// 11473 extern(System) int function ( 11474 cef_menu_model_t* self, 11475 int index, 11476 int command_id, 11477 const(cef_string_t)* label) nothrow insert_item_at; 11478 11479 /// 11480 // Insert a check item in the menu at the specified |index|. Returns true (1) 11481 // on success. 11482 /// 11483 extern(System) int function ( 11484 cef_menu_model_t* self, 11485 int index, 11486 int command_id, 11487 const(cef_string_t)* label) nothrow insert_check_item_at; 11488 11489 /// 11490 // Insert a radio item in the menu at the specified |index|. Only a single 11491 // item with the specified |group_id| can be checked at a time. Returns true 11492 // (1) on success. 11493 /// 11494 extern(System) int function ( 11495 cef_menu_model_t* self, 11496 int index, 11497 int command_id, 11498 const(cef_string_t)* label, 11499 int group_id) nothrow insert_radio_item_at; 11500 11501 /// 11502 // Insert a sub-menu in the menu at the specified |index|. The new sub-menu is 11503 // returned. 11504 /// 11505 extern(System) cef_menu_model_t* function ( 11506 cef_menu_model_t* self, 11507 int index, 11508 int command_id, 11509 const(cef_string_t)* label) nothrow insert_sub_menu_at; 11510 11511 /// 11512 // Removes the item with the specified |command_id|. Returns true (1) on 11513 // success. 11514 /// 11515 extern(System) int function (cef_menu_model_t* self, int command_id) nothrow remove; 11516 11517 /// 11518 // Removes the item at the specified |index|. Returns true (1) on success. 11519 /// 11520 extern(System) int function (cef_menu_model_t* self, int index) nothrow remove_at; 11521 11522 /// 11523 // Returns the index associated with the specified |command_id| or -1 if not 11524 // found due to the command id not existing in the menu. 11525 /// 11526 extern(System) int function (cef_menu_model_t* self, int command_id) nothrow get_index_of; 11527 11528 /// 11529 // Returns the command id at the specified |index| or -1 if not found due to 11530 // invalid range or the index being a separator. 11531 /// 11532 extern(System) int function (cef_menu_model_t* self, int index) nothrow get_command_id_at; 11533 11534 /// 11535 // Sets the command id at the specified |index|. Returns true (1) on success. 11536 /// 11537 extern(System) int function ( 11538 cef_menu_model_t* self, 11539 int index, 11540 int command_id) nothrow set_command_id_at; 11541 11542 /// 11543 // Returns the label for the specified |command_id| or NULL if not found. 11544 /// 11545 // The resulting string must be freed by calling cef_string_userfree_free(). 11546 extern(System) cef_string_userfree_t function ( 11547 cef_menu_model_t* self, 11548 int command_id) nothrow get_label; 11549 11550 /// 11551 // Returns the label at the specified |index| or NULL if not found due to 11552 // invalid range or the index being a separator. 11553 /// 11554 // The resulting string must be freed by calling cef_string_userfree_free(). 11555 extern(System) cef_string_userfree_t function ( 11556 cef_menu_model_t* self, 11557 int index) nothrow get_label_at; 11558 11559 /// 11560 // Sets the label for the specified |command_id|. Returns true (1) on success. 11561 /// 11562 extern(System) int function ( 11563 cef_menu_model_t* self, 11564 int command_id, 11565 const(cef_string_t)* label) nothrow set_label; 11566 11567 /// 11568 // Set the label at the specified |index|. Returns true (1) on success. 11569 /// 11570 extern(System) int function ( 11571 cef_menu_model_t* self, 11572 int index, 11573 const(cef_string_t)* label) nothrow set_label_at; 11574 11575 /// 11576 // Returns the item type for the specified |command_id|. 11577 /// 11578 extern(System) cef_menu_item_type_t function ( 11579 cef_menu_model_t* self, 11580 int command_id) nothrow get_type; 11581 11582 /// 11583 // Returns the item type at the specified |index|. 11584 /// 11585 extern(System) cef_menu_item_type_t function ( 11586 cef_menu_model_t* self, 11587 int index) nothrow get_type_at; 11588 11589 /// 11590 // Returns the group id for the specified |command_id| or -1 if invalid. 11591 /// 11592 extern(System) int function (cef_menu_model_t* self, int command_id) nothrow get_group_id; 11593 11594 /// 11595 // Returns the group id at the specified |index| or -1 if invalid. 11596 /// 11597 extern(System) int function (cef_menu_model_t* self, int index) nothrow get_group_id_at; 11598 11599 /// 11600 // Sets the group id for the specified |command_id|. Returns true (1) on 11601 // success. 11602 /// 11603 extern(System) int function ( 11604 cef_menu_model_t* self, 11605 int command_id, 11606 int group_id) nothrow set_group_id; 11607 11608 /// 11609 // Sets the group id at the specified |index|. Returns true (1) on success. 11610 /// 11611 extern(System) int function ( 11612 cef_menu_model_t* self, 11613 int index, 11614 int group_id) nothrow set_group_id_at; 11615 11616 /// 11617 // Returns the submenu for the specified |command_id| or NULL if invalid. 11618 /// 11619 extern(System) cef_menu_model_t* function ( 11620 cef_menu_model_t* self, 11621 int command_id) nothrow get_sub_menu; 11622 11623 /// 11624 // Returns the submenu at the specified |index| or NULL if invalid. 11625 /// 11626 extern(System) cef_menu_model_t* function ( 11627 cef_menu_model_t* self, 11628 int index) nothrow get_sub_menu_at; 11629 11630 /// 11631 // Returns true (1) if the specified |command_id| is visible. 11632 /// 11633 extern(System) int function (cef_menu_model_t* self, int command_id) nothrow is_visible; 11634 11635 /// 11636 // Returns true (1) if the specified |index| is visible. 11637 /// 11638 extern(System) int function (cef_menu_model_t* self, int index) nothrow is_visible_at; 11639 11640 /// 11641 // Change the visibility of the specified |command_id|. Returns true (1) on 11642 // success. 11643 /// 11644 extern(System) int function ( 11645 cef_menu_model_t* self, 11646 int command_id, 11647 int visible) nothrow set_visible; 11648 11649 /// 11650 // Change the visibility at the specified |index|. Returns true (1) on 11651 // success. 11652 /// 11653 extern(System) int function ( 11654 cef_menu_model_t* self, 11655 int index, 11656 int visible) nothrow set_visible_at; 11657 11658 /// 11659 // Returns true (1) if the specified |command_id| is enabled. 11660 /// 11661 extern(System) int function (cef_menu_model_t* self, int command_id) nothrow is_enabled; 11662 11663 /// 11664 // Returns true (1) if the specified |index| is enabled. 11665 /// 11666 extern(System) int function (cef_menu_model_t* self, int index) nothrow is_enabled_at; 11667 11668 /// 11669 // Change the enabled status of the specified |command_id|. Returns true (1) 11670 // on success. 11671 /// 11672 extern(System) int function ( 11673 cef_menu_model_t* self, 11674 int command_id, 11675 int enabled) nothrow set_enabled; 11676 11677 /// 11678 // Change the enabled status at the specified |index|. Returns true (1) on 11679 // success. 11680 /// 11681 extern(System) int function ( 11682 cef_menu_model_t* self, 11683 int index, 11684 int enabled) nothrow set_enabled_at; 11685 11686 /// 11687 // Returns true (1) if the specified |command_id| is checked. Only applies to 11688 // check and radio items. 11689 /// 11690 extern(System) int function (cef_menu_model_t* self, int command_id) nothrow is_checked; 11691 11692 /// 11693 // Returns true (1) if the specified |index| is checked. Only applies to check 11694 // and radio items. 11695 /// 11696 extern(System) int function (cef_menu_model_t* self, int index) nothrow is_checked_at; 11697 11698 /// 11699 // Check the specified |command_id|. Only applies to check and radio items. 11700 // Returns true (1) on success. 11701 /// 11702 extern(System) int function ( 11703 cef_menu_model_t* self, 11704 int command_id, 11705 int checked) nothrow set_checked; 11706 11707 /// 11708 // Check the specified |index|. Only applies to check and radio items. Returns 11709 // true (1) on success. 11710 /// 11711 extern(System) int function ( 11712 cef_menu_model_t* self, 11713 int index, 11714 int checked) nothrow set_checked_at; 11715 11716 /// 11717 // Returns true (1) if the specified |command_id| has a keyboard accelerator 11718 // assigned. 11719 /// 11720 extern(System) int function (cef_menu_model_t* self, int command_id) nothrow has_accelerator; 11721 11722 /// 11723 // Returns true (1) if the specified |index| has a keyboard accelerator 11724 // assigned. 11725 /// 11726 extern(System) int function (cef_menu_model_t* self, int index) nothrow has_accelerator_at; 11727 11728 /// 11729 // Set the keyboard accelerator for the specified |command_id|. |key_code| can 11730 // be any virtual key or character value. Returns true (1) on success. 11731 /// 11732 extern(System) int function ( 11733 cef_menu_model_t* self, 11734 int command_id, 11735 int key_code, 11736 int shift_pressed, 11737 int ctrl_pressed, 11738 int alt_pressed) nothrow set_accelerator; 11739 11740 /// 11741 // Set the keyboard accelerator at the specified |index|. |key_code| can be 11742 // any virtual key or character value. Returns true (1) on success. 11743 /// 11744 extern(System) int function ( 11745 cef_menu_model_t* self, 11746 int index, 11747 int key_code, 11748 int shift_pressed, 11749 int ctrl_pressed, 11750 int alt_pressed) nothrow set_accelerator_at; 11751 11752 /// 11753 // Remove the keyboard accelerator for the specified |command_id|. Returns 11754 // true (1) on success. 11755 /// 11756 extern(System) int function (cef_menu_model_t* self, int command_id) nothrow remove_accelerator; 11757 11758 /// 11759 // Remove the keyboard accelerator at the specified |index|. Returns true (1) 11760 // on success. 11761 /// 11762 extern(System) int function (cef_menu_model_t* self, int index) nothrow remove_accelerator_at; 11763 11764 /// 11765 // Retrieves the keyboard accelerator for the specified |command_id|. Returns 11766 // true (1) on success. 11767 /// 11768 extern(System) int function ( 11769 cef_menu_model_t* self, 11770 int command_id, 11771 int* key_code, 11772 int* shift_pressed, 11773 int* ctrl_pressed, 11774 int* alt_pressed) nothrow get_accelerator; 11775 11776 /// 11777 // Retrieves the keyboard accelerator for the specified |index|. Returns true 11778 // (1) on success. 11779 /// 11780 extern(System) int function ( 11781 cef_menu_model_t* self, 11782 int index, 11783 int* key_code, 11784 int* shift_pressed, 11785 int* ctrl_pressed, 11786 int* alt_pressed) nothrow get_accelerator_at; 11787 11788 /// 11789 // Set the explicit color for |command_id| and |color_type| to |color|. 11790 // Specify a |color| value of 0 to remove the explicit color. If no explicit 11791 // color or default color is set for |color_type| then the system color will 11792 // be used. Returns true (1) on success. 11793 /// 11794 extern(System) int function ( 11795 cef_menu_model_t* self, 11796 int command_id, 11797 cef_menu_color_type_t color_type, 11798 cef_color_t color) nothrow set_color; 11799 11800 /// 11801 // Set the explicit color for |command_id| and |index| to |color|. Specify a 11802 // |color| value of 0 to remove the explicit color. Specify an |index| value 11803 // of -1 to set the default color for items that do not have an explicit color 11804 // set. If no explicit color or default color is set for |color_type| then the 11805 // system color will be used. Returns true (1) on success. 11806 /// 11807 extern(System) int function ( 11808 cef_menu_model_t* self, 11809 int index, 11810 cef_menu_color_type_t color_type, 11811 cef_color_t color) nothrow set_color_at; 11812 11813 /// 11814 // Returns in |color| the color that was explicitly set for |command_id| and 11815 // |color_type|. If a color was not set then 0 will be returned in |color|. 11816 // Returns true (1) on success. 11817 /// 11818 extern(System) int function ( 11819 cef_menu_model_t* self, 11820 int command_id, 11821 cef_menu_color_type_t color_type, 11822 cef_color_t* color) nothrow get_color; 11823 11824 /// 11825 // Returns in |color| the color that was explicitly set for |command_id| and 11826 // |color_type|. Specify an |index| value of -1 to return the default color in 11827 // |color|. If a color was not set then 0 will be returned in |color|. Returns 11828 // true (1) on success. 11829 /// 11830 extern(System) int function ( 11831 cef_menu_model_t* self, 11832 int index, 11833 cef_menu_color_type_t color_type, 11834 cef_color_t* color) nothrow get_color_at; 11835 11836 /// 11837 // Sets the font list for the specified |command_id|. If |font_list| is NULL 11838 // the system font will be used. Returns true (1) on success. The format is 11839 // "<FONT_FAMILY_LIST>,[STYLES] <SIZE>", where: - FONT_FAMILY_LIST is a comma- 11840 // separated list of font family names, - STYLES is an optional space- 11841 // separated list of style names (case-sensitive 11842 // "Bold" and "Italic" are supported), and 11843 // - SIZE is an integer font size in pixels with the suffix "px". 11844 // 11845 // Here are examples of valid font description strings: - "Arial, Helvetica, 11846 // Bold Italic 14px" - "Arial, 14px" 11847 /// 11848 extern(System) int function ( 11849 cef_menu_model_t* self, 11850 int command_id, 11851 const(cef_string_t)* font_list) nothrow set_font_list; 11852 11853 /// 11854 // Sets the font list for the specified |index|. Specify an |index| value of 11855 // -1 to set the default font. If |font_list| is NULL the system font will be 11856 // used. Returns true (1) on success. The format is 11857 // "<FONT_FAMILY_LIST>,[STYLES] <SIZE>", where: - FONT_FAMILY_LIST is a comma- 11858 // separated list of font family names, - STYLES is an optional space- 11859 // separated list of style names (case-sensitive 11860 // "Bold" and "Italic" are supported), and 11861 // - SIZE is an integer font size in pixels with the suffix "px". 11862 // 11863 // Here are examples of valid font description strings: - "Arial, Helvetica, 11864 // Bold Italic 14px" - "Arial, 14px" 11865 /// 11866 extern(System) int function ( 11867 cef_menu_model_t* self, 11868 int index, 11869 const(cef_string_t)* font_list) nothrow set_font_list_at; 11870 } 11871 11872 11873 11874 /// 11875 // Create a new MenuModel with the specified |delegate|. 11876 /// 11877 cef_menu_model_t* cef_menu_model_create (cef_menu_model_delegate_t* delegate_); 11878 11879 // CEF_INCLUDE_CAPI_CEF_MENU_MODEL_CAPI_H_ 11880 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 11881 // 11882 // Redistribution and use in source and binary forms, with or without 11883 // modification, are permitted provided that the following conditions are 11884 // met: 11885 // 11886 // * Redistributions of source code must retain the above copyright 11887 // notice, this list of conditions and the following disclaimer. 11888 // * Redistributions in binary form must reproduce the above 11889 // copyright notice, this list of conditions and the following disclaimer 11890 // in the documentation and/or other materials provided with the 11891 // distribution. 11892 // * Neither the name of Google Inc. nor the name Chromium Embedded 11893 // Framework nor the names of its contributors may be used to endorse 11894 // or promote products derived from this software without specific prior 11895 // written permission. 11896 // 11897 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 11898 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 11899 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 11900 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 11901 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 11902 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 11903 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 11904 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 11905 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 11906 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 11907 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11908 // 11909 // --------------------------------------------------------------------------- 11910 // 11911 // This file was generated by the CEF translator tool and should not edited 11912 // by hand. See the translator.README.txt file in the tools directory for 11913 // more information. 11914 // 11915 // $hash=edc411cb0447a6c2965cdeb5f709fe56c43ec2bb$ 11916 // 11917 11918 extern (C): 11919 11920 11921 11922 /// 11923 // Implement this structure to handle menu model events. The functions of this 11924 // structure will be called on the browser process UI thread unless otherwise 11925 // indicated. 11926 /// 11927 struct cef_menu_model_delegate_t 11928 { 11929 /// 11930 // Base structure. 11931 /// 11932 cef_base_ref_counted_t base; 11933 11934 /// 11935 // Perform the action associated with the specified |command_id| and optional 11936 // |event_flags|. 11937 /// 11938 extern(System) void function ( 11939 cef_menu_model_delegate_t* self, 11940 cef_menu_model_t* menu_model, 11941 int command_id, 11942 cef_event_flags_t event_flags) nothrow execute_command; 11943 11944 /// 11945 // Called when the user moves the mouse outside the menu and over the owning 11946 // window. 11947 /// 11948 extern(System) void function ( 11949 cef_menu_model_delegate_t* self, 11950 cef_menu_model_t* menu_model, 11951 const(cef_point_t)* screen_point) nothrow mouse_outside_menu; 11952 11953 /// 11954 // Called on unhandled open submenu keyboard commands. |is_rtl| will be true 11955 // (1) if the menu is displaying a right-to-left language. 11956 /// 11957 extern(System) void function ( 11958 cef_menu_model_delegate_t* self, 11959 cef_menu_model_t* menu_model, 11960 int is_rtl) nothrow unhandled_open_submenu; 11961 11962 /// 11963 // Called on unhandled close submenu keyboard commands. |is_rtl| will be true 11964 // (1) if the menu is displaying a right-to-left language. 11965 /// 11966 extern(System) void function ( 11967 cef_menu_model_delegate_t* self, 11968 cef_menu_model_t* menu_model, 11969 int is_rtl) nothrow unhandled_close_submenu; 11970 11971 /// 11972 // The menu is about to show. 11973 /// 11974 extern(System) void function ( 11975 cef_menu_model_delegate_t* self, 11976 cef_menu_model_t* menu_model) nothrow menu_will_show; 11977 11978 /// 11979 // The menu has closed. 11980 /// 11981 extern(System) void function ( 11982 cef_menu_model_delegate_t* self, 11983 cef_menu_model_t* menu_model) nothrow menu_closed; 11984 11985 /// 11986 // Optionally modify a menu item label. Return true (1) if |label| was 11987 // modified. 11988 /// 11989 extern(System) int function ( 11990 cef_menu_model_delegate_t* self, 11991 cef_menu_model_t* menu_model, 11992 cef_string_t* label) nothrow format_label; 11993 } 11994 11995 11996 11997 // CEF_INCLUDE_CAPI_CEF_MENU_MODEL_DELEGATE_CAPI_H_ 11998 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 11999 // 12000 // Redistribution and use in source and binary forms, with or without 12001 // modification, are permitted provided that the following conditions are 12002 // met: 12003 // 12004 // * Redistributions of source code must retain the above copyright 12005 // notice, this list of conditions and the following disclaimer. 12006 // * Redistributions in binary form must reproduce the above 12007 // copyright notice, this list of conditions and the following disclaimer 12008 // in the documentation and/or other materials provided with the 12009 // distribution. 12010 // * Neither the name of Google Inc. nor the name Chromium Embedded 12011 // Framework nor the names of its contributors may be used to endorse 12012 // or promote products derived from this software without specific prior 12013 // written permission. 12014 // 12015 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 12016 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 12017 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 12018 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 12019 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 12020 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 12021 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 12022 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 12023 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 12024 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 12025 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12026 // 12027 // --------------------------------------------------------------------------- 12028 // 12029 // This file was generated by the CEF translator tool and should not edited 12030 // by hand. See the translator.README.txt file in the tools directory for 12031 // more information. 12032 // 12033 // $hash=f14afbd6941bcb37b14cce81569882512c3d7194$ 12034 // 12035 12036 extern (C): 12037 12038 /// 12039 // Structure used to represent an entry in navigation history. 12040 /// 12041 struct cef_navigation_entry_t 12042 { 12043 /// 12044 // Base structure. 12045 /// 12046 cef_base_ref_counted_t base; 12047 12048 /// 12049 // Returns true (1) if this object is valid. Do not call any other functions 12050 // if this function returns false (0). 12051 /// 12052 extern(System) int function (cef_navigation_entry_t* self) nothrow is_valid; 12053 12054 /// 12055 // Returns the actual URL of the page. For some pages this may be data: URL or 12056 // similar. Use get_display_url() to return a display-friendly version. 12057 /// 12058 // The resulting string must be freed by calling cef_string_userfree_free(). 12059 extern(System) cef_string_userfree_t function (cef_navigation_entry_t* self) nothrow get_url; 12060 12061 /// 12062 // Returns a display-friendly version of the URL. 12063 /// 12064 // The resulting string must be freed by calling cef_string_userfree_free(). 12065 extern(System) cef_string_userfree_t function ( 12066 cef_navigation_entry_t* self) nothrow get_display_url; 12067 12068 /// 12069 // Returns the original URL that was entered by the user before any redirects. 12070 /// 12071 // The resulting string must be freed by calling cef_string_userfree_free(). 12072 extern(System) cef_string_userfree_t function ( 12073 cef_navigation_entry_t* self) nothrow get_original_url; 12074 12075 /// 12076 // Returns the title set by the page. This value may be NULL. 12077 /// 12078 // The resulting string must be freed by calling cef_string_userfree_free(). 12079 extern(System) cef_string_userfree_t function (cef_navigation_entry_t* self) nothrow get_title; 12080 12081 /// 12082 // Returns the transition type which indicates what the user did to move to 12083 // this page from the previous page. 12084 /// 12085 extern(System) cef_transition_type_t function ( 12086 cef_navigation_entry_t* self) nothrow get_transition_type; 12087 12088 /// 12089 // Returns true (1) if this navigation includes post data. 12090 /// 12091 extern(System) int function (cef_navigation_entry_t* self) nothrow has_post_data; 12092 12093 /// 12094 // Returns the time for the last known successful navigation completion. A 12095 // navigation may be completed more than once if the page is reloaded. May be 12096 // 0 if the navigation has not yet completed. 12097 /// 12098 extern(System) cef_time_t function (cef_navigation_entry_t* self) nothrow get_completion_time; 12099 12100 /// 12101 // Returns the HTTP status code for the last known successful navigation 12102 // response. May be 0 if the response has not yet been received or if the 12103 // navigation has not yet completed. 12104 /// 12105 extern(System) int function (cef_navigation_entry_t* self) nothrow get_http_status_code; 12106 12107 /// 12108 // Returns the SSL information for this navigation entry. 12109 /// 12110 extern(System) cef_sslstatus_t* function (cef_navigation_entry_t* self) nothrow get_sslstatus; 12111 } 12112 12113 12114 12115 // CEF_INCLUDE_CAPI_CEF_NAVIGATION_ENTRY_CAPI_H_ 12116 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 12117 // 12118 // Redistribution and use in source and binary forms, with or without 12119 // modification, are permitted provided that the following conditions are 12120 // met: 12121 // 12122 // * Redistributions of source code must retain the above copyright 12123 // notice, this list of conditions and the following disclaimer. 12124 // * Redistributions in binary form must reproduce the above 12125 // copyright notice, this list of conditions and the following disclaimer 12126 // in the documentation and/or other materials provided with the 12127 // distribution. 12128 // * Neither the name of Google Inc. nor the name Chromium Embedded 12129 // Framework nor the names of its contributors may be used to endorse 12130 // or promote products derived from this software without specific prior 12131 // written permission. 12132 // 12133 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 12134 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 12135 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 12136 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 12137 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 12138 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 12139 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 12140 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 12141 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 12142 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 12143 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12144 // 12145 // --------------------------------------------------------------------------- 12146 // 12147 // This file was generated by the CEF translator tool and should not edited 12148 // by hand. See the translator.README.txt file in the tools directory for 12149 // more information. 12150 // 12151 // $hash=6798e6147540596c1abac8c7457d9d1d4d99bd54$ 12152 // 12153 12154 extern (C): 12155 12156 /// 12157 // Add an entry to the cross-origin access whitelist. 12158 // 12159 // The same-origin policy restricts how scripts hosted from different origins 12160 // (scheme + domain + port) can communicate. By default, scripts can only access 12161 // resources with the same origin. Scripts hosted on the HTTP and HTTPS schemes 12162 // (but no other schemes) can use the "Access-Control-Allow-Origin" header to 12163 // allow cross-origin requests. For example, https://source.example.com can make 12164 // XMLHttpRequest requests on http://target.example.com if the 12165 // http://target.example.com request returns an "Access-Control-Allow-Origin: 12166 // https://source.example.com" response header. 12167 // 12168 // Scripts in separate frames or iframes and hosted from the same protocol and 12169 // domain suffix can execute cross-origin JavaScript if both pages set the 12170 // document.domain value to the same domain suffix. For example, 12171 // scheme://foo.example.com and scheme://bar.example.com can communicate using 12172 // JavaScript if both domains set document.domain="example.com". 12173 // 12174 // This function is used to allow access to origins that would otherwise violate 12175 // the same-origin policy. Scripts hosted underneath the fully qualified 12176 // |source_origin| URL (like http://www.example.com) will be allowed access to 12177 // all resources hosted on the specified |target_protocol| and |target_domain|. 12178 // If |target_domain| is non-NULL and |allow_target_subdomains| if false (0) 12179 // only exact domain matches will be allowed. If |target_domain| contains a top- 12180 // level domain component (like "example.com") and |allow_target_subdomains| is 12181 // true (1) sub-domain matches will be allowed. If |target_domain| is NULL and 12182 // |allow_target_subdomains| if true (1) all domains and IP addresses will be 12183 // allowed. 12184 // 12185 // This function cannot be used to bypass the restrictions on local or display 12186 // isolated schemes. See the comments on CefRegisterCustomScheme for more 12187 // information. 12188 // 12189 // This function may be called on any thread. Returns false (0) if 12190 // |source_origin| is invalid or the whitelist cannot be accessed. 12191 /// 12192 int cef_add_cross_origin_whitelist_entry ( 12193 const(cef_string_t)* source_origin, 12194 const(cef_string_t)* target_protocol, 12195 const(cef_string_t)* target_domain, 12196 int allow_target_subdomains); 12197 12198 /// 12199 // Remove an entry from the cross-origin access whitelist. Returns false (0) if 12200 // |source_origin| is invalid or the whitelist cannot be accessed. 12201 /// 12202 int cef_remove_cross_origin_whitelist_entry ( 12203 const(cef_string_t)* source_origin, 12204 const(cef_string_t)* target_protocol, 12205 const(cef_string_t)* target_domain, 12206 int allow_target_subdomains); 12207 12208 /// 12209 // Remove all entries from the cross-origin access whitelist. Returns false (0) 12210 // if the whitelist cannot be accessed. 12211 /// 12212 int cef_clear_cross_origin_whitelist (); 12213 12214 // CEF_INCLUDE_CAPI_CEF_ORIGIN_WHITELIST_CAPI_H_ 12215 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 12216 // 12217 // Redistribution and use in source and binary forms, with or without 12218 // modification, are permitted provided that the following conditions are 12219 // met: 12220 // 12221 // * Redistributions of source code must retain the above copyright 12222 // notice, this list of conditions and the following disclaimer. 12223 // * Redistributions in binary form must reproduce the above 12224 // copyright notice, this list of conditions and the following disclaimer 12225 // in the documentation and/or other materials provided with the 12226 // distribution. 12227 // * Neither the name of Google Inc. nor the name Chromium Embedded 12228 // Framework nor the names of its contributors may be used to endorse 12229 // or promote products derived from this software without specific prior 12230 // written permission. 12231 // 12232 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 12233 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 12234 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 12235 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 12236 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 12237 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 12238 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 12239 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 12240 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 12241 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 12242 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12243 // 12244 // --------------------------------------------------------------------------- 12245 // 12246 // This file was generated by the CEF translator tool and should not edited 12247 // by hand. See the translator.README.txt file in the tools directory for 12248 // more information. 12249 // 12250 // $hash=84149324b177c47287b935dcb3d5900a33acfdf5$ 12251 // 12252 12253 extern (C): 12254 12255 /// 12256 // Parse the specified |url| into its component parts. Returns false (0) if the 12257 // URL is NULL or invalid. 12258 /// 12259 int cef_parse_url (const(cef_string_t)* url, cef_urlparts_t* parts); 12260 12261 /// 12262 // Creates a URL from the specified |parts|, which must contain a non-NULL spec 12263 // or a non-NULL host and path (at a minimum), but not both. Returns false (0) 12264 // if |parts| isn't initialized as described. 12265 /// 12266 int cef_create_url (const(cef_urlparts_t)* parts, cef_string_t* url); 12267 12268 /// 12269 // This is a convenience function for formatting a URL in a concise and human- 12270 // friendly way to help users make security-related decisions (or in other 12271 // circumstances when people need to distinguish sites, origins, or otherwise- 12272 // simplified URLs from each other). Internationalized domain names (IDN) may be 12273 // presented in Unicode if the conversion is considered safe. The returned value 12274 // will (a) omit the path for standard schemes, excepting file and filesystem, 12275 // and (b) omit the port if it is the default for the scheme. Do not use this 12276 // for URLs which will be parsed or sent to other applications. 12277 /// 12278 // The resulting string must be freed by calling cef_string_userfree_free(). 12279 cef_string_userfree_t cef_format_url_for_security_display ( 12280 const(cef_string_t)* origin_url); 12281 12282 /// 12283 // Returns the mime type for the specified file extension or an NULL string if 12284 // unknown. 12285 /// 12286 // The resulting string must be freed by calling cef_string_userfree_free(). 12287 cef_string_userfree_t cef_get_mime_type (const(cef_string_t)* extension); 12288 12289 /// 12290 // Get the extensions associated with the given mime type. This should be passed 12291 // in lower case. There could be multiple extensions for a given mime type, like 12292 // "html,htm" for "text/html", or "txt,text,html,..." for "text/*". Any existing 12293 // elements in the provided vector will not be erased. 12294 /// 12295 void cef_get_extensions_for_mime_type ( 12296 const(cef_string_t)* mime_type, 12297 cef_string_list_t extensions); 12298 12299 /// 12300 // Encodes |data| as a base64 string. 12301 /// 12302 // The resulting string must be freed by calling cef_string_userfree_free(). 12303 cef_string_userfree_t cef_base64encode (const(void)* data, size_t data_size); 12304 12305 /// 12306 // Decodes the base64 encoded string |data|. The returned value will be NULL if 12307 // the decoding fails. 12308 /// 12309 12310 cef_binary_value_t* cef_base64decode (const(cef_string_t)* data); 12311 12312 /// 12313 // Escapes characters in |text| which are unsuitable for use as a query 12314 // parameter value. Everything except alphanumerics and -_.!~*'() will be 12315 // converted to "%XX". If |use_plus| is true (1) spaces will change to "+". The 12316 // result is basically the same as encodeURIComponent in Javacript. 12317 /// 12318 // The resulting string must be freed by calling cef_string_userfree_free(). 12319 cef_string_userfree_t cef_uriencode (const(cef_string_t)* text, int use_plus); 12320 12321 /// 12322 // Unescapes |text| and returns the result. Unescaping consists of looking for 12323 // the exact pattern "%XX" where each X is a hex digit and converting to the 12324 // character with the numerical value of those digits (e.g. "i%20=%203%3b" 12325 // unescapes to "i = 3;"). If |convert_to_utf8| is true (1) this function will 12326 // attempt to interpret the initial decoded result as UTF-8. If the result is 12327 // convertable into UTF-8 it will be returned as converted. Otherwise the 12328 // initial decoded result will be returned. The |unescape_rule| parameter 12329 // supports further customization the decoding process. 12330 /// 12331 // The resulting string must be freed by calling cef_string_userfree_free(). 12332 cef_string_userfree_t cef_uridecode ( 12333 const(cef_string_t)* text, 12334 int convert_to_utf8, 12335 cef_uri_unescape_rule_t unescape_rule); 12336 12337 /// 12338 // Parses the specified |json_string| and returns a dictionary or list 12339 // representation. If JSON parsing fails this function returns NULL. 12340 /// 12341 12342 cef_value_t* cef_parse_json ( 12343 const(cef_string_t)* json_string, 12344 cef_json_parser_options_t options); 12345 12346 /// 12347 // Parses the specified UTF8-encoded |json| buffer of size |json_size| and 12348 // returns a dictionary or list representation. If JSON parsing fails this 12349 // function returns NULL. 12350 /// 12351 cef_value_t* cef_parse_json_buffer ( 12352 const(void)* json, 12353 size_t json_size, 12354 cef_json_parser_options_t options); 12355 12356 /// 12357 // Parses the specified |json_string| and returns a dictionary or list 12358 // representation. If JSON parsing fails this function returns NULL and 12359 // populates |error_msg_out| with a formatted error message. 12360 /// 12361 cef_value_t* cef_parse_jsonand_return_error ( 12362 const(cef_string_t)* json_string, 12363 cef_json_parser_options_t options, 12364 cef_string_t* error_msg_out); 12365 12366 /// 12367 // Generates a JSON string from the specified root |node| which should be a 12368 // dictionary or list value. Returns an NULL string on failure. This function 12369 // requires exclusive access to |node| including any underlying data. 12370 /// 12371 // The resulting string must be freed by calling cef_string_userfree_free(). 12372 cef_string_userfree_t cef_write_json ( 12373 cef_value_t* node, 12374 cef_json_writer_options_t options); 12375 12376 // CEF_INCLUDE_CAPI_CEF_PARSER_CAPI_H_ 12377 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 12378 // 12379 // Redistribution and use in source and binary forms, with or without 12380 // modification, are permitted provided that the following conditions are 12381 // met: 12382 // 12383 // * Redistributions of source code must retain the above copyright 12384 // notice, this list of conditions and the following disclaimer. 12385 // * Redistributions in binary form must reproduce the above 12386 // copyright notice, this list of conditions and the following disclaimer 12387 // in the documentation and/or other materials provided with the 12388 // distribution. 12389 // * Neither the name of Google Inc. nor the name Chromium Embedded 12390 // Framework nor the names of its contributors may be used to endorse 12391 // or promote products derived from this software without specific prior 12392 // written permission. 12393 // 12394 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 12395 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 12396 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 12397 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 12398 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 12399 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 12400 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 12401 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 12402 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 12403 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 12404 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12405 // 12406 // --------------------------------------------------------------------------- 12407 // 12408 // This file was generated by the CEF translator tool and should not edited 12409 // by hand. See the translator.README.txt file in the tools directory for 12410 // more information. 12411 // 12412 // $hash=0ae1fe7f7141eb05eb7fd44c2d41e4c576afae1e$ 12413 // 12414 12415 extern (C): 12416 12417 /// 12418 // Retrieve the path associated with the specified |key|. Returns true (1) on 12419 // success. Can be called on any thread in the browser process. 12420 /// 12421 int cef_get_path (cef_path_key_t key, cef_string_t* path); 12422 12423 // CEF_INCLUDE_CAPI_CEF_PATH_UTIL_CAPI_H_ 12424 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 12425 // 12426 // Redistribution and use in source and binary forms, with or without 12427 // modification, are permitted provided that the following conditions are 12428 // met: 12429 // 12430 // * Redistributions of source code must retain the above copyright 12431 // notice, this list of conditions and the following disclaimer. 12432 // * Redistributions in binary form must reproduce the above 12433 // copyright notice, this list of conditions and the following disclaimer 12434 // in the documentation and/or other materials provided with the 12435 // distribution. 12436 // * Neither the name of Google Inc. nor the name Chromium Embedded 12437 // Framework nor the names of its contributors may be used to endorse 12438 // or promote products derived from this software without specific prior 12439 // written permission. 12440 // 12441 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 12442 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 12443 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 12444 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 12445 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 12446 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 12447 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 12448 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 12449 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 12450 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 12451 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12452 // 12453 // --------------------------------------------------------------------------- 12454 // 12455 // This file was generated by the CEF translator tool and should not edited 12456 // by hand. See the translator.README.txt file in the tools directory for 12457 // more information. 12458 // 12459 // $hash=84fc58b3898f25476d9cdd260553390ba5e0b30b$ 12460 // 12461 12462 extern (C): 12463 12464 /// 12465 // Callback structure for asynchronous continuation of print dialog requests. 12466 /// 12467 struct cef_print_dialog_callback_t 12468 { 12469 /// 12470 // Base structure. 12471 /// 12472 cef_base_ref_counted_t base; 12473 12474 /// 12475 // Continue printing with the specified |settings|. 12476 /// 12477 extern(System) void function ( 12478 cef_print_dialog_callback_t* self, 12479 cef_print_settings_t* settings) nothrow cont; 12480 12481 /// 12482 // Cancel the printing. 12483 /// 12484 extern(System) void function (cef_print_dialog_callback_t* self) nothrow cancel; 12485 } 12486 12487 12488 12489 /// 12490 // Callback structure for asynchronous continuation of print job requests. 12491 /// 12492 struct cef_print_job_callback_t 12493 { 12494 /// 12495 // Base structure. 12496 /// 12497 cef_base_ref_counted_t base; 12498 12499 /// 12500 // Indicate completion of the print job. 12501 /// 12502 extern(System) void function (cef_print_job_callback_t* self) nothrow cont; 12503 } 12504 12505 12506 12507 /// 12508 // Implement this structure to handle printing on Linux. Each browser will have 12509 // only one print job in progress at a time. The functions of this structure 12510 // will be called on the browser process UI thread. 12511 /// 12512 struct cef_print_handler_t 12513 { 12514 /// 12515 // Base structure. 12516 /// 12517 cef_base_ref_counted_t base; 12518 12519 /// 12520 // Called when printing has started for the specified |browser|. This function 12521 // will be called before the other OnPrint*() functions and irrespective of 12522 // how printing was initiated (e.g. cef_browser_host_t::print(), JavaScript 12523 // window.print() or PDF extension print button). 12524 /// 12525 extern(System) void function ( 12526 cef_print_handler_t* self, 12527 cef_browser_t* browser) nothrow on_print_start; 12528 12529 /// 12530 // Synchronize |settings| with client state. If |get_defaults| is true (1) 12531 // then populate |settings| with the default print settings. Do not keep a 12532 // reference to |settings| outside of this callback. 12533 /// 12534 extern(System) void function ( 12535 cef_print_handler_t* self, 12536 cef_browser_t* browser, 12537 cef_print_settings_t* settings, 12538 int get_defaults) nothrow on_print_settings; 12539 12540 /// 12541 // Show the print dialog. Execute |callback| once the dialog is dismissed. 12542 // Return true (1) if the dialog will be displayed or false (0) to cancel the 12543 // printing immediately. 12544 /// 12545 extern(System) int function ( 12546 cef_print_handler_t* self, 12547 cef_browser_t* browser, 12548 int has_selection, 12549 cef_print_dialog_callback_t* callback) nothrow on_print_dialog; 12550 12551 /// 12552 // Send the print job to the printer. Execute |callback| once the job is 12553 // completed. Return true (1) if the job will proceed or false (0) to cancel 12554 // the job immediately. 12555 /// 12556 extern(System) int function ( 12557 cef_print_handler_t* self, 12558 cef_browser_t* browser, 12559 const(cef_string_t)* document_name, 12560 const(cef_string_t)* pdf_file_path, 12561 cef_print_job_callback_t* callback) nothrow on_print_job; 12562 12563 /// 12564 // Reset client state related to printing. 12565 /// 12566 extern(System) void function ( 12567 cef_print_handler_t* self, 12568 cef_browser_t* browser) nothrow on_print_reset; 12569 12570 /// 12571 // Return the PDF paper size in device units. Used in combination with 12572 // cef_browser_host_t::print_to_pdf(). 12573 /// 12574 extern(System) cef_size_t function ( 12575 cef_print_handler_t* self, 12576 cef_browser_t* browser, 12577 int device_units_per_inch) nothrow get_pdf_paper_size; 12578 } 12579 12580 12581 12582 // CEF_INCLUDE_CAPI_CEF_PRINT_HANDLER_CAPI_H_ 12583 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 12584 // 12585 // Redistribution and use in source and binary forms, with or without 12586 // modification, are permitted provided that the following conditions are 12587 // met: 12588 // 12589 // * Redistributions of source code must retain the above copyright 12590 // notice, this list of conditions and the following disclaimer. 12591 // * Redistributions in binary form must reproduce the above 12592 // copyright notice, this list of conditions and the following disclaimer 12593 // in the documentation and/or other materials provided with the 12594 // distribution. 12595 // * Neither the name of Google Inc. nor the name Chromium Embedded 12596 // Framework nor the names of its contributors may be used to endorse 12597 // or promote products derived from this software without specific prior 12598 // written permission. 12599 // 12600 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 12601 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 12602 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 12603 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 12604 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 12605 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 12606 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 12607 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 12608 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 12609 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 12610 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12611 // 12612 // --------------------------------------------------------------------------- 12613 // 12614 // This file was generated by the CEF translator tool and should not edited 12615 // by hand. See the translator.README.txt file in the tools directory for 12616 // more information. 12617 // 12618 // $hash=4b52323c4ce2d0ebcc3438e16fc9a9b181a58adc$ 12619 // 12620 12621 extern (C): 12622 12623 /// 12624 // Structure representing print settings. 12625 /// 12626 struct cef_print_settings_t 12627 { 12628 /// 12629 // Base structure. 12630 /// 12631 cef_base_ref_counted_t base; 12632 12633 /// 12634 // Returns true (1) if this object is valid. Do not call any other functions 12635 // if this function returns false (0). 12636 /// 12637 extern(System) int function (cef_print_settings_t* self) nothrow is_valid; 12638 12639 /// 12640 // Returns true (1) if the values of this object are read-only. Some APIs may 12641 // expose read-only objects. 12642 /// 12643 extern(System) int function (cef_print_settings_t* self) nothrow is_read_only; 12644 12645 /// 12646 // Set the page orientation. 12647 /// 12648 extern(System) void function (cef_print_settings_t* self, int landscape) nothrow set_orientation; 12649 12650 /// 12651 // Returns true (1) if the orientation is landscape. 12652 /// 12653 extern(System) int function (cef_print_settings_t* self) nothrow is_landscape; 12654 12655 /// 12656 // Set the printer printable area in device units. Some platforms already 12657 // provide flipped area. Set |landscape_needs_flip| to false (0) on those 12658 // platforms to avoid double flipping. 12659 /// 12660 extern(System) void function ( 12661 cef_print_settings_t* self, 12662 const(cef_size_t)* physical_size_device_units, 12663 const(cef_rect_t)* printable_area_device_units, 12664 int landscape_needs_flip) nothrow set_printer_printable_area; 12665 12666 /// 12667 // Set the device name. 12668 /// 12669 extern(System) void function ( 12670 cef_print_settings_t* self, 12671 const(cef_string_t)* name) nothrow set_device_name; 12672 12673 /// 12674 // Get the device name. 12675 /// 12676 // The resulting string must be freed by calling cef_string_userfree_free(). 12677 extern(System) cef_string_userfree_t function ( 12678 cef_print_settings_t* self) nothrow get_device_name; 12679 12680 /// 12681 // Set the DPI (dots per inch). 12682 /// 12683 extern(System) void function (cef_print_settings_t* self, int dpi) nothrow set_dpi; 12684 12685 /// 12686 // Get the DPI (dots per inch). 12687 /// 12688 extern(System) int function (cef_print_settings_t* self) nothrow get_dpi; 12689 12690 /// 12691 // Set the page ranges. 12692 /// 12693 extern(System) void function ( 12694 cef_print_settings_t* self, 12695 size_t rangesCount, 12696 const(cef_range_t)* ranges) nothrow set_page_ranges; 12697 12698 /// 12699 // Returns the number of page ranges that currently exist. 12700 /// 12701 extern(System) size_t function (cef_print_settings_t* self) nothrow get_page_ranges_count; 12702 12703 /// 12704 // Retrieve the page ranges. 12705 /// 12706 extern(System) void function ( 12707 cef_print_settings_t* self, 12708 size_t* rangesCount, 12709 cef_range_t* ranges) nothrow get_page_ranges; 12710 12711 /// 12712 // Set whether only the selection will be printed. 12713 /// 12714 extern(System) void function ( 12715 cef_print_settings_t* self, 12716 int selection_only) nothrow set_selection_only; 12717 12718 /// 12719 // Returns true (1) if only the selection will be printed. 12720 /// 12721 extern(System) int function (cef_print_settings_t* self) nothrow is_selection_only; 12722 12723 /// 12724 // Set whether pages will be collated. 12725 /// 12726 extern(System) void function (cef_print_settings_t* self, int collate) nothrow set_collate; 12727 12728 /// 12729 // Returns true (1) if pages will be collated. 12730 /// 12731 extern(System) int function (cef_print_settings_t* self) nothrow will_collate; 12732 12733 /// 12734 // Set the color model. 12735 /// 12736 extern(System) void function ( 12737 cef_print_settings_t* self, 12738 cef_color_model_t model) nothrow set_color_model; 12739 12740 /// 12741 // Get the color model. 12742 /// 12743 extern(System) cef_color_model_t function (cef_print_settings_t* self) nothrow get_color_model; 12744 12745 /// 12746 // Set the number of copies. 12747 /// 12748 extern(System) void function (cef_print_settings_t* self, int copies) nothrow set_copies; 12749 12750 /// 12751 // Get the number of copies. 12752 /// 12753 extern(System) int function (cef_print_settings_t* self) nothrow get_copies; 12754 12755 /// 12756 // Set the duplex mode. 12757 /// 12758 extern(System) void function ( 12759 cef_print_settings_t* self, 12760 cef_duplex_mode_t mode) nothrow set_duplex_mode; 12761 12762 /// 12763 // Get the duplex mode. 12764 /// 12765 extern(System) cef_duplex_mode_t function (cef_print_settings_t* self) nothrow get_duplex_mode; 12766 } 12767 12768 12769 12770 /// 12771 // Create a new cef_print_settings_t object. 12772 /// 12773 cef_print_settings_t* cef_print_settings_create (); 12774 12775 // CEF_INCLUDE_CAPI_CEF_PRINT_SETTINGS_CAPI_H_ 12776 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 12777 // 12778 // Redistribution and use in source and binary forms, with or without 12779 // modification, are permitted provided that the following conditions are 12780 // met: 12781 // 12782 // * Redistributions of source code must retain the above copyright 12783 // notice, this list of conditions and the following disclaimer. 12784 // * Redistributions in binary form must reproduce the above 12785 // copyright notice, this list of conditions and the following disclaimer 12786 // in the documentation and/or other materials provided with the 12787 // distribution. 12788 // * Neither the name of Google Inc. nor the name Chromium Embedded 12789 // Framework nor the names of its contributors may be used to endorse 12790 // or promote products derived from this software without specific prior 12791 // written permission. 12792 // 12793 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 12794 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 12795 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 12796 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 12797 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 12798 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 12799 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 12800 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 12801 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 12802 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 12803 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12804 // 12805 // --------------------------------------------------------------------------- 12806 // 12807 // This file was generated by the CEF translator tool and should not edited 12808 // by hand. See the translator.README.txt file in the tools directory for 12809 // more information. 12810 // 12811 // $hash=53ff22b73527aa331d2bd96e008f4cb4f0413042$ 12812 // 12813 12814 extern (C): 12815 12816 /// 12817 // Structure representing a message. Can be used on any process and thread. 12818 /// 12819 struct cef_process_message_t 12820 { 12821 /// 12822 // Base structure. 12823 /// 12824 cef_base_ref_counted_t base; 12825 12826 /// 12827 // Returns true (1) if this object is valid. Do not call any other functions 12828 // if this function returns false (0). 12829 /// 12830 extern(System) int function (cef_process_message_t* self) nothrow is_valid; 12831 12832 /// 12833 // Returns true (1) if the values of this object are read-only. Some APIs may 12834 // expose read-only objects. 12835 /// 12836 extern(System) int function (cef_process_message_t* self) nothrow is_read_only; 12837 12838 /// 12839 // Returns a writable copy of this object. 12840 /// 12841 extern(System) cef_process_message_t* function (cef_process_message_t* self) nothrow copy; 12842 12843 /// 12844 // Returns the message name. 12845 /// 12846 // The resulting string must be freed by calling cef_string_userfree_free(). 12847 extern(System) cef_string_userfree_t function (cef_process_message_t* self) nothrow get_name; 12848 12849 /// 12850 // Returns the list of arguments. 12851 /// 12852 extern(System) cef_list_value_t* function ( 12853 cef_process_message_t* self) nothrow get_argument_list; 12854 } 12855 12856 12857 12858 /// 12859 // Create a new cef_process_message_t object with the specified name. 12860 /// 12861 cef_process_message_t* cef_process_message_create (const(cef_string_t)* name); 12862 12863 // CEF_INCLUDE_CAPI_CEF_PROCESS_MESSAGE_CAPI_H_ 12864 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 12865 // 12866 // Redistribution and use in source and binary forms, with or without 12867 // modification, are permitted provided that the following conditions are 12868 // met: 12869 // 12870 // * Redistributions of source code must retain the above copyright 12871 // notice, this list of conditions and the following disclaimer. 12872 // * Redistributions in binary form must reproduce the above 12873 // copyright notice, this list of conditions and the following disclaimer 12874 // in the documentation and/or other materials provided with the 12875 // distribution. 12876 // * Neither the name of Google Inc. nor the name Chromium Embedded 12877 // Framework nor the names of its contributors may be used to endorse 12878 // or promote products derived from this software without specific prior 12879 // written permission. 12880 // 12881 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 12882 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 12883 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 12884 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 12885 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 12886 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 12887 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 12888 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 12889 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 12890 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 12891 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12892 // 12893 // --------------------------------------------------------------------------- 12894 // 12895 // This file was generated by the CEF translator tool and should not edited 12896 // by hand. See the translator.README.txt file in the tools directory for 12897 // more information. 12898 // 12899 // $hash=c476a8d22852994d9d9695db901efaef13bbfc9d$ 12900 // 12901 12902 extern (C): 12903 12904 /// 12905 // Launches the process specified via |command_line|. Returns true (1) upon 12906 // success. Must be called on the browser process TID_PROCESS_LAUNCHER thread. 12907 // 12908 // Unix-specific notes: - All file descriptors open in the parent process will 12909 // be closed in the 12910 // child process except for stdin, stdout, and stderr. 12911 // - If the first argument on the command line does not contain a slash, 12912 // PATH will be searched. (See man execvp.) 12913 /// 12914 int cef_launch_process (cef_command_line_t* command_line); 12915 12916 // CEF_INCLUDE_CAPI_CEF_PROCESS_UTIL_CAPI_H_ 12917 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 12918 // 12919 // Redistribution and use in source and binary forms, with or without 12920 // modification, are permitted provided that the following conditions are 12921 // met: 12922 // 12923 // * Redistributions of source code must retain the above copyright 12924 // notice, this list of conditions and the following disclaimer. 12925 // * Redistributions in binary form must reproduce the above 12926 // copyright notice, this list of conditions and the following disclaimer 12927 // in the documentation and/or other materials provided with the 12928 // distribution. 12929 // * Neither the name of Google Inc. nor the name Chromium Embedded 12930 // Framework nor the names of its contributors may be used to endorse 12931 // or promote products derived from this software without specific prior 12932 // written permission. 12933 // 12934 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 12935 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 12936 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 12937 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 12938 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 12939 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 12940 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 12941 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 12942 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 12943 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 12944 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12945 // 12946 // --------------------------------------------------------------------------- 12947 // 12948 // This file was generated by the CEF translator tool and should not edited 12949 // by hand. See the translator.README.txt file in the tools directory for 12950 // more information. 12951 // 12952 // $hash=8cde223bdb8d25ff163edd95da0d9e238b298016$ 12953 // 12954 12955 extern (C): 12956 12957 /// 12958 // Generic callback structure used for managing the lifespan of a registration. 12959 /// 12960 struct cef_registration_t 12961 { 12962 /// 12963 // Base structure. 12964 /// 12965 cef_base_ref_counted_t base; 12966 } 12967 12968 12969 12970 // CEF_INCLUDE_CAPI_CEF_REGISTRATION_CAPI_H_ 12971 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 12972 // 12973 // Redistribution and use in source and binary forms, with or without 12974 // modification, are permitted provided that the following conditions are 12975 // met: 12976 // 12977 // * Redistributions of source code must retain the above copyright 12978 // notice, this list of conditions and the following disclaimer. 12979 // * Redistributions in binary form must reproduce the above 12980 // copyright notice, this list of conditions and the following disclaimer 12981 // in the documentation and/or other materials provided with the 12982 // distribution. 12983 // * Neither the name of Google Inc. nor the name Chromium Embedded 12984 // Framework nor the names of its contributors may be used to endorse 12985 // or promote products derived from this software without specific prior 12986 // written permission. 12987 // 12988 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 12989 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 12990 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 12991 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 12992 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 12993 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 12994 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 12995 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 12996 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 12997 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 12998 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12999 // 13000 // --------------------------------------------------------------------------- 13001 // 13002 // This file was generated by the CEF translator tool and should not edited 13003 // by hand. See the translator.README.txt file in the tools directory for 13004 // more information. 13005 // 13006 // $hash=e4bdab963041a270edabc0954b415eb4cae8e5cb$ 13007 // 13008 13009 extern (C): 13010 13011 /// 13012 // Implement this structure to handle events when window rendering is disabled. 13013 // The functions of this structure will be called on the UI thread. 13014 /// 13015 struct cef_render_handler_t 13016 { 13017 /// 13018 // Base structure. 13019 /// 13020 cef_base_ref_counted_t base; 13021 13022 /// 13023 // Return the handler for accessibility notifications. If no handler is 13024 // provided the default implementation will be used. 13025 /// 13026 extern(System) cef_accessibility_handler_t* function ( 13027 cef_render_handler_t* self) nothrow get_accessibility_handler; 13028 13029 /// 13030 // Called to retrieve the root window rectangle in screen coordinates. Return 13031 // true (1) if the rectangle was provided. If this function returns false (0) 13032 // the rectangle from GetViewRect will be used. 13033 /// 13034 extern(System) int function ( 13035 cef_render_handler_t* self, 13036 cef_browser_t* browser, 13037 cef_rect_t* rect) nothrow get_root_screen_rect; 13038 13039 /// 13040 // Called to retrieve the view rectangle which is relative to screen 13041 // coordinates. This function must always provide a non-NULL rectangle. 13042 /// 13043 extern(System) void function ( 13044 cef_render_handler_t* self, 13045 cef_browser_t* browser, 13046 cef_rect_t* rect) nothrow get_view_rect; 13047 13048 /// 13049 // Called to retrieve the translation from view coordinates to actual screen 13050 // coordinates. Return true (1) if the screen coordinates were provided. 13051 /// 13052 extern(System) int function ( 13053 cef_render_handler_t* self, 13054 cef_browser_t* browser, 13055 int viewX, 13056 int viewY, 13057 int* screenX, 13058 int* screenY) nothrow get_screen_point; 13059 13060 /// 13061 // Called to allow the client to fill in the CefScreenInfo object with 13062 // appropriate values. Return true (1) if the |screen_info| structure has been 13063 // modified. 13064 // 13065 // If the screen info rectangle is left NULL the rectangle from GetViewRect 13066 // will be used. If the rectangle is still NULL or invalid popups may not be 13067 // drawn correctly. 13068 /// 13069 extern(System) int function ( 13070 cef_render_handler_t* self, 13071 cef_browser_t* browser, 13072 cef_screen_info_t* screen_info) nothrow get_screen_info; 13073 13074 /// 13075 // Called when the browser wants to show or hide the popup widget. The popup 13076 // should be shown if |show| is true (1) and hidden if |show| is false (0). 13077 /// 13078 extern(System) void function ( 13079 cef_render_handler_t* self, 13080 cef_browser_t* browser, 13081 int show) nothrow on_popup_show; 13082 13083 /// 13084 // Called when the browser wants to move or resize the popup widget. |rect| 13085 // contains the new location and size in view coordinates. 13086 /// 13087 extern(System) void function ( 13088 cef_render_handler_t* self, 13089 cef_browser_t* browser, 13090 const(cef_rect_t)* rect) nothrow on_popup_size; 13091 13092 /// 13093 // Called when an element should be painted. Pixel values passed to this 13094 // function are scaled relative to view coordinates based on the value of 13095 // CefScreenInfo.device_scale_factor returned from GetScreenInfo. |type| 13096 // indicates whether the element is the view or the popup widget. |buffer| 13097 // contains the pixel data for the whole image. |dirtyRects| contains the set 13098 // of rectangles in pixel coordinates that need to be repainted. |buffer| will 13099 // be |width|*|height|*4 bytes in size and represents a BGRA image with an 13100 // upper-left origin. This function is only called when 13101 // cef_window_tInfo::shared_texture_enabled is set to false (0). 13102 /// 13103 extern(System) void function ( 13104 cef_render_handler_t* self, 13105 cef_browser_t* browser, 13106 cef_paint_element_type_t type, 13107 size_t dirtyRectsCount, 13108 const(cef_rect_t)* dirtyRects, 13109 const(void)* buffer, 13110 int width, 13111 int height) nothrow on_paint; 13112 13113 /// 13114 // Called when an element has been rendered to the shared texture handle. 13115 // |type| indicates whether the element is the view or the popup widget. 13116 // |dirtyRects| contains the set of rectangles in pixel coordinates that need 13117 // to be repainted. |shared_handle| is the handle for a D3D11 Texture2D that 13118 // can be accessed via ID3D11Device using the OpenSharedResource function. 13119 // This function is only called when cef_window_tInfo::shared_texture_enabled 13120 // is set to true (1), and is currently only supported on Windows. 13121 /// 13122 extern(System) void function ( 13123 cef_render_handler_t* self, 13124 cef_browser_t* browser, 13125 cef_paint_element_type_t type, 13126 size_t dirtyRectsCount, 13127 const(cef_rect_t)* dirtyRects, 13128 void* shared_handle) nothrow on_accelerated_paint; 13129 13130 /// 13131 // Called when the user starts dragging content in the web view. Contextual 13132 // information about the dragged content is supplied by |drag_data|. (|x|, 13133 // |y|) is the drag start location in screen coordinates. OS APIs that run a 13134 // system message loop may be used within the StartDragging call. 13135 // 13136 // Return false (0) to abort the drag operation. Don't call any of 13137 // cef_browser_host_t::DragSource*Ended* functions after returning false (0). 13138 // 13139 // Return true (1) to handle the drag operation. Call 13140 // cef_browser_host_t::DragSourceEndedAt and DragSourceSystemDragEnded either 13141 // synchronously or asynchronously to inform the web view that the drag 13142 // operation has ended. 13143 /// 13144 extern(System) int function ( 13145 cef_render_handler_t* self, 13146 cef_browser_t* browser, 13147 cef_drag_data_t* drag_data, 13148 cef_drag_operations_mask_t allowed_ops, 13149 int x, 13150 int y) nothrow start_dragging; 13151 13152 /// 13153 // Called when the web view wants to update the mouse cursor during a drag & 13154 // drop operation. |operation| describes the allowed operation (none, move, 13155 // copy, link). 13156 /// 13157 extern(System) void function ( 13158 cef_render_handler_t* self, 13159 cef_browser_t* browser, 13160 cef_drag_operations_mask_t operation) nothrow update_drag_cursor; 13161 13162 /// 13163 // Called when the scroll offset has changed. 13164 /// 13165 extern(System) void function ( 13166 cef_render_handler_t* self, 13167 cef_browser_t* browser, 13168 double x, 13169 double y) nothrow on_scroll_offset_changed; 13170 13171 /// 13172 // Called when the IME composition range has changed. |selected_range| is the 13173 // range of characters that have been selected. |character_bounds| is the 13174 // bounds of each character in view coordinates. 13175 /// 13176 extern(System) void function ( 13177 cef_render_handler_t* self, 13178 cef_browser_t* browser, 13179 const(cef_range_t)* selected_range, 13180 size_t character_boundsCount, 13181 const(cef_rect_t)* character_bounds) nothrow on_ime_composition_range_changed; 13182 13183 /// 13184 // Called when text selection has changed for the specified |browser|. 13185 // |selected_text| is the currently selected text and |selected_range| is the 13186 // character range. 13187 /// 13188 extern(System) void function ( 13189 cef_render_handler_t* self, 13190 cef_browser_t* browser, 13191 const(cef_string_t)* selected_text, 13192 const(cef_range_t)* selected_range) nothrow on_text_selection_changed; 13193 13194 /// 13195 // Called when an on-screen keyboard should be shown or hidden for the 13196 // specified |browser|. |input_mode| specifies what kind of keyboard should be 13197 // opened. If |input_mode| is CEF_TEXT_INPUT_MODE_NONE, any existing keyboard 13198 // for this browser should be hidden. 13199 /// 13200 extern(System) void function ( 13201 cef_render_handler_t* self, 13202 cef_browser_t* browser, 13203 cef_text_input_mode_t input_mode) nothrow on_virtual_keyboard_requested; 13204 } 13205 13206 13207 13208 // CEF_INCLUDE_CAPI_CEF_RENDER_HANDLER_CAPI_H_ 13209 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 13210 // 13211 // Redistribution and use in source and binary forms, with or without 13212 // modification, are permitted provided that the following conditions are 13213 // met: 13214 // 13215 // * Redistributions of source code must retain the above copyright 13216 // notice, this list of conditions and the following disclaimer. 13217 // * Redistributions in binary form must reproduce the above 13218 // copyright notice, this list of conditions and the following disclaimer 13219 // in the documentation and/or other materials provided with the 13220 // distribution. 13221 // * Neither the name of Google Inc. nor the name Chromium Embedded 13222 // Framework nor the names of its contributors may be used to endorse 13223 // or promote products derived from this software without specific prior 13224 // written permission. 13225 // 13226 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 13227 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 13228 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 13229 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 13230 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 13231 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 13232 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 13233 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 13234 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 13235 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 13236 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 13237 // 13238 // --------------------------------------------------------------------------- 13239 // 13240 // This file was generated by the CEF translator tool and should not edited 13241 // by hand. See the translator.README.txt file in the tools directory for 13242 // more information. 13243 // 13244 // $hash=4ebf99611a11cc8714d710c37417fbd9f50f0618$ 13245 // 13246 13247 extern (C): 13248 13249 /// 13250 // Structure used to implement render process callbacks. The functions of this 13251 // structure will be called on the render process main thread (TID_RENDERER) 13252 // unless otherwise indicated. 13253 /// 13254 struct cef_render_process_handler_t 13255 { 13256 /// 13257 // Base structure. 13258 /// 13259 cef_base_ref_counted_t base; 13260 13261 /// 13262 // Called after WebKit has been initialized. 13263 /// 13264 extern(System) void function (cef_render_process_handler_t* self) nothrow on_web_kit_initialized; 13265 13266 /// 13267 // Called after a browser has been created. When browsing cross-origin a new 13268 // browser will be created before the old browser with the same identifier is 13269 // destroyed. |extra_info| is an optional read-only value originating from 13270 // cef_browser_host_t::cef_browser_host_create_browser(), 13271 // cef_browser_host_t::cef_browser_host_create_browser_sync(), 13272 // cef_life_span_handler_t::on_before_popup() or 13273 // cef_browser_view_t::cef_browser_view_create(). 13274 /// 13275 extern(System) void function ( 13276 cef_render_process_handler_t* self, 13277 cef_browser_t* browser, 13278 cef_dictionary_value_t* extra_info) nothrow on_browser_created; 13279 13280 /// 13281 // Called before a browser is destroyed. 13282 /// 13283 extern(System) void function ( 13284 cef_render_process_handler_t* self, 13285 cef_browser_t* browser) nothrow on_browser_destroyed; 13286 13287 /// 13288 // Return the handler for browser load status events. 13289 /// 13290 extern(System) cef_load_handler_t* function ( 13291 cef_render_process_handler_t* self) nothrow get_load_handler; 13292 13293 /// 13294 // Called immediately after the V8 context for a frame has been created. To 13295 // retrieve the JavaScript 'window' object use the 13296 // cef_v8context_t::get_global() function. V8 handles can only be accessed 13297 // from the thread on which they are created. A task runner for posting tasks 13298 // on the associated thread can be retrieved via the 13299 // cef_v8context_t::get_task_runner() function. 13300 /// 13301 extern(System) void function ( 13302 cef_render_process_handler_t* self, 13303 cef_browser_t* browser, 13304 cef_frame_t* frame, 13305 cef_v8context_t* context) nothrow on_context_created; 13306 13307 /// 13308 // Called immediately before the V8 context for a frame is released. No 13309 // references to the context should be kept after this function is called. 13310 /// 13311 extern(System) void function ( 13312 cef_render_process_handler_t* self, 13313 cef_browser_t* browser, 13314 cef_frame_t* frame, 13315 cef_v8context_t* context) nothrow on_context_released; 13316 13317 /// 13318 // Called for global uncaught exceptions in a frame. Execution of this 13319 // callback is disabled by default. To enable set 13320 // CefSettings.uncaught_exception_stack_size > 0. 13321 /// 13322 extern(System) void function ( 13323 cef_render_process_handler_t* self, 13324 cef_browser_t* browser, 13325 cef_frame_t* frame, 13326 cef_v8context_t* context, 13327 cef_v8exception_t* exception, 13328 cef_v8stack_trace_t* stackTrace) nothrow on_uncaught_exception; 13329 13330 /// 13331 // Called when a new node in the the browser gets focus. The |node| value may 13332 // be NULL if no specific node has gained focus. The node object passed to 13333 // this function represents a snapshot of the DOM at the time this function is 13334 // executed. DOM objects are only valid for the scope of this function. Do not 13335 // keep references to or attempt to access any DOM objects outside the scope 13336 // of this function. 13337 /// 13338 extern(System) void function ( 13339 cef_render_process_handler_t* self, 13340 cef_browser_t* browser, 13341 cef_frame_t* frame, 13342 cef_domnode_t* node) nothrow on_focused_node_changed; 13343 13344 /// 13345 // Called when a new message is received from a different process. Return true 13346 // (1) if the message was handled or false (0) otherwise. It is safe to keep a 13347 // reference to |message| outside of this callback. 13348 /// 13349 extern(System) int function ( 13350 cef_render_process_handler_t* self, 13351 cef_browser_t* browser, 13352 cef_frame_t* frame, 13353 cef_process_id_t source_process, 13354 cef_process_message_t* message) nothrow on_process_message_received; 13355 } 13356 13357 13358 13359 // CEF_INCLUDE_CAPI_CEF_RENDER_PROCESS_HANDLER_CAPI_H_ 13360 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 13361 // 13362 // Redistribution and use in source and binary forms, with or without 13363 // modification, are permitted provided that the following conditions are 13364 // met: 13365 // 13366 // * Redistributions of source code must retain the above copyright 13367 // notice, this list of conditions and the following disclaimer. 13368 // * Redistributions in binary form must reproduce the above 13369 // copyright notice, this list of conditions and the following disclaimer 13370 // in the documentation and/or other materials provided with the 13371 // distribution. 13372 // * Neither the name of Google Inc. nor the name Chromium Embedded 13373 // Framework nor the names of its contributors may be used to endorse 13374 // or promote products derived from this software without specific prior 13375 // written permission. 13376 // 13377 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 13378 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 13379 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 13380 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 13381 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 13382 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 13383 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 13384 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 13385 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 13386 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 13387 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 13388 // 13389 // --------------------------------------------------------------------------- 13390 // 13391 // This file was generated by the CEF translator tool and should not edited 13392 // by hand. See the translator.README.txt file in the tools directory for 13393 // more information. 13394 // 13395 // $hash=a5e9055958c3588d583d4d128a5d7c8639f39946$ 13396 // 13397 13398 extern (C): 13399 13400 /// 13401 // Structure used to represent a web request. The functions of this structure 13402 // may be called on any thread. 13403 /// 13404 struct cef_request_t 13405 { 13406 /// 13407 // Base structure. 13408 /// 13409 cef_base_ref_counted_t base; 13410 13411 /// 13412 // Returns true (1) if this object is read-only. 13413 /// 13414 extern(System) int function (cef_request_t* self) nothrow is_read_only; 13415 13416 /// 13417 // Get the fully qualified URL. 13418 /// 13419 // The resulting string must be freed by calling cef_string_userfree_free(). 13420 extern(System) cef_string_userfree_t function (cef_request_t* self) nothrow get_url; 13421 13422 /// 13423 // Set the fully qualified URL. 13424 /// 13425 extern(System) void function (cef_request_t* self, const(cef_string_t)* url) nothrow set_url; 13426 13427 /// 13428 // Get the request function type. The value will default to POST if post data 13429 // is provided and GET otherwise. 13430 /// 13431 // The resulting string must be freed by calling cef_string_userfree_free(). 13432 extern(System) cef_string_userfree_t function (cef_request_t* self) nothrow get_method; 13433 13434 /// 13435 // Set the request function type. 13436 /// 13437 extern(System) void function ( 13438 cef_request_t* self, 13439 const(cef_string_t)* method) nothrow set_method; 13440 13441 /// 13442 // Set the referrer URL and policy. If non-NULL the referrer URL must be fully 13443 // qualified with an HTTP or HTTPS scheme component. Any username, password or 13444 // ref component will be removed. 13445 /// 13446 extern(System) void function ( 13447 cef_request_t* self, 13448 const(cef_string_t)* referrer_url, 13449 cef_referrer_policy_t policy) nothrow set_referrer; 13450 13451 /// 13452 // Get the referrer URL. 13453 /// 13454 // The resulting string must be freed by calling cef_string_userfree_free(). 13455 extern(System) cef_string_userfree_t function (cef_request_t* self) nothrow get_referrer_url; 13456 13457 /// 13458 // Get the referrer policy. 13459 /// 13460 extern(System) cef_referrer_policy_t function (cef_request_t* self) nothrow get_referrer_policy; 13461 13462 /// 13463 // Get the post data. 13464 /// 13465 extern(System) cef_post_data_t* function (cef_request_t* self) nothrow get_post_data; 13466 13467 /// 13468 // Set the post data. 13469 /// 13470 extern(System) void function ( 13471 cef_request_t* self, 13472 cef_post_data_t* postData) nothrow set_post_data; 13473 13474 /// 13475 // Get the header values. Will not include the Referer value if any. 13476 /// 13477 extern(System) void function ( 13478 cef_request_t* self, 13479 cef_string_multimap_t headerMap) nothrow get_header_map; 13480 13481 /// 13482 // Set the header values. If a Referer value exists in the header map it will 13483 // be removed and ignored. 13484 /// 13485 extern(System) void function ( 13486 cef_request_t* self, 13487 cef_string_multimap_t headerMap) nothrow set_header_map; 13488 13489 /// 13490 // Returns the first header value for |name| or an NULL string if not found. 13491 // Will not return the Referer value if any. Use GetHeaderMap instead if 13492 // |name| might have multiple values. 13493 /// 13494 // The resulting string must be freed by calling cef_string_userfree_free(). 13495 extern(System) cef_string_userfree_t function ( 13496 cef_request_t* self, 13497 const(cef_string_t)* name) nothrow get_header_by_name; 13498 13499 /// 13500 // Set the header |name| to |value|. If |overwrite| is true (1) any existing 13501 // values will be replaced with the new value. If |overwrite| is false (0) any 13502 // existing values will not be overwritten. The Referer value cannot be set 13503 // using this function. 13504 /// 13505 extern(System) void function ( 13506 cef_request_t* self, 13507 const(cef_string_t)* name, 13508 const(cef_string_t)* value, 13509 int overwrite) nothrow set_header_by_name; 13510 13511 /// 13512 // Set all values at one time. 13513 /// 13514 extern(System) void function ( 13515 cef_request_t* self, 13516 const(cef_string_t)* url, 13517 const(cef_string_t)* method, 13518 cef_post_data_t* postData, 13519 cef_string_multimap_t headerMap) nothrow set; 13520 13521 /// 13522 // Get the flags used in combination with cef_urlrequest_t. See 13523 // cef_urlrequest_flags_t for supported values. 13524 /// 13525 extern(System) int function (cef_request_t* self) nothrow get_flags; 13526 13527 /// 13528 // Set the flags used in combination with cef_urlrequest_t. See 13529 // cef_urlrequest_flags_t for supported values. 13530 /// 13531 extern(System) void function (cef_request_t* self, int flags) nothrow set_flags; 13532 13533 /// 13534 // Get the URL to the first party for cookies used in combination with 13535 // cef_urlrequest_t. 13536 /// 13537 // The resulting string must be freed by calling cef_string_userfree_free(). 13538 extern(System) cef_string_userfree_t function ( 13539 cef_request_t* self) nothrow get_first_party_for_cookies; 13540 13541 /// 13542 // Set the URL to the first party for cookies used in combination with 13543 // cef_urlrequest_t. 13544 /// 13545 extern(System) void function ( 13546 cef_request_t* self, 13547 const(cef_string_t)* url) nothrow set_first_party_for_cookies; 13548 13549 /// 13550 // Get the resource type for this request. Only available in the browser 13551 // process. 13552 /// 13553 extern(System) cef_resource_type_t function (cef_request_t* self) nothrow get_resource_type; 13554 13555 /// 13556 // Get the transition type for this request. Only available in the browser 13557 // process and only applies to requests that represent a main frame or sub- 13558 // frame navigation. 13559 /// 13560 extern(System) cef_transition_type_t function (cef_request_t* self) nothrow get_transition_type; 13561 13562 /// 13563 // Returns the globally unique identifier for this request or 0 if not 13564 // specified. Can be used by cef_resource_request_handler_t implementations in 13565 // the browser process to track a single request across multiple callbacks. 13566 /// 13567 extern(System) uint64 function (cef_request_t* self) nothrow get_identifier; 13568 } 13569 13570 13571 13572 /// 13573 // Create a new cef_request_t object. 13574 /// 13575 cef_request_t* cef_request_create (); 13576 13577 /// 13578 // Structure used to represent post data for a web request. The functions of 13579 // this structure may be called on any thread. 13580 /// 13581 struct cef_post_data_t 13582 { 13583 /// 13584 // Base structure. 13585 /// 13586 cef_base_ref_counted_t base; 13587 13588 /// 13589 // Returns true (1) if this object is read-only. 13590 /// 13591 extern(System) int function (cef_post_data_t* self) nothrow is_read_only; 13592 13593 /// 13594 // Returns true (1) if the underlying POST data includes elements that are not 13595 // represented by this cef_post_data_t object (for example, multi-part file 13596 // upload data). Modifying cef_post_data_t objects with excluded elements may 13597 // result in the request failing. 13598 /// 13599 extern(System) int function (cef_post_data_t* self) nothrow has_excluded_elements; 13600 13601 /// 13602 // Returns the number of existing post data elements. 13603 /// 13604 extern(System) size_t function (cef_post_data_t* self) nothrow get_element_count; 13605 13606 /// 13607 // Retrieve the post data elements. 13608 /// 13609 extern(System) void function ( 13610 cef_post_data_t* self, 13611 size_t* elementsCount, 13612 cef_post_data_element_t** elements) nothrow get_elements; 13613 13614 /// 13615 // Remove the specified post data element. Returns true (1) if the removal 13616 // succeeds. 13617 /// 13618 extern(System) int function ( 13619 cef_post_data_t* self, 13620 cef_post_data_element_t* element) nothrow remove_element; 13621 13622 /// 13623 // Add the specified post data element. Returns true (1) if the add succeeds. 13624 /// 13625 extern(System) int function ( 13626 cef_post_data_t* self, 13627 cef_post_data_element_t* element) nothrow add_element; 13628 13629 /// 13630 // Remove all existing post data elements. 13631 /// 13632 extern(System) void function (cef_post_data_t* self) nothrow remove_elements; 13633 } 13634 13635 13636 13637 /// 13638 // Create a new cef_post_data_t object. 13639 /// 13640 cef_post_data_t* cef_post_data_create (); 13641 13642 /// 13643 // Structure used to represent a single element in the request post data. The 13644 // functions of this structure may be called on any thread. 13645 /// 13646 struct cef_post_data_element_t 13647 { 13648 /// 13649 // Base structure. 13650 /// 13651 cef_base_ref_counted_t base; 13652 13653 /// 13654 // Returns true (1) if this object is read-only. 13655 /// 13656 extern(System) int function (cef_post_data_element_t* self) nothrow is_read_only; 13657 13658 /// 13659 // Remove all contents from the post data element. 13660 /// 13661 extern(System) void function (cef_post_data_element_t* self) nothrow set_to_empty; 13662 13663 /// 13664 // The post data element will represent a file. 13665 /// 13666 extern(System) void function ( 13667 cef_post_data_element_t* self, 13668 const(cef_string_t)* fileName) nothrow set_to_file; 13669 13670 /// 13671 // The post data element will represent bytes. The bytes passed in will be 13672 // copied. 13673 /// 13674 extern(System) void function ( 13675 cef_post_data_element_t* self, 13676 size_t size, 13677 const(void)* bytes) nothrow set_to_bytes; 13678 13679 /// 13680 // Return the type of this post data element. 13681 /// 13682 extern(System) cef_postdataelement_type_t function ( 13683 cef_post_data_element_t* self) nothrow get_type; 13684 13685 /// 13686 // Return the file name. 13687 /// 13688 // The resulting string must be freed by calling cef_string_userfree_free(). 13689 extern(System) cef_string_userfree_t function (cef_post_data_element_t* self) nothrow get_file; 13690 13691 /// 13692 // Return the number of bytes. 13693 /// 13694 extern(System) size_t function (cef_post_data_element_t* self) nothrow get_bytes_count; 13695 13696 /// 13697 // Read up to |size| bytes into |bytes| and return the number of bytes 13698 // actually read. 13699 /// 13700 extern(System) size_t function ( 13701 cef_post_data_element_t* self, 13702 size_t size, 13703 void* bytes) nothrow get_bytes; 13704 } 13705 13706 13707 13708 /// 13709 // Create a new cef_post_data_element_t object. 13710 /// 13711 cef_post_data_element_t* cef_post_data_element_create (); 13712 13713 // CEF_INCLUDE_CAPI_CEF_REQUEST_CAPI_H_ 13714 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 13715 // 13716 // Redistribution and use in source and binary forms, with or without 13717 // modification, are permitted provided that the following conditions are 13718 // met: 13719 // 13720 // * Redistributions of source code must retain the above copyright 13721 // notice, this list of conditions and the following disclaimer. 13722 // * Redistributions in binary form must reproduce the above 13723 // copyright notice, this list of conditions and the following disclaimer 13724 // in the documentation and/or other materials provided with the 13725 // distribution. 13726 // * Neither the name of Google Inc. nor the name Chromium Embedded 13727 // Framework nor the names of its contributors may be used to endorse 13728 // or promote products derived from this software without specific prior 13729 // written permission. 13730 // 13731 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 13732 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 13733 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 13734 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 13735 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 13736 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 13737 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 13738 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 13739 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 13740 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 13741 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 13742 // 13743 // --------------------------------------------------------------------------- 13744 // 13745 // This file was generated by the CEF translator tool and should not edited 13746 // by hand. See the translator.README.txt file in the tools directory for 13747 // more information. 13748 // 13749 // $hash=2e42334fc22050e207e5a0af6fe290a592e4105f$ 13750 // 13751 13752 extern (C): 13753 13754 13755 13756 13757 /// 13758 // Callback structure for cef_request_context_t::ResolveHost. 13759 /// 13760 struct cef_resolve_callback_t 13761 { 13762 /// 13763 // Base structure. 13764 /// 13765 cef_base_ref_counted_t base; 13766 13767 /// 13768 // Called on the UI thread after the ResolveHost request has completed. 13769 // |result| will be the result code. |resolved_ips| will be the list of 13770 // resolved IP addresses or NULL if the resolution failed. 13771 /// 13772 extern(System) void function ( 13773 cef_resolve_callback_t* self, 13774 cef_errorcode_t result, 13775 cef_string_list_t resolved_ips) nothrow on_resolve_completed; 13776 } 13777 13778 13779 13780 /// 13781 // A request context provides request handling for a set of related browser or 13782 // URL request objects. A request context can be specified when creating a new 13783 // browser via the cef_browser_host_t static factory functions or when creating 13784 // a new URL request via the cef_urlrequest_t static factory functions. Browser 13785 // objects with different request contexts will never be hosted in the same 13786 // render process. Browser objects with the same request context may or may not 13787 // be hosted in the same render process depending on the process model. Browser 13788 // objects created indirectly via the JavaScript window.open function or 13789 // targeted links will share the same render process and the same request 13790 // context as the source browser. When running in single-process mode there is 13791 // only a single render process (the main process) and so all browsers created 13792 // in single-process mode will share the same request context. This will be the 13793 // first request context passed into a cef_browser_host_t static factory 13794 // function and all other request context objects will be ignored. 13795 /// 13796 struct cef_request_context_t 13797 { 13798 /// 13799 // Base structure. 13800 /// 13801 cef_base_ref_counted_t base; 13802 13803 /// 13804 // Returns true (1) if this object is pointing to the same context as |that| 13805 // object. 13806 /// 13807 extern(System) int function ( 13808 cef_request_context_t* self, 13809 cef_request_context_t* other) nothrow is_same; 13810 13811 /// 13812 // Returns true (1) if this object is sharing the same storage as |that| 13813 // object. 13814 /// 13815 extern(System) int function ( 13816 cef_request_context_t* self, 13817 cef_request_context_t* other) nothrow is_sharing_with; 13818 13819 /// 13820 // Returns true (1) if this object is the global context. The global context 13821 // is used by default when creating a browser or URL request with a NULL 13822 // context argument. 13823 /// 13824 extern(System) int function (cef_request_context_t* self) nothrow is_global; 13825 13826 /// 13827 // Returns the handler for this context if any. 13828 /// 13829 extern(System) cef_request_context_handler_t* function ( 13830 cef_request_context_t* self) nothrow get_handler; 13831 13832 /// 13833 // Returns the cache path for this object. If NULL an "incognito mode" in- 13834 // memory cache is being used. 13835 /// 13836 // The resulting string must be freed by calling cef_string_userfree_free(). 13837 extern(System) cef_string_userfree_t function ( 13838 cef_request_context_t* self) nothrow get_cache_path; 13839 13840 /// 13841 // Returns the cookie manager for this object. If |callback| is non-NULL it 13842 // will be executed asnychronously on the UI thread after the manager's 13843 // storage has been initialized. 13844 /// 13845 extern(System) cef_cookie_manager_t* function ( 13846 cef_request_context_t* self, 13847 cef_completion_callback_t* callback) nothrow get_cookie_manager; 13848 13849 /// 13850 // Register a scheme handler factory for the specified |scheme_name| and 13851 // optional |domain_name|. An NULL |domain_name| value for a standard scheme 13852 // will cause the factory to match all domain names. The |domain_name| value 13853 // will be ignored for non-standard schemes. If |scheme_name| is a built-in 13854 // scheme and no handler is returned by |factory| then the built-in scheme 13855 // handler factory will be called. If |scheme_name| is a custom scheme then 13856 // you must also implement the cef_app_t::on_register_custom_schemes() 13857 // function in all processes. This function may be called multiple times to 13858 // change or remove the factory that matches the specified |scheme_name| and 13859 // optional |domain_name|. Returns false (0) if an error occurs. This function 13860 // may be called on any thread in the browser process. 13861 /// 13862 extern(System) int function ( 13863 cef_request_context_t* self, 13864 const(cef_string_t)* scheme_name, 13865 const(cef_string_t)* domain_name, 13866 cef_scheme_handler_factory_t* factory) nothrow register_scheme_handler_factory; 13867 13868 /// 13869 // Clear all registered scheme handler factories. Returns false (0) on error. 13870 // This function may be called on any thread in the browser process. 13871 /// 13872 extern(System) int function (cef_request_context_t* self) nothrow clear_scheme_handler_factories; 13873 13874 /// 13875 // Tells all renderer processes associated with this context to throw away 13876 // their plugin list cache. If |reload_pages| is true (1) they will also 13877 // reload all pages with plugins. 13878 // cef_request_context_handler_t::OnBeforePluginLoad may be called to rebuild 13879 // the plugin list cache. 13880 /// 13881 extern(System) void function ( 13882 cef_request_context_t* self, 13883 int reload_pages) nothrow purge_plugin_list_cache; 13884 13885 /// 13886 // Returns true (1) if a preference with the specified |name| exists. This 13887 // function must be called on the browser process UI thread. 13888 /// 13889 extern(System) int function ( 13890 cef_request_context_t* self, 13891 const(cef_string_t)* name) nothrow has_preference; 13892 13893 /// 13894 // Returns the value for the preference with the specified |name|. Returns 13895 // NULL if the preference does not exist. The returned object contains a copy 13896 // of the underlying preference value and modifications to the returned object 13897 // will not modify the underlying preference value. This function must be 13898 // called on the browser process UI thread. 13899 /// 13900 extern(System) cef_value_t* function ( 13901 cef_request_context_t* self, 13902 const(cef_string_t)* name) nothrow get_preference; 13903 13904 /// 13905 // Returns all preferences as a dictionary. If |include_defaults| is true (1) 13906 // then preferences currently at their default value will be included. The 13907 // returned object contains a copy of the underlying preference values and 13908 // modifications to the returned object will not modify the underlying 13909 // preference values. This function must be called on the browser process UI 13910 // thread. 13911 /// 13912 extern(System) cef_dictionary_value_t* function ( 13913 cef_request_context_t* self, 13914 int include_defaults) nothrow get_all_preferences; 13915 13916 /// 13917 // Returns true (1) if the preference with the specified |name| can be 13918 // modified using SetPreference. As one example preferences set via the 13919 // command-line usually cannot be modified. This function must be called on 13920 // the browser process UI thread. 13921 /// 13922 extern(System) int function ( 13923 cef_request_context_t* self, 13924 const(cef_string_t)* name) nothrow can_set_preference; 13925 13926 /// 13927 // Set the |value| associated with preference |name|. Returns true (1) if the 13928 // value is set successfully and false (0) otherwise. If |value| is NULL the 13929 // preference will be restored to its default value. If setting the preference 13930 // fails then |error| will be populated with a detailed description of the 13931 // problem. This function must be called on the browser process UI thread. 13932 /// 13933 extern(System) int function ( 13934 cef_request_context_t* self, 13935 const(cef_string_t)* name, 13936 cef_value_t* value, 13937 cef_string_t* error) nothrow set_preference; 13938 13939 /// 13940 // Clears all certificate exceptions that were added as part of handling 13941 // cef_request_handler_t::on_certificate_error(). If you call this it is 13942 // recommended that you also call close_all_connections() or you risk not 13943 // being prompted again for server certificates if you reconnect quickly. If 13944 // |callback| is non-NULL it will be executed on the UI thread after 13945 // completion. 13946 /// 13947 extern(System) void function ( 13948 cef_request_context_t* self, 13949 cef_completion_callback_t* callback) nothrow clear_certificate_exceptions; 13950 13951 /// 13952 // Clears all HTTP authentication credentials that were added as part of 13953 // handling GetAuthCredentials. If |callback| is non-NULL it will be executed 13954 // on the UI thread after completion. 13955 /// 13956 extern(System) void function ( 13957 cef_request_context_t* self, 13958 cef_completion_callback_t* callback) nothrow clear_http_auth_credentials; 13959 13960 /// 13961 // Clears all active and idle connections that Chromium currently has. This is 13962 // only recommended if you have released all other CEF objects but don't yet 13963 // want to call cef_shutdown(). If |callback| is non-NULL it will be executed 13964 // on the UI thread after completion. 13965 /// 13966 extern(System) void function ( 13967 cef_request_context_t* self, 13968 cef_completion_callback_t* callback) nothrow close_all_connections; 13969 13970 /// 13971 // Attempts to resolve |origin| to a list of associated IP addresses. 13972 // |callback| will be executed on the UI thread after completion. 13973 /// 13974 extern(System) void function ( 13975 cef_request_context_t* self, 13976 const(cef_string_t)* origin, 13977 cef_resolve_callback_t* callback) nothrow resolve_host; 13978 13979 /// 13980 // Load an extension. 13981 // 13982 // If extension resources will be read from disk using the default load 13983 // implementation then |root_directory| should be the absolute path to the 13984 // extension resources directory and |manifest| should be NULL. If extension 13985 // resources will be provided by the client (e.g. via cef_request_handler_t 13986 // and/or cef_extension_handler_t) then |root_directory| should be a path 13987 // component unique to the extension (if not absolute this will be internally 13988 // prefixed with the PK_DIR_RESOURCES path) and |manifest| should contain the 13989 // contents that would otherwise be read from the "manifest.json" file on 13990 // disk. 13991 // 13992 // The loaded extension will be accessible in all contexts sharing the same 13993 // storage (HasExtension returns true (1)). However, only the context on which 13994 // this function was called is considered the loader (DidLoadExtension returns 13995 // true (1)) and only the loader will receive cef_request_context_handler_t 13996 // callbacks for the extension. 13997 // 13998 // cef_extension_handler_t::OnExtensionLoaded will be called on load success 13999 // or cef_extension_handler_t::OnExtensionLoadFailed will be called on load 14000 // failure. 14001 // 14002 // If the extension specifies a background script via the "background" 14003 // manifest key then cef_extension_handler_t::OnBeforeBackgroundBrowser will 14004 // be called to create the background browser. See that function for 14005 // additional information about background scripts. 14006 // 14007 // For visible extension views the client application should evaluate the 14008 // manifest to determine the correct extension URL to load and then pass that 14009 // URL to the cef_browser_host_t::CreateBrowser* function after the extension 14010 // has loaded. For example, the client can look for the "browser_action" 14011 // manifest key as documented at 14012 // https://developer.chrome.com/extensions/browserAction. Extension URLs take 14013 // the form "chrome-extension://<extension_id>/<path>". 14014 // 14015 // Browsers that host extensions differ from normal browsers as follows: 14016 // - Can access chrome.* JavaScript APIs if allowed by the manifest. Visit 14017 // chrome://extensions-support for the list of extension APIs currently 14018 // supported by CEF. 14019 // - Main frame navigation to non-extension content is blocked. 14020 // - Pinch-zooming is disabled. 14021 // - CefBrowserHost::GetExtension returns the hosted extension. 14022 // - CefBrowserHost::IsBackgroundHost returns true for background hosts. 14023 // 14024 // See https://developer.chrome.com/extensions for extension implementation 14025 // and usage documentation. 14026 /// 14027 extern(System) void function ( 14028 cef_request_context_t* self, 14029 const(cef_string_t)* root_directory, 14030 cef_dictionary_value_t* manifest, 14031 cef_extension_handler_t* handler) nothrow load_extension; 14032 14033 /// 14034 // Returns true (1) if this context was used to load the extension identified 14035 // by |extension_id|. Other contexts sharing the same storage will also have 14036 // access to the extension (see HasExtension). This function must be called on 14037 // the browser process UI thread. 14038 /// 14039 extern(System) int function ( 14040 cef_request_context_t* self, 14041 const(cef_string_t)* extension_id) nothrow did_load_extension; 14042 14043 /// 14044 // Returns true (1) if this context has access to the extension identified by 14045 // |extension_id|. This may not be the context that was used to load the 14046 // extension (see DidLoadExtension). This function must be called on the 14047 // browser process UI thread. 14048 /// 14049 extern(System) int function ( 14050 cef_request_context_t* self, 14051 const(cef_string_t)* extension_id) nothrow has_extension; 14052 14053 /// 14054 // Retrieve the list of all extensions that this context has access to (see 14055 // HasExtension). |extension_ids| will be populated with the list of extension 14056 // ID values. Returns true (1) on success. This function must be called on the 14057 // browser process UI thread. 14058 /// 14059 extern(System) int function ( 14060 cef_request_context_t* self, 14061 cef_string_list_t extension_ids) nothrow get_extensions; 14062 14063 /// 14064 // Returns the extension matching |extension_id| or NULL if no matching 14065 // extension is accessible in this context (see HasExtension). This function 14066 // must be called on the browser process UI thread. 14067 /// 14068 extern(System) cef_extension_t* function ( 14069 cef_request_context_t* self, 14070 const(cef_string_t)* extension_id) nothrow get_extension; 14071 14072 /// 14073 // Returns the MediaRouter object associated with this context. If |callback| 14074 // is non-NULL it will be executed asnychronously on the UI thread after the 14075 // manager's context has been initialized. 14076 /// 14077 extern(System) cef_media_router_t* function ( 14078 cef_request_context_t* self, 14079 cef_completion_callback_t* callback) nothrow get_media_router; 14080 } 14081 14082 14083 14084 /// 14085 // Returns the global context object. 14086 /// 14087 cef_request_context_t* cef_request_context_get_global_context (); 14088 14089 /// 14090 // Creates a new context object with the specified |settings| and optional 14091 // |handler|. 14092 /// 14093 cef_request_context_t* cef_request_context_create_context ( 14094 const(cef_request_context_settings_t)* settings, 14095 cef_request_context_handler_t* handler); 14096 14097 /// 14098 // Creates a new context object that shares storage with |other| and uses an 14099 // optional |handler|. 14100 /// 14101 cef_request_context_t* cef_create_context_shared ( 14102 cef_request_context_t* other, 14103 cef_request_context_handler_t* handler); 14104 14105 // CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_CAPI_H_ 14106 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 14107 // 14108 // Redistribution and use in source and binary forms, with or without 14109 // modification, are permitted provided that the following conditions are 14110 // met: 14111 // 14112 // * Redistributions of source code must retain the above copyright 14113 // notice, this list of conditions and the following disclaimer. 14114 // * Redistributions in binary form must reproduce the above 14115 // copyright notice, this list of conditions and the following disclaimer 14116 // in the documentation and/or other materials provided with the 14117 // distribution. 14118 // * Neither the name of Google Inc. nor the name Chromium Embedded 14119 // Framework nor the names of its contributors may be used to endorse 14120 // or promote products derived from this software without specific prior 14121 // written permission. 14122 // 14123 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 14124 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 14125 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 14126 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 14127 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 14128 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 14129 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 14130 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 14131 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 14132 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 14133 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 14134 // 14135 // --------------------------------------------------------------------------- 14136 // 14137 // This file was generated by the CEF translator tool and should not edited 14138 // by hand. See the translator.README.txt file in the tools directory for 14139 // more information. 14140 // 14141 // $hash=fa148db8a0ecd79966814086fb92e439687be701$ 14142 // 14143 14144 extern (C): 14145 14146 /// 14147 // Implement this structure to provide handler implementations. The handler 14148 // instance will not be released until all objects related to the context have 14149 // been destroyed. 14150 /// 14151 struct cef_request_context_handler_t 14152 { 14153 /// 14154 // Base structure. 14155 /// 14156 cef_base_ref_counted_t base; 14157 14158 /// 14159 // Called on the browser process UI thread immediately after the request 14160 // context has been initialized. 14161 /// 14162 extern(System) void function ( 14163 cef_request_context_handler_t* self, 14164 cef_request_context_t* request_context) nothrow on_request_context_initialized; 14165 14166 /// 14167 // Called on multiple browser process threads before a plugin instance is 14168 // loaded. |mime_type| is the mime type of the plugin that will be loaded. 14169 // |plugin_url| is the content URL that the plugin will load and may be NULL. 14170 // |is_main_frame| will be true (1) if the plugin is being loaded in the main 14171 // (top-level) frame, |top_origin_url| is the URL for the top-level frame that 14172 // contains the plugin when loading a specific plugin instance or NULL when 14173 // building the initial list of enabled plugins for 'navigator.plugins' 14174 // JavaScript state. |plugin_info| includes additional information about the 14175 // plugin that will be loaded. |plugin_policy| is the recommended policy. 14176 // Modify |plugin_policy| and return true (1) to change the policy. Return 14177 // false (0) to use the recommended policy. The default plugin policy can be 14178 // set at runtime using the `--plugin-policy=[allow|detect|block]` command- 14179 // line flag. Decisions to mark a plugin as disabled by setting 14180 // |plugin_policy| to PLUGIN_POLICY_DISABLED may be cached when 14181 // |top_origin_url| is NULL. To purge the plugin list cache and potentially 14182 // trigger new calls to this function call 14183 // cef_request_context_t::PurgePluginListCache. 14184 /// 14185 extern(System) int function ( 14186 cef_request_context_handler_t* self, 14187 const(cef_string_t)* mime_type, 14188 const(cef_string_t)* plugin_url, 14189 int is_main_frame, 14190 const(cef_string_t)* top_origin_url, 14191 cef_web_plugin_info_t* plugin_info, 14192 cef_plugin_policy_t* plugin_policy) nothrow on_before_plugin_load; 14193 14194 /// 14195 // Called on the browser process IO thread before a resource request is 14196 // initiated. The |browser| and |frame| values represent the source of the 14197 // request, and may be NULL for requests originating from service workers or 14198 // cef_urlrequest_t. |request| represents the request contents and cannot be 14199 // modified in this callback. |is_navigation| will be true (1) if the resource 14200 // request is a navigation. |is_download| will be true (1) if the resource 14201 // request is a download. |request_initiator| is the origin (scheme + domain) 14202 // of the page that initiated the request. Set |disable_default_handling| to 14203 // true (1) to disable default handling of the request, in which case it will 14204 // need to be handled via cef_resource_request_handler_t::GetResourceHandler 14205 // or it will be canceled. To allow the resource load to proceed with default 14206 // handling return NULL. To specify a handler for the resource return a 14207 // cef_resource_request_handler_t object. This function will not be called if 14208 // the client associated with |browser| returns a non-NULL value from 14209 // cef_request_handler_t::GetResourceRequestHandler for the same request 14210 // (identified by cef_request_t::GetIdentifier). 14211 /// 14212 extern(System) cef_resource_request_handler_t* function ( 14213 cef_request_context_handler_t* self, 14214 cef_browser_t* browser, 14215 cef_frame_t* frame, 14216 cef_request_t* request, 14217 int is_navigation, 14218 int is_download, 14219 const(cef_string_t)* request_initiator, 14220 int* disable_default_handling) nothrow get_resource_request_handler; 14221 } 14222 14223 14224 14225 // CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_HANDLER_CAPI_H_ 14226 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 14227 // 14228 // Redistribution and use in source and binary forms, with or without 14229 // modification, are permitted provided that the following conditions are 14230 // met: 14231 // 14232 // * Redistributions of source code must retain the above copyright 14233 // notice, this list of conditions and the following disclaimer. 14234 // * Redistributions in binary form must reproduce the above 14235 // copyright notice, this list of conditions and the following disclaimer 14236 // in the documentation and/or other materials provided with the 14237 // distribution. 14238 // * Neither the name of Google Inc. nor the name Chromium Embedded 14239 // Framework nor the names of its contributors may be used to endorse 14240 // or promote products derived from this software without specific prior 14241 // written permission. 14242 // 14243 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 14244 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 14245 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 14246 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 14247 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 14248 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 14249 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 14250 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 14251 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 14252 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 14253 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 14254 // 14255 // --------------------------------------------------------------------------- 14256 // 14257 // This file was generated by the CEF translator tool and should not edited 14258 // by hand. See the translator.README.txt file in the tools directory for 14259 // more information. 14260 // 14261 // $hash=83ff671e8a4db001029be8a02a414333fe4354af$ 14262 // 14263 14264 extern (C): 14265 14266 /// 14267 // Callback structure used to select a client certificate for authentication. 14268 /// 14269 struct cef_select_client_certificate_callback_t 14270 { 14271 /// 14272 // Base structure. 14273 /// 14274 cef_base_ref_counted_t base; 14275 14276 /// 14277 // Chooses the specified certificate for client certificate authentication. 14278 // NULL value means that no client certificate should be used. 14279 /// 14280 extern(System) void function ( 14281 cef_select_client_certificate_callback_t* self, 14282 cef_x509certificate_t* cert) nothrow select; 14283 } 14284 14285 14286 14287 /// 14288 // Implement this structure to handle events related to browser requests. The 14289 // functions of this structure will be called on the thread indicated. 14290 /// 14291 struct cef_request_handler_t 14292 { 14293 /// 14294 // Base structure. 14295 /// 14296 cef_base_ref_counted_t base; 14297 14298 /// 14299 // Called on the UI thread before browser navigation. Return true (1) to 14300 // cancel the navigation or false (0) to allow the navigation to proceed. The 14301 // |request| object cannot be modified in this callback. 14302 // cef_load_handler_t::OnLoadingStateChange will be called twice in all cases. 14303 // If the navigation is allowed cef_load_handler_t::OnLoadStart and 14304 // cef_load_handler_t::OnLoadEnd will be called. If the navigation is canceled 14305 // cef_load_handler_t::OnLoadError will be called with an |errorCode| value of 14306 // ERR_ABORTED. The |user_gesture| value will be true (1) if the browser 14307 // navigated via explicit user gesture (e.g. clicking a link) or false (0) if 14308 // it navigated automatically (e.g. via the DomContentLoaded event). 14309 /// 14310 extern(System) int function ( 14311 cef_request_handler_t* self, 14312 cef_browser_t* browser, 14313 cef_frame_t* frame, 14314 cef_request_t* request, 14315 int user_gesture, 14316 int is_redirect) nothrow on_before_browse; 14317 14318 /// 14319 // Called on the UI thread before OnBeforeBrowse in certain limited cases 14320 // where navigating a new or different browser might be desirable. This 14321 // includes user-initiated navigation that might open in a special way (e.g. 14322 // links clicked via middle-click or ctrl + left-click) and certain types of 14323 // cross-origin navigation initiated from the renderer process (e.g. 14324 // navigating the top-level frame to/from a file URL). The |browser| and 14325 // |frame| values represent the source of the navigation. The 14326 // |target_disposition| value indicates where the user intended to navigate 14327 // the browser based on standard Chromium behaviors (e.g. current tab, new 14328 // tab, etc). The |user_gesture| value will be true (1) if the browser 14329 // navigated via explicit user gesture (e.g. clicking a link) or false (0) if 14330 // it navigated automatically (e.g. via the DomContentLoaded event). Return 14331 // true (1) to cancel the navigation or false (0) to allow the navigation to 14332 // proceed in the source browser's top-level frame. 14333 /// 14334 extern(System) int function ( 14335 cef_request_handler_t* self, 14336 cef_browser_t* browser, 14337 cef_frame_t* frame, 14338 const(cef_string_t)* target_url, 14339 cef_window_open_disposition_t target_disposition, 14340 int user_gesture) nothrow on_open_urlfrom_tab; 14341 14342 /// 14343 // Called on the browser process IO thread before a resource request is 14344 // initiated. The |browser| and |frame| values represent the source of the 14345 // request. |request| represents the request contents and cannot be modified 14346 // in this callback. |is_navigation| will be true (1) if the resource request 14347 // is a navigation. |is_download| will be true (1) if the resource request is 14348 // a download. |request_initiator| is the origin (scheme + domain) of the page 14349 // that initiated the request. Set |disable_default_handling| to true (1) to 14350 // disable default handling of the request, in which case it will need to be 14351 // handled via cef_resource_request_handler_t::GetResourceHandler or it will 14352 // be canceled. To allow the resource load to proceed with default handling 14353 // return NULL. To specify a handler for the resource return a 14354 // cef_resource_request_handler_t object. If this callback returns NULL the 14355 // same function will be called on the associated 14356 // cef_request_context_handler_t, if any. 14357 /// 14358 extern(System) cef_resource_request_handler_t* function ( 14359 cef_request_handler_t* self, 14360 cef_browser_t* browser, 14361 cef_frame_t* frame, 14362 cef_request_t* request, 14363 int is_navigation, 14364 int is_download, 14365 const(cef_string_t)* request_initiator, 14366 int* disable_default_handling) nothrow get_resource_request_handler; 14367 14368 /// 14369 // Called on the IO thread when the browser needs credentials from the user. 14370 // |origin_url| is the origin making this authentication request. |isProxy| 14371 // indicates whether the host is a proxy server. |host| contains the hostname 14372 // and |port| contains the port number. |realm| is the realm of the challenge 14373 // and may be NULL. |scheme| is the authentication scheme used, such as 14374 // "basic" or "digest", and will be NULL if the source of the request is an 14375 // FTP server. Return true (1) to continue the request and call 14376 // cef_auth_callback_t::cont() either in this function or at a later time when 14377 // the authentication information is available. Return false (0) to cancel the 14378 // request immediately. 14379 /// 14380 extern(System) int function ( 14381 cef_request_handler_t* self, 14382 cef_browser_t* browser, 14383 const(cef_string_t)* origin_url, 14384 int isProxy, 14385 const(cef_string_t)* host, 14386 int port, 14387 const(cef_string_t)* realm, 14388 const(cef_string_t)* scheme, 14389 cef_auth_callback_t* callback) nothrow get_auth_credentials; 14390 14391 /// 14392 // Called on the IO thread when JavaScript requests a specific storage quota 14393 // size via the webkitStorageInfo.requestQuota function. |origin_url| is the 14394 // origin of the page making the request. |new_size| is the requested quota 14395 // size in bytes. Return true (1) to continue the request and call 14396 // cef_callback_t functions either in this function or at a later time to 14397 // grant or deny the request. Return false (0) to cancel the request 14398 // immediately. 14399 /// 14400 extern(System) int function ( 14401 cef_request_handler_t* self, 14402 cef_browser_t* browser, 14403 const(cef_string_t)* origin_url, 14404 int64 new_size, 14405 cef_callback_t* callback) nothrow on_quota_request; 14406 14407 /// 14408 // Called on the UI thread to handle requests for URLs with an invalid SSL 14409 // certificate. Return true (1) and call cef_callback_t functions either in 14410 // this function or at a later time to continue or cancel the request. Return 14411 // false (0) to cancel the request immediately. If 14412 // CefSettings.ignore_certificate_errors is set all invalid certificates will 14413 // be accepted without calling this function. 14414 /// 14415 extern(System) int function ( 14416 cef_request_handler_t* self, 14417 cef_browser_t* browser, 14418 cef_errorcode_t cert_error, 14419 const(cef_string_t)* request_url, 14420 cef_sslinfo_t* ssl_info, 14421 cef_callback_t* callback) nothrow on_certificate_error; 14422 14423 /// 14424 // Called on the UI thread when a client certificate is being requested for 14425 // authentication. Return false (0) to use the default behavior and 14426 // automatically select the first certificate available. Return true (1) and 14427 // call cef_select_client_certificate_callback_t::Select either in this 14428 // function or at a later time to select a certificate. Do not call Select or 14429 // call it with NULL to continue without using any certificate. |isProxy| 14430 // indicates whether the host is an HTTPS proxy or the origin server. |host| 14431 // and |port| contains the hostname and port of the SSL server. |certificates| 14432 // is the list of certificates to choose from; this list has already been 14433 // pruned by Chromium so that it only contains certificates from issuers that 14434 // the server trusts. 14435 /// 14436 extern(System) int function ( 14437 cef_request_handler_t* self, 14438 cef_browser_t* browser, 14439 int isProxy, 14440 const(cef_string_t)* host, 14441 int port, 14442 size_t certificatesCount, 14443 cef_x509certificate_t** certificates, 14444 cef_select_client_certificate_callback_t* callback) nothrow on_select_client_certificate; 14445 14446 /// 14447 // Called on the browser process UI thread when a plugin has crashed. 14448 // |plugin_path| is the path of the plugin that crashed. 14449 /// 14450 extern(System) void function ( 14451 cef_request_handler_t* self, 14452 cef_browser_t* browser, 14453 const(cef_string_t)* plugin_path) nothrow on_plugin_crashed; 14454 14455 /// 14456 // Called on the browser process UI thread when the render view associated 14457 // with |browser| is ready to receive/handle IPC messages in the render 14458 // process. 14459 /// 14460 extern(System) void function ( 14461 cef_request_handler_t* self, 14462 cef_browser_t* browser) nothrow on_render_view_ready; 14463 14464 /// 14465 // Called on the browser process UI thread when the render process terminates 14466 // unexpectedly. |status| indicates how the process terminated. 14467 /// 14468 extern(System) void function ( 14469 cef_request_handler_t* self, 14470 cef_browser_t* browser, 14471 cef_termination_status_t status) nothrow on_render_process_terminated; 14472 14473 /// 14474 // Called on the browser process UI thread when the window.document object of 14475 // the main frame has been created. 14476 /// 14477 extern(System) void function ( 14478 cef_request_handler_t* self, 14479 cef_browser_t* browser) nothrow on_document_available_in_main_frame; 14480 } 14481 14482 14483 14484 // CEF_INCLUDE_CAPI_CEF_REQUEST_HANDLER_CAPI_H_ 14485 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 14486 // 14487 // Redistribution and use in source and binary forms, with or without 14488 // modification, are permitted provided that the following conditions are 14489 // met: 14490 // 14491 // * Redistributions of source code must retain the above copyright 14492 // notice, this list of conditions and the following disclaimer. 14493 // * Redistributions in binary form must reproduce the above 14494 // copyright notice, this list of conditions and the following disclaimer 14495 // in the documentation and/or other materials provided with the 14496 // distribution. 14497 // * Neither the name of Google Inc. nor the name Chromium Embedded 14498 // Framework nor the names of its contributors may be used to endorse 14499 // or promote products derived from this software without specific prior 14500 // written permission. 14501 // 14502 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 14503 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 14504 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 14505 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 14506 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 14507 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 14508 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 14509 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 14510 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 14511 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 14512 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 14513 // 14514 // --------------------------------------------------------------------------- 14515 // 14516 // This file was generated by the CEF translator tool and should not edited 14517 // by hand. See the translator.README.txt file in the tools directory for 14518 // more information. 14519 // 14520 // $hash=ffe0de3b50e0a612bd1b055b873c265b030e721d$ 14521 // 14522 14523 extern (C): 14524 14525 /// 14526 // Structure used for retrieving resources from the resource bundle (*.pak) 14527 // files loaded by CEF during startup or via the cef_resource_bundle_handler_t 14528 // returned from cef_app_t::GetResourceBundleHandler. See CefSettings for 14529 // additional options related to resource bundle loading. The functions of this 14530 // structure may be called on any thread unless otherwise indicated. 14531 /// 14532 struct cef_resource_bundle_t 14533 { 14534 /// 14535 // Base structure. 14536 /// 14537 cef_base_ref_counted_t base; 14538 14539 /// 14540 // Returns the localized string for the specified |string_id| or an NULL 14541 // string if the value is not found. Include cef_pack_strings.h for a listing 14542 // of valid string ID values. 14543 /// 14544 // The resulting string must be freed by calling cef_string_userfree_free(). 14545 extern(System) cef_string_userfree_t function ( 14546 cef_resource_bundle_t* self, 14547 int string_id) nothrow get_localized_string; 14548 14549 /// 14550 // Returns a cef_binary_value_t containing the decompressed contents of the 14551 // specified scale independent |resource_id| or NULL if not found. Include 14552 // cef_pack_resources.h for a listing of valid resource ID values. 14553 /// 14554 extern(System) cef_binary_value_t* function ( 14555 cef_resource_bundle_t* self, 14556 int resource_id) nothrow get_data_resource; 14557 14558 /// 14559 // Returns a cef_binary_value_t containing the decompressed contents of the 14560 // specified |resource_id| nearest the scale factor |scale_factor| or NULL if 14561 // not found. Use a |scale_factor| value of SCALE_FACTOR_NONE for scale 14562 // independent resources or call GetDataResource instead.Include 14563 // cef_pack_resources.h for a listing of valid resource ID values. 14564 /// 14565 extern(System) cef_binary_value_t* function ( 14566 cef_resource_bundle_t* self, 14567 int resource_id, 14568 cef_scale_factor_t scale_factor) nothrow get_data_resource_for_scale; 14569 } 14570 14571 14572 14573 /// 14574 // Returns the global resource bundle instance. 14575 /// 14576 cef_resource_bundle_t* cef_resource_bundle_get_global (); 14577 14578 // CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_CAPI_H_ 14579 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 14580 // 14581 // Redistribution and use in source and binary forms, with or without 14582 // modification, are permitted provided that the following conditions are 14583 // met: 14584 // 14585 // * Redistributions of source code must retain the above copyright 14586 // notice, this list of conditions and the following disclaimer. 14587 // * Redistributions in binary form must reproduce the above 14588 // copyright notice, this list of conditions and the following disclaimer 14589 // in the documentation and/or other materials provided with the 14590 // distribution. 14591 // * Neither the name of Google Inc. nor the name Chromium Embedded 14592 // Framework nor the names of its contributors may be used to endorse 14593 // or promote products derived from this software without specific prior 14594 // written permission. 14595 // 14596 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 14597 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 14598 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 14599 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 14600 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 14601 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 14602 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 14603 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 14604 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 14605 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 14606 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 14607 // 14608 // --------------------------------------------------------------------------- 14609 // 14610 // This file was generated by the CEF translator tool and should not edited 14611 // by hand. See the translator.README.txt file in the tools directory for 14612 // more information. 14613 // 14614 // $hash=b9723e0dfe6d03c24665eac2264396743a5254df$ 14615 // 14616 14617 extern (C): 14618 14619 /// 14620 // Structure used to implement a custom resource bundle structure. See 14621 // CefSettings for additional options related to resource bundle loading. The 14622 // functions of this structure may be called on multiple threads. 14623 /// 14624 struct cef_resource_bundle_handler_t 14625 { 14626 /// 14627 // Base structure. 14628 /// 14629 cef_base_ref_counted_t base; 14630 14631 /// 14632 // Called to retrieve a localized translation for the specified |string_id|. 14633 // To provide the translation set |string| to the translation string and 14634 // return true (1). To use the default translation return false (0). Include 14635 // cef_pack_strings.h for a listing of valid string ID values. 14636 /// 14637 extern(System) int function ( 14638 cef_resource_bundle_handler_t* self, 14639 int string_id, 14640 cef_string_t* string) nothrow get_localized_string; 14641 14642 /// 14643 // Called to retrieve data for the specified scale independent |resource_id|. 14644 // To provide the resource data set |data| and |data_size| to the data pointer 14645 // and size respectively and return true (1). To use the default resource data 14646 // return false (0). The resource data will not be copied and must remain 14647 // resident in memory. Include cef_pack_resources.h for a listing of valid 14648 // resource ID values. 14649 /// 14650 extern(System) int function ( 14651 cef_resource_bundle_handler_t* self, 14652 int resource_id, 14653 void** data, 14654 size_t* data_size) nothrow get_data_resource; 14655 14656 /// 14657 // Called to retrieve data for the specified |resource_id| nearest the scale 14658 // factor |scale_factor|. To provide the resource data set |data| and 14659 // |data_size| to the data pointer and size respectively and return true (1). 14660 // To use the default resource data return false (0). The resource data will 14661 // not be copied and must remain resident in memory. Include 14662 // cef_pack_resources.h for a listing of valid resource ID values. 14663 /// 14664 extern(System) int function ( 14665 cef_resource_bundle_handler_t* self, 14666 int resource_id, 14667 cef_scale_factor_t scale_factor, 14668 void** data, 14669 size_t* data_size) nothrow get_data_resource_for_scale; 14670 } 14671 14672 14673 14674 // CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_HANDLER_CAPI_H_ 14675 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 14676 // 14677 // Redistribution and use in source and binary forms, with or without 14678 // modification, are permitted provided that the following conditions are 14679 // met: 14680 // 14681 // * Redistributions of source code must retain the above copyright 14682 // notice, this list of conditions and the following disclaimer. 14683 // * Redistributions in binary form must reproduce the above 14684 // copyright notice, this list of conditions and the following disclaimer 14685 // in the documentation and/or other materials provided with the 14686 // distribution. 14687 // * Neither the name of Google Inc. nor the name Chromium Embedded 14688 // Framework nor the names of its contributors may be used to endorse 14689 // or promote products derived from this software without specific prior 14690 // written permission. 14691 // 14692 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 14693 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 14694 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 14695 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 14696 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 14697 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 14698 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 14699 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 14700 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 14701 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 14702 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 14703 // 14704 // --------------------------------------------------------------------------- 14705 // 14706 // This file was generated by the CEF translator tool and should not edited 14707 // by hand. See the translator.README.txt file in the tools directory for 14708 // more information. 14709 // 14710 // $hash=a9598f4e94a864e749b425aa62bc519589f5753e$ 14711 // 14712 14713 extern (C): 14714 14715 /// 14716 // Callback for asynchronous continuation of cef_resource_handler_t::skip(). 14717 /// 14718 struct cef_resource_skip_callback_t 14719 { 14720 /// 14721 // Base structure. 14722 /// 14723 cef_base_ref_counted_t base; 14724 14725 /// 14726 // Callback for asynchronous continuation of skip(). If |bytes_skipped| > 0 14727 // then either skip() will be called again until the requested number of bytes 14728 // have been skipped or the request will proceed. If |bytes_skipped| <= 0 the 14729 // request will fail with ERR_REQUEST_RANGE_NOT_SATISFIABLE. 14730 /// 14731 extern(System) void function ( 14732 cef_resource_skip_callback_t* self, 14733 int64 bytes_skipped) nothrow cont; 14734 } 14735 14736 14737 14738 /// 14739 // Callback for asynchronous continuation of cef_resource_handler_t::read(). 14740 /// 14741 struct cef_resource_read_callback_t 14742 { 14743 /// 14744 // Base structure. 14745 /// 14746 cef_base_ref_counted_t base; 14747 14748 /// 14749 // Callback for asynchronous continuation of read(). If |bytes_read| == 0 the 14750 // response will be considered complete. If |bytes_read| > 0 then read() will 14751 // be called again until the request is complete (based on either the result 14752 // or the expected content length). If |bytes_read| < 0 then the request will 14753 // fail and the |bytes_read| value will be treated as the error code. 14754 /// 14755 extern(System) void function (cef_resource_read_callback_t* self, int bytes_read) nothrow cont; 14756 } 14757 14758 14759 14760 /// 14761 // Structure used to implement a custom request handler structure. The functions 14762 // of this structure will be called on the IO thread unless otherwise indicated. 14763 /// 14764 struct cef_resource_handler_t 14765 { 14766 /// 14767 // Base structure. 14768 /// 14769 cef_base_ref_counted_t base; 14770 14771 /// 14772 // Open the response stream. To handle the request immediately set 14773 // |handle_request| to true (1) and return true (1). To decide at a later time 14774 // set |handle_request| to false (0), return true (1), and execute |callback| 14775 // to continue or cancel the request. To cancel the request immediately set 14776 // |handle_request| to true (1) and return false (0). This function will be 14777 // called in sequence but not from a dedicated thread. For backwards 14778 // compatibility set |handle_request| to false (0) and return false (0) and 14779 // the ProcessRequest function will be called. 14780 /// 14781 extern(System) int function ( 14782 cef_resource_handler_t* self, 14783 cef_request_t* request, 14784 int* handle_request, 14785 cef_callback_t* callback) nothrow open; 14786 14787 /// 14788 // Begin processing the request. To handle the request return true (1) and 14789 // call cef_callback_t::cont() once the response header information is 14790 // available (cef_callback_t::cont() can also be called from inside this 14791 // function if header information is available immediately). To cancel the 14792 // request return false (0). 14793 // 14794 // WARNING: This function is deprecated. Use Open instead. 14795 /// 14796 extern(System) int function ( 14797 cef_resource_handler_t* self, 14798 cef_request_t* request, 14799 cef_callback_t* callback) nothrow process_request; 14800 14801 /// 14802 // Retrieve response header information. If the response length is not known 14803 // set |response_length| to -1 and read_response() will be called until it 14804 // returns false (0). If the response length is known set |response_length| to 14805 // a positive value and read_response() will be called until it returns false 14806 // (0) or the specified number of bytes have been read. Use the |response| 14807 // object to set the mime type, http status code and other optional header 14808 // values. To redirect the request to a new URL set |redirectUrl| to the new 14809 // URL. |redirectUrl| can be either a relative or fully qualified URL. It is 14810 // also possible to set |response| to a redirect http status code and pass the 14811 // new URL via a Location header. Likewise with |redirectUrl| it is valid to 14812 // set a relative or fully qualified URL as the Location header value. If an 14813 // error occured while setting up the request you can call set_error() on 14814 // |response| to indicate the error condition. 14815 /// 14816 extern(System) void function ( 14817 cef_resource_handler_t* self, 14818 cef_response_t* response, 14819 int64* response_length, 14820 cef_string_t* redirectUrl) nothrow get_response_headers; 14821 14822 /// 14823 // Skip response data when requested by a Range header. Skip over and discard 14824 // |bytes_to_skip| bytes of response data. If data is available immediately 14825 // set |bytes_skipped| to the number of bytes skipped and return true (1). To 14826 // read the data at a later time set |bytes_skipped| to 0, return true (1) and 14827 // execute |callback| when the data is available. To indicate failure set 14828 // |bytes_skipped| to < 0 (e.g. -2 for ERR_FAILED) and return false (0). This 14829 // function will be called in sequence but not from a dedicated thread. 14830 /// 14831 extern(System) int function ( 14832 cef_resource_handler_t* self, 14833 int64 bytes_to_skip, 14834 int64* bytes_skipped, 14835 cef_resource_skip_callback_t* callback) nothrow skip; 14836 14837 /// 14838 // Read response data. If data is available immediately copy up to 14839 // |bytes_to_read| bytes into |data_out|, set |bytes_read| to the number of 14840 // bytes copied, and return true (1). To read the data at a later time keep a 14841 // pointer to |data_out|, set |bytes_read| to 0, return true (1) and execute 14842 // |callback| when the data is available (|data_out| will remain valid until 14843 // the callback is executed). To indicate response completion set |bytes_read| 14844 // to 0 and return false (0). To indicate failure set |bytes_read| to < 0 14845 // (e.g. -2 for ERR_FAILED) and return false (0). This function will be called 14846 // in sequence but not from a dedicated thread. For backwards compatibility 14847 // set |bytes_read| to -1 and return false (0) and the ReadResponse function 14848 // will be called. 14849 /// 14850 extern(System) int function ( 14851 cef_resource_handler_t* self, 14852 void* data_out, 14853 int bytes_to_read, 14854 int* bytes_read, 14855 cef_resource_read_callback_t* callback) nothrow read; 14856 14857 /// 14858 // Read response data. If data is available immediately copy up to 14859 // |bytes_to_read| bytes into |data_out|, set |bytes_read| to the number of 14860 // bytes copied, and return true (1). To read the data at a later time set 14861 // |bytes_read| to 0, return true (1) and call cef_callback_t::cont() when the 14862 // data is available. To indicate response completion return false (0). 14863 // 14864 // WARNING: This function is deprecated. Use Skip and Read instead. 14865 /// 14866 extern(System) int function ( 14867 cef_resource_handler_t* self, 14868 void* data_out, 14869 int bytes_to_read, 14870 int* bytes_read, 14871 cef_callback_t* callback) nothrow read_response; 14872 14873 /// 14874 // Request processing has been canceled. 14875 /// 14876 extern(System) void function (cef_resource_handler_t* self) nothrow cancel; 14877 } 14878 14879 14880 14881 // CEF_INCLUDE_CAPI_CEF_RESOURCE_HANDLER_CAPI_H_ 14882 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 14883 // 14884 // Redistribution and use in source and binary forms, with or without 14885 // modification, are permitted provided that the following conditions are 14886 // met: 14887 // 14888 // * Redistributions of source code must retain the above copyright 14889 // notice, this list of conditions and the following disclaimer. 14890 // * Redistributions in binary form must reproduce the above 14891 // copyright notice, this list of conditions and the following disclaimer 14892 // in the documentation and/or other materials provided with the 14893 // distribution. 14894 // * Neither the name of Google Inc. nor the name Chromium Embedded 14895 // Framework nor the names of its contributors may be used to endorse 14896 // or promote products derived from this software without specific prior 14897 // written permission. 14898 // 14899 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 14900 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 14901 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 14902 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 14903 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 14904 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 14905 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 14906 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 14907 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 14908 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 14909 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 14910 // 14911 // --------------------------------------------------------------------------- 14912 // 14913 // This file was generated by the CEF translator tool and should not edited 14914 // by hand. See the translator.README.txt file in the tools directory for 14915 // more information. 14916 // 14917 // $hash=7276396521b8b61cf856050244f558baa3a52e04$ 14918 // 14919 14920 extern (C): 14921 14922 /// 14923 // Implement this structure to handle events related to browser requests. The 14924 // functions of this structure will be called on the IO thread unless otherwise 14925 // indicated. 14926 /// 14927 struct cef_resource_request_handler_t 14928 { 14929 /// 14930 // Base structure. 14931 /// 14932 cef_base_ref_counted_t base; 14933 14934 /// 14935 // Called on the IO thread before a resource request is loaded. The |browser| 14936 // and |frame| values represent the source of the request, and may be NULL for 14937 // requests originating from service workers or cef_urlrequest_t. To 14938 // optionally filter cookies for the request return a 14939 // cef_cookie_access_filter_t object. The |request| object cannot not be 14940 // modified in this callback. 14941 /// 14942 extern(System) cef_cookie_access_filter_t* function ( 14943 cef_resource_request_handler_t* self, 14944 cef_browser_t* browser, 14945 cef_frame_t* frame, 14946 cef_request_t* request) nothrow get_cookie_access_filter; 14947 14948 /// 14949 // Called on the IO thread before a resource request is loaded. The |browser| 14950 // and |frame| values represent the source of the request, and may be NULL for 14951 // requests originating from service workers or cef_urlrequest_t. To redirect 14952 // or change the resource load optionally modify |request|. Modification of 14953 // the request URL will be treated as a redirect. Return RV_CONTINUE to 14954 // continue the request immediately. Return RV_CONTINUE_ASYNC and call 14955 // cef_callback_t functions at a later time to continue or cancel the request 14956 // asynchronously. Return RV_CANCEL to cancel the request immediately. 14957 // 14958 /// 14959 extern(System) cef_return_value_t function ( 14960 cef_resource_request_handler_t* self, 14961 cef_browser_t* browser, 14962 cef_frame_t* frame, 14963 cef_request_t* request, 14964 cef_callback_t* callback) nothrow on_before_resource_load; 14965 14966 /// 14967 // Called on the IO thread before a resource is loaded. The |browser| and 14968 // |frame| values represent the source of the request, and may be NULL for 14969 // requests originating from service workers or cef_urlrequest_t. To allow the 14970 // resource to load using the default network loader return NULL. To specify a 14971 // handler for the resource return a cef_resource_handler_t object. The 14972 // |request| object cannot not be modified in this callback. 14973 /// 14974 extern(System) cef_resource_handler_t* function ( 14975 cef_resource_request_handler_t* self, 14976 cef_browser_t* browser, 14977 cef_frame_t* frame, 14978 cef_request_t* request) nothrow get_resource_handler; 14979 14980 /// 14981 // Called on the IO thread when a resource load is redirected. The |browser| 14982 // and |frame| values represent the source of the request, and may be NULL for 14983 // requests originating from service workers or cef_urlrequest_t. The 14984 // |request| parameter will contain the old URL and other request-related 14985 // information. The |response| parameter will contain the response that 14986 // resulted in the redirect. The |new_url| parameter will contain the new URL 14987 // and can be changed if desired. The |request| and |response| objects cannot 14988 // be modified in this callback. 14989 /// 14990 extern(System) void function ( 14991 cef_resource_request_handler_t* self, 14992 cef_browser_t* browser, 14993 cef_frame_t* frame, 14994 cef_request_t* request, 14995 cef_response_t* response, 14996 cef_string_t* new_url) nothrow on_resource_redirect; 14997 14998 /// 14999 // Called on the IO thread when a resource response is received. The |browser| 15000 // and |frame| values represent the source of the request, and may be NULL for 15001 // requests originating from service workers or cef_urlrequest_t. To allow the 15002 // resource load to proceed without modification return false (0). To redirect 15003 // or retry the resource load optionally modify |request| and return true (1). 15004 // Modification of the request URL will be treated as a redirect. Requests 15005 // handled using the default network loader cannot be redirected in this 15006 // callback. The |response| object cannot be modified in this callback. 15007 // 15008 // WARNING: Redirecting using this function is deprecated. Use 15009 // OnBeforeResourceLoad or GetResourceHandler to perform redirects. 15010 /// 15011 extern(System) int function ( 15012 cef_resource_request_handler_t* self, 15013 cef_browser_t* browser, 15014 cef_frame_t* frame, 15015 cef_request_t* request, 15016 cef_response_t* response) nothrow on_resource_response; 15017 15018 /// 15019 // Called on the IO thread to optionally filter resource response content. The 15020 // |browser| and |frame| values represent the source of the request, and may 15021 // be NULL for requests originating from service workers or cef_urlrequest_t. 15022 // |request| and |response| represent the request and response respectively 15023 // and cannot be modified in this callback. 15024 /// 15025 extern(System) cef_response_filter_t* function ( 15026 cef_resource_request_handler_t* self, 15027 cef_browser_t* browser, 15028 cef_frame_t* frame, 15029 cef_request_t* request, 15030 cef_response_t* response) nothrow get_resource_response_filter; 15031 15032 /// 15033 // Called on the IO thread when a resource load has completed. The |browser| 15034 // and |frame| values represent the source of the request, and may be NULL for 15035 // requests originating from service workers or cef_urlrequest_t. |request| 15036 // and |response| represent the request and response respectively and cannot 15037 // be modified in this callback. |status| indicates the load completion 15038 // status. |received_content_length| is the number of response bytes actually 15039 // read. This function will be called for all requests, including requests 15040 // that are aborted due to CEF shutdown or destruction of the associated 15041 // browser. In cases where the associated browser is destroyed this callback 15042 // may arrive after the cef_life_span_handler_t::OnBeforeClose callback for 15043 // that browser. The cef_frame_t::IsValid function can be used to test for 15044 // this situation, and care should be taken not to call |browser| or |frame| 15045 // functions that modify state (like LoadURL, SendProcessMessage, etc.) if the 15046 // frame is invalid. 15047 /// 15048 extern(System) void function ( 15049 cef_resource_request_handler_t* self, 15050 cef_browser_t* browser, 15051 cef_frame_t* frame, 15052 cef_request_t* request, 15053 cef_response_t* response, 15054 cef_urlrequest_status_t status, 15055 int64 received_content_length) nothrow on_resource_load_complete; 15056 15057 /// 15058 // Called on the IO thread to handle requests for URLs with an unknown 15059 // protocol component. The |browser| and |frame| values represent the source 15060 // of the request, and may be NULL for requests originating from service 15061 // workers or cef_urlrequest_t. |request| cannot be modified in this callback. 15062 // Set |allow_os_execution| to true (1) to attempt execution via the 15063 // registered OS protocol handler, if any. SECURITY WARNING: YOU SHOULD USE 15064 // THIS METHOD TO ENFORCE RESTRICTIONS BASED ON SCHEME, HOST OR OTHER URL 15065 // ANALYSIS BEFORE ALLOWING OS EXECUTION. 15066 /// 15067 extern(System) void function ( 15068 cef_resource_request_handler_t* self, 15069 cef_browser_t* browser, 15070 cef_frame_t* frame, 15071 cef_request_t* request, 15072 int* allow_os_execution) nothrow on_protocol_execution; 15073 } 15074 15075 15076 15077 /// 15078 // Implement this structure to filter cookies that may be sent or received from 15079 // resource requests. The functions of this structure will be called on the IO 15080 // thread unless otherwise indicated. 15081 /// 15082 struct cef_cookie_access_filter_t 15083 { 15084 /// 15085 // Base structure. 15086 /// 15087 cef_base_ref_counted_t base; 15088 15089 /// 15090 // Called on the IO thread before a resource request is sent. The |browser| 15091 // and |frame| values represent the source of the request, and may be NULL for 15092 // requests originating from service workers or cef_urlrequest_t. |request| 15093 // cannot be modified in this callback. Return true (1) if the specified 15094 // cookie can be sent with the request or false (0) otherwise. 15095 /// 15096 extern(System) int function ( 15097 cef_cookie_access_filter_t* self, 15098 cef_browser_t* browser, 15099 cef_frame_t* frame, 15100 cef_request_t* request, 15101 const(cef_cookie_t)* cookie) nothrow can_send_cookie; 15102 15103 /// 15104 // Called on the IO thread after a resource response is received. The 15105 // |browser| and |frame| values represent the source of the request, and may 15106 // be NULL for requests originating from service workers or cef_urlrequest_t. 15107 // |request| cannot be modified in this callback. Return true (1) if the 15108 // specified cookie returned with the response can be saved or false (0) 15109 // otherwise. 15110 /// 15111 extern(System) int function ( 15112 cef_cookie_access_filter_t* self, 15113 cef_browser_t* browser, 15114 cef_frame_t* frame, 15115 cef_request_t* request, 15116 cef_response_t* response, 15117 const(cef_cookie_t)* cookie) nothrow can_save_cookie; 15118 } 15119 15120 15121 15122 // CEF_INCLUDE_CAPI_CEF_RESOURCE_REQUEST_HANDLER_CAPI_H_ 15123 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 15124 // 15125 // Redistribution and use in source and binary forms, with or without 15126 // modification, are permitted provided that the following conditions are 15127 // met: 15128 // 15129 // * Redistributions of source code must retain the above copyright 15130 // notice, this list of conditions and the following disclaimer. 15131 // * Redistributions in binary form must reproduce the above 15132 // copyright notice, this list of conditions and the following disclaimer 15133 // in the documentation and/or other materials provided with the 15134 // distribution. 15135 // * Neither the name of Google Inc. nor the name Chromium Embedded 15136 // Framework nor the names of its contributors may be used to endorse 15137 // or promote products derived from this software without specific prior 15138 // written permission. 15139 // 15140 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 15141 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 15142 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 15143 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 15144 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 15145 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 15146 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 15147 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 15148 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 15149 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 15150 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15151 // 15152 // --------------------------------------------------------------------------- 15153 // 15154 // This file was generated by the CEF translator tool and should not edited 15155 // by hand. See the translator.README.txt file in the tools directory for 15156 // more information. 15157 // 15158 // $hash=8202bbf8e7f7ae474182c483f0f599b13f6914eb$ 15159 // 15160 15161 extern (C): 15162 15163 /// 15164 // Structure used to represent a web response. The functions of this structure 15165 // may be called on any thread. 15166 /// 15167 struct cef_response_t 15168 { 15169 /// 15170 // Base structure. 15171 /// 15172 cef_base_ref_counted_t base; 15173 15174 /// 15175 // Returns true (1) if this object is read-only. 15176 /// 15177 extern(System) int function (cef_response_t* self) nothrow is_read_only; 15178 15179 /// 15180 // Get the response error code. Returns ERR_NONE if there was no error. 15181 /// 15182 extern(System) cef_errorcode_t function (cef_response_t* self) nothrow get_error; 15183 15184 /// 15185 // Set the response error code. This can be used by custom scheme handlers to 15186 // return errors during initial request processing. 15187 /// 15188 extern(System) void function (cef_response_t* self, cef_errorcode_t error) nothrow set_error; 15189 15190 /// 15191 // Get the response status code. 15192 /// 15193 extern(System) int function (cef_response_t* self) nothrow get_status; 15194 15195 /// 15196 // Set the response status code. 15197 /// 15198 extern(System) void function (cef_response_t* self, int status) nothrow set_status; 15199 15200 /// 15201 // Get the response status text. 15202 /// 15203 // The resulting string must be freed by calling cef_string_userfree_free(). 15204 extern(System) cef_string_userfree_t function (cef_response_t* self) nothrow get_status_text; 15205 15206 /// 15207 // Set the response status text. 15208 /// 15209 extern(System) void function ( 15210 cef_response_t* self, 15211 const(cef_string_t)* statusText) nothrow set_status_text; 15212 15213 /// 15214 // Get the response mime type. 15215 /// 15216 // The resulting string must be freed by calling cef_string_userfree_free(). 15217 extern(System) cef_string_userfree_t function (cef_response_t* self) nothrow get_mime_type; 15218 15219 /// 15220 // Set the response mime type. 15221 /// 15222 extern(System) void function ( 15223 cef_response_t* self, 15224 const(cef_string_t)* mimeType) nothrow set_mime_type; 15225 15226 /// 15227 // Get the response charset. 15228 /// 15229 // The resulting string must be freed by calling cef_string_userfree_free(). 15230 extern(System) cef_string_userfree_t function (cef_response_t* self) nothrow get_charset; 15231 15232 /// 15233 // Set the response charset. 15234 /// 15235 extern(System) void function ( 15236 cef_response_t* self, 15237 const(cef_string_t)* charset) nothrow set_charset; 15238 15239 /// 15240 // Get the value for the specified response header field. 15241 /// 15242 // The resulting string must be freed by calling cef_string_userfree_free(). 15243 extern(System) cef_string_userfree_t function ( 15244 cef_response_t* self, 15245 const(cef_string_t)* name) nothrow get_header_by_name; 15246 15247 /// 15248 // Set the header |name| to |value|. If |overwrite| is true (1) any existing 15249 // values will be replaced with the new value. If |overwrite| is false (0) any 15250 // existing values will not be overwritten. 15251 /// 15252 extern(System) void function ( 15253 cef_response_t* self, 15254 const(cef_string_t)* name, 15255 const(cef_string_t)* value, 15256 int overwrite) nothrow set_header_by_name; 15257 15258 /// 15259 // Get all response header fields. 15260 /// 15261 extern(System) void function ( 15262 cef_response_t* self, 15263 cef_string_multimap_t headerMap) nothrow get_header_map; 15264 15265 /// 15266 // Set all response header fields. 15267 /// 15268 extern(System) void function ( 15269 cef_response_t* self, 15270 cef_string_multimap_t headerMap) nothrow set_header_map; 15271 15272 /// 15273 // Get the resolved URL after redirects or changed as a result of HSTS. 15274 /// 15275 // The resulting string must be freed by calling cef_string_userfree_free(). 15276 extern(System) cef_string_userfree_t function (cef_response_t* self) nothrow get_url; 15277 15278 /// 15279 // Set the resolved URL after redirects or changed as a result of HSTS. 15280 /// 15281 extern(System) void function (cef_response_t* self, const(cef_string_t)* url) nothrow set_url; 15282 } 15283 15284 15285 15286 /// 15287 // Create a new cef_response_t object. 15288 /// 15289 cef_response_t* cef_response_create (); 15290 15291 // CEF_INCLUDE_CAPI_CEF_RESPONSE_CAPI_H_ 15292 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 15293 // 15294 // Redistribution and use in source and binary forms, with or without 15295 // modification, are permitted provided that the following conditions are 15296 // met: 15297 // 15298 // * Redistributions of source code must retain the above copyright 15299 // notice, this list of conditions and the following disclaimer. 15300 // * Redistributions in binary form must reproduce the above 15301 // copyright notice, this list of conditions and the following disclaimer 15302 // in the documentation and/or other materials provided with the 15303 // distribution. 15304 // * Neither the name of Google Inc. nor the name Chromium Embedded 15305 // Framework nor the names of its contributors may be used to endorse 15306 // or promote products derived from this software without specific prior 15307 // written permission. 15308 // 15309 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 15310 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 15311 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 15312 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 15313 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 15314 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 15315 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 15316 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 15317 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 15318 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 15319 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15320 // 15321 // --------------------------------------------------------------------------- 15322 // 15323 // This file was generated by the CEF translator tool and should not edited 15324 // by hand. See the translator.README.txt file in the tools directory for 15325 // more information. 15326 // 15327 // $hash=cdadf516dc77455c5a3d6633bfb12e1cb276b9bb$ 15328 // 15329 15330 extern (C): 15331 15332 /// 15333 // Implement this structure to filter resource response content. The functions 15334 // of this structure will be called on the browser process IO thread. 15335 /// 15336 struct cef_response_filter_t 15337 { 15338 /// 15339 // Base structure. 15340 /// 15341 cef_base_ref_counted_t base; 15342 15343 /// 15344 // Initialize the response filter. Will only be called a single time. The 15345 // filter will not be installed if this function returns false (0). 15346 /// 15347 extern(System) int function (cef_response_filter_t* self) nothrow init_filter; 15348 15349 /// 15350 // Called to filter a chunk of data. Expected usage is as follows: 15351 // 15352 // A. Read input data from |data_in| and set |data_in_read| to the number of 15353 // bytes that were read up to a maximum of |data_in_size|. |data_in| will 15354 // be NULL if |data_in_size| is zero. 15355 // B. Write filtered output data to |data_out| and set |data_out_written| to 15356 // the number of bytes that were written up to a maximum of 15357 // |data_out_size|. If no output data was written then all data must be 15358 // read from |data_in| (user must set |data_in_read| = |data_in_size|). 15359 // C. Return RESPONSE_FILTER_DONE if all output data was written or 15360 // RESPONSE_FILTER_NEED_MORE_DATA if output data is still pending. 15361 // 15362 // This function will be called repeatedly until the input buffer has been 15363 // fully read (user sets |data_in_read| = |data_in_size|) and there is no more 15364 // input data to filter (the resource response is complete). This function may 15365 // then be called an additional time with an NULL input buffer if the user 15366 // filled the output buffer (set |data_out_written| = |data_out_size|) and 15367 // returned RESPONSE_FILTER_NEED_MORE_DATA to indicate that output data is 15368 // still pending. 15369 // 15370 // Calls to this function will stop when one of the following conditions is 15371 // met: 15372 // 15373 // A. There is no more input data to filter (the resource response is 15374 // complete) and the user sets |data_out_written| = 0 or returns 15375 // RESPONSE_FILTER_DONE to indicate that all data has been written, or; 15376 // B. The user returns RESPONSE_FILTER_ERROR to indicate an error. 15377 // 15378 // Do not keep a reference to the buffers passed to this function. 15379 /// 15380 extern(System) cef_response_filter_status_t function ( 15381 cef_response_filter_t* self, 15382 void* data_in, 15383 size_t data_in_size, 15384 size_t* data_in_read, 15385 void* data_out, 15386 size_t data_out_size, 15387 size_t* data_out_written) nothrow filter; 15388 } 15389 15390 15391 15392 // CEF_INCLUDE_CAPI_CEF_RESPONSE_FILTER_CAPI_H_ 15393 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 15394 // 15395 // Redistribution and use in source and binary forms, with or without 15396 // modification, are permitted provided that the following conditions are 15397 // met: 15398 // 15399 // * Redistributions of source code must retain the above copyright 15400 // notice, this list of conditions and the following disclaimer. 15401 // * Redistributions in binary form must reproduce the above 15402 // copyright notice, this list of conditions and the following disclaimer 15403 // in the documentation and/or other materials provided with the 15404 // distribution. 15405 // * Neither the name of Google Inc. nor the name Chromium Embedded 15406 // Framework nor the names of its contributors may be used to endorse 15407 // or promote products derived from this software without specific prior 15408 // written permission. 15409 // 15410 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 15411 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 15412 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 15413 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 15414 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 15415 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 15416 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 15417 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 15418 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 15419 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 15420 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15421 // 15422 // --------------------------------------------------------------------------- 15423 // 15424 // This file was generated by the CEF translator tool and should not edited 15425 // by hand. See the translator.README.txt file in the tools directory for 15426 // more information. 15427 // 15428 // $hash=9384e0b2bc27ccbdd7ebb1a86f213c28fd2784a1$ 15429 // 15430 15431 extern (C): 15432 15433 /// 15434 // Structure that manages custom scheme registrations. 15435 /// 15436 struct cef_scheme_registrar_t 15437 { 15438 /// 15439 // Base structure. 15440 /// 15441 cef_base_scoped_t base; 15442 15443 /// 15444 // Register a custom scheme. This function should not be called for the built- 15445 // in HTTP, HTTPS, FILE, FTP, ABOUT and DATA schemes. 15446 // 15447 // See cef_scheme_options_t for possible values for |options|. 15448 // 15449 // This function may be called on any thread. It should only be called once 15450 // per unique |scheme_name| value. If |scheme_name| is already registered or 15451 // if an error occurs this function will return false (0). 15452 /// 15453 extern(System) int function ( 15454 cef_scheme_registrar_t* self, 15455 const(cef_string_t)* scheme_name, 15456 int options) nothrow add_custom_scheme; 15457 } 15458 15459 15460 15461 /// 15462 // Structure that creates cef_resource_handler_t instances for handling scheme 15463 // requests. The functions of this structure will always be called on the IO 15464 // thread. 15465 /// 15466 struct cef_scheme_handler_factory_t 15467 { 15468 /// 15469 // Base structure. 15470 /// 15471 cef_base_ref_counted_t base; 15472 15473 /// 15474 // Return a new resource handler instance to handle the request or an NULL 15475 // reference to allow default handling of the request. |browser| and |frame| 15476 // will be the browser window and frame respectively that originated the 15477 // request or NULL if the request did not originate from a browser window (for 15478 // example, if the request came from cef_urlrequest_t). The |request| object 15479 // passed to this function cannot be modified. 15480 /// 15481 extern(System) cef_resource_handler_t* function ( 15482 cef_scheme_handler_factory_t* self, 15483 cef_browser_t* browser, 15484 cef_frame_t* frame, 15485 const(cef_string_t)* scheme_name, 15486 cef_request_t* request) nothrow create; 15487 } 15488 15489 15490 15491 /// 15492 // Register a scheme handler factory with the global request context. An NULL 15493 // |domain_name| value for a standard scheme will cause the factory to match all 15494 // domain names. The |domain_name| value will be ignored for non-standard 15495 // schemes. If |scheme_name| is a built-in scheme and no handler is returned by 15496 // |factory| then the built-in scheme handler factory will be called. If 15497 // |scheme_name| is a custom scheme then you must also implement the 15498 // cef_app_t::on_register_custom_schemes() function in all processes. This 15499 // function may be called multiple times to change or remove the factory that 15500 // matches the specified |scheme_name| and optional |domain_name|. Returns false 15501 // (0) if an error occurs. This function may be called on any thread in the 15502 // browser process. Using this function is equivalent to calling cef_request_con 15503 // text_t::cef_request_context_get_global_context()->register_scheme_handler_fac 15504 // tory(). 15505 /// 15506 int cef_register_scheme_handler_factory ( 15507 const(cef_string_t)* scheme_name, 15508 const(cef_string_t)* domain_name, 15509 cef_scheme_handler_factory_t* factory); 15510 15511 /// 15512 // Clear all scheme handler factories registered with the global request 15513 // context. Returns false (0) on error. This function may be called on any 15514 // thread in the browser process. Using this function is equivalent to calling c 15515 // ef_request_context_t::cef_request_context_get_global_context()->clear_scheme_ 15516 // handler_factories(). 15517 /// 15518 int cef_clear_scheme_handler_factories (); 15519 15520 // CEF_INCLUDE_CAPI_CEF_SCHEME_CAPI_H_ 15521 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 15522 // 15523 // Redistribution and use in source and binary forms, with or without 15524 // modification, are permitted provided that the following conditions are 15525 // met: 15526 // 15527 // * Redistributions of source code must retain the above copyright 15528 // notice, this list of conditions and the following disclaimer. 15529 // * Redistributions in binary form must reproduce the above 15530 // copyright notice, this list of conditions and the following disclaimer 15531 // in the documentation and/or other materials provided with the 15532 // distribution. 15533 // * Neither the name of Google Inc. nor the name Chromium Embedded 15534 // Framework nor the names of its contributors may be used to endorse 15535 // or promote products derived from this software without specific prior 15536 // written permission. 15537 // 15538 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 15539 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 15540 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 15541 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 15542 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 15543 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 15544 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 15545 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 15546 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 15547 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 15548 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15549 // 15550 // --------------------------------------------------------------------------- 15551 // 15552 // This file was generated by the CEF translator tool and should not edited 15553 // by hand. See the translator.README.txt file in the tools directory for 15554 // more information. 15555 // 15556 // $hash=37b3332057dbcf705b61a51cf14640d171d18a74$ 15557 // 15558 15559 extern (C): 15560 15561 /// 15562 // Structure representing a server that supports HTTP and WebSocket requests. 15563 // Server capacity is limited and is intended to handle only a small number of 15564 // simultaneous connections (e.g. for communicating between applications on 15565 // localhost). The functions of this structure are safe to call from any thread 15566 // in the brower process unless otherwise indicated. 15567 /// 15568 struct cef_server_t 15569 { 15570 /// 15571 // Base structure. 15572 /// 15573 cef_base_ref_counted_t base; 15574 15575 /// 15576 // Returns the task runner for the dedicated server thread. 15577 /// 15578 extern(System) cef_task_runner_t* function (cef_server_t* self) nothrow get_task_runner; 15579 15580 /// 15581 // Stop the server and shut down the dedicated server thread. See 15582 // cef_server_handler_t::OnServerCreated documentation for a description of 15583 // server lifespan. 15584 /// 15585 extern(System) void function (cef_server_t* self) nothrow shutdown; 15586 15587 /// 15588 // Returns true (1) if the server is currently running and accepting incoming 15589 // connections. See cef_server_handler_t::OnServerCreated documentation for a 15590 // description of server lifespan. This function must be called on the 15591 // dedicated server thread. 15592 /// 15593 extern(System) int function (cef_server_t* self) nothrow is_running; 15594 15595 /// 15596 // Returns the server address including the port number. 15597 /// 15598 // The resulting string must be freed by calling cef_string_userfree_free(). 15599 extern(System) cef_string_userfree_t function (cef_server_t* self) nothrow get_address; 15600 15601 /// 15602 // Returns true (1) if the server currently has a connection. This function 15603 // must be called on the dedicated server thread. 15604 /// 15605 extern(System) int function (cef_server_t* self) nothrow has_connection; 15606 15607 /// 15608 // Returns true (1) if |connection_id| represents a valid connection. This 15609 // function must be called on the dedicated server thread. 15610 /// 15611 extern(System) int function (cef_server_t* self, int connection_id) nothrow is_valid_connection; 15612 15613 /// 15614 // Send an HTTP 200 "OK" response to the connection identified by 15615 // |connection_id|. |content_type| is the response content type (e.g. 15616 // "text/html"), |data| is the response content, and |data_size| is the size 15617 // of |data| in bytes. The contents of |data| will be copied. The connection 15618 // will be closed automatically after the response is sent. 15619 /// 15620 extern(System) void function ( 15621 cef_server_t* self, 15622 int connection_id, 15623 const(cef_string_t)* content_type, 15624 const(void)* data, 15625 size_t data_size) nothrow send_http200response; 15626 15627 /// 15628 // Send an HTTP 404 "Not Found" response to the connection identified by 15629 // |connection_id|. The connection will be closed automatically after the 15630 // response is sent. 15631 /// 15632 extern(System) void function ( 15633 cef_server_t* self, 15634 int connection_id) nothrow send_http404response; 15635 15636 /// 15637 // Send an HTTP 500 "Internal Server Error" response to the connection 15638 // identified by |connection_id|. |error_message| is the associated error 15639 // message. The connection will be closed automatically after the response is 15640 // sent. 15641 /// 15642 extern(System) void function ( 15643 cef_server_t* self, 15644 int connection_id, 15645 const(cef_string_t)* error_message) nothrow send_http500response; 15646 15647 /// 15648 // Send a custom HTTP response to the connection identified by 15649 // |connection_id|. |response_code| is the HTTP response code sent in the 15650 // status line (e.g. 200), |content_type| is the response content type sent as 15651 // the "Content-Type" header (e.g. "text/html"), |content_length| is the 15652 // expected content length, and |extra_headers| is the map of extra response 15653 // headers. If |content_length| is >= 0 then the "Content-Length" header will 15654 // be sent. If |content_length| is 0 then no content is expected and the 15655 // connection will be closed automatically after the response is sent. If 15656 // |content_length| is < 0 then no "Content-Length" header will be sent and 15657 // the client will continue reading until the connection is closed. Use the 15658 // SendRawData function to send the content, if applicable, and call 15659 // CloseConnection after all content has been sent. 15660 /// 15661 extern(System) void function ( 15662 cef_server_t* self, 15663 int connection_id, 15664 int response_code, 15665 const(cef_string_t)* content_type, 15666 int64 content_length, 15667 cef_string_multimap_t extra_headers) nothrow send_http_response; 15668 15669 /// 15670 // Send raw data directly to the connection identified by |connection_id|. 15671 // |data| is the raw data and |data_size| is the size of |data| in bytes. The 15672 // contents of |data| will be copied. No validation of |data| is performed 15673 // internally so the client should be careful to send the amount indicated by 15674 // the "Content-Length" header, if specified. See SendHttpResponse 15675 // documentation for intended usage. 15676 /// 15677 extern(System) void function ( 15678 cef_server_t* self, 15679 int connection_id, 15680 const(void)* data, 15681 size_t data_size) nothrow send_raw_data; 15682 15683 /// 15684 // Close the connection identified by |connection_id|. See SendHttpResponse 15685 // documentation for intended usage. 15686 /// 15687 extern(System) void function (cef_server_t* self, int connection_id) nothrow close_connection; 15688 15689 /// 15690 // Send a WebSocket message to the connection identified by |connection_id|. 15691 // |data| is the response content and |data_size| is the size of |data| in 15692 // bytes. The contents of |data| will be copied. See 15693 // cef_server_handler_t::OnWebSocketRequest documentation for intended usage. 15694 /// 15695 extern(System) void function ( 15696 cef_server_t* self, 15697 int connection_id, 15698 const(void)* data, 15699 size_t data_size) nothrow send_web_socket_message; 15700 } 15701 15702 15703 15704 /// 15705 // Create a new server that binds to |address| and |port|. |address| must be a 15706 // valid IPv4 or IPv6 address (e.g. 127.0.0.1 or ::1) and |port| must be a port 15707 // number outside of the reserved range (e.g. between 1025 and 65535 on most 15708 // platforms). |backlog| is the maximum number of pending connections. A new 15709 // thread will be created for each CreateServer call (the "dedicated server 15710 // thread"). It is therefore recommended to use a different cef_server_handler_t 15711 // instance for each CreateServer call to avoid thread safety issues in the 15712 // cef_server_handler_t implementation. The 15713 // cef_server_handler_t::OnServerCreated function will be called on the 15714 // dedicated server thread to report success or failure. See 15715 // cef_server_handler_t::OnServerCreated documentation for a description of 15716 // server lifespan. 15717 /// 15718 void cef_server_create ( 15719 const(cef_string_t)* address, 15720 uint16 port, 15721 int backlog, 15722 cef_server_handler_t* handler); 15723 15724 /// 15725 // Implement this structure to handle HTTP server requests. A new thread will be 15726 // created for each cef_server_t::CreateServer call (the "dedicated server 15727 // thread"), and the functions of this structure will be called on that thread. 15728 // It is therefore recommended to use a different cef_server_handler_t instance 15729 // for each cef_server_t::CreateServer call to avoid thread safety issues in the 15730 // cef_server_handler_t implementation. 15731 /// 15732 struct cef_server_handler_t 15733 { 15734 /// 15735 // Base structure. 15736 /// 15737 cef_base_ref_counted_t base; 15738 15739 /// 15740 // Called when |server| is created. If the server was started successfully 15741 // then cef_server_t::IsRunning will return true (1). The server will continue 15742 // running until cef_server_t::Shutdown is called, after which time 15743 // OnServerDestroyed will be called. If the server failed to start then 15744 // OnServerDestroyed will be called immediately after this function returns. 15745 /// 15746 extern(System) void function ( 15747 cef_server_handler_t* self, 15748 cef_server_t* server) nothrow on_server_created; 15749 15750 /// 15751 // Called when |server| is destroyed. The server thread will be stopped after 15752 // this function returns. The client should release any references to |server| 15753 // when this function is called. See OnServerCreated documentation for a 15754 // description of server lifespan. 15755 /// 15756 extern(System) void function ( 15757 cef_server_handler_t* self, 15758 cef_server_t* server) nothrow on_server_destroyed; 15759 15760 /// 15761 // Called when a client connects to |server|. |connection_id| uniquely 15762 // identifies the connection. Each call to this function will have a matching 15763 // call to OnClientDisconnected. 15764 /// 15765 extern(System) void function ( 15766 cef_server_handler_t* self, 15767 cef_server_t* server, 15768 int connection_id) nothrow on_client_connected; 15769 15770 /// 15771 // Called when a client disconnects from |server|. |connection_id| uniquely 15772 // identifies the connection. The client should release any data associated 15773 // with |connection_id| when this function is called and |connection_id| 15774 // should no longer be passed to cef_server_t functions. Disconnects can 15775 // originate from either the client or the server. For example, the server 15776 // will disconnect automatically after a cef_server_t::SendHttpXXXResponse 15777 // function is called. 15778 /// 15779 extern(System) void function ( 15780 cef_server_handler_t* self, 15781 cef_server_t* server, 15782 int connection_id) nothrow on_client_disconnected; 15783 15784 /// 15785 // Called when |server| receives an HTTP request. |connection_id| uniquely 15786 // identifies the connection, |client_address| is the requesting IPv4 or IPv6 15787 // client address including port number, and |request| contains the request 15788 // contents (URL, function, headers and optional POST data). Call cef_server_t 15789 // functions either synchronously or asynchronusly to send a response. 15790 /// 15791 extern(System) void function ( 15792 cef_server_handler_t* self, 15793 cef_server_t* server, 15794 int connection_id, 15795 const(cef_string_t)* client_address, 15796 cef_request_t* request) nothrow on_http_request; 15797 15798 /// 15799 // Called when |server| receives a WebSocket request. |connection_id| uniquely 15800 // identifies the connection, |client_address| is the requesting IPv4 or IPv6 15801 // client address including port number, and |request| contains the request 15802 // contents (URL, function, headers and optional POST data). Execute 15803 // |callback| either synchronously or asynchronously to accept or decline the 15804 // WebSocket connection. If the request is accepted then OnWebSocketConnected 15805 // will be called after the WebSocket has connected and incoming messages will 15806 // be delivered to the OnWebSocketMessage callback. If the request is declined 15807 // then the client will be disconnected and OnClientDisconnected will be 15808 // called. Call the cef_server_t::SendWebSocketMessage function after 15809 // receiving the OnWebSocketConnected callback to respond with WebSocket 15810 // messages. 15811 /// 15812 extern(System) void function ( 15813 cef_server_handler_t* self, 15814 cef_server_t* server, 15815 int connection_id, 15816 const(cef_string_t)* client_address, 15817 cef_request_t* request, 15818 cef_callback_t* callback) nothrow on_web_socket_request; 15819 15820 /// 15821 // Called after the client has accepted the WebSocket connection for |server| 15822 // and |connection_id| via the OnWebSocketRequest callback. See 15823 // OnWebSocketRequest documentation for intended usage. 15824 /// 15825 extern(System) void function ( 15826 cef_server_handler_t* self, 15827 cef_server_t* server, 15828 int connection_id) nothrow on_web_socket_connected; 15829 15830 /// 15831 // Called when |server| receives an WebSocket message. |connection_id| 15832 // uniquely identifies the connection, |data| is the message content and 15833 // |data_size| is the size of |data| in bytes. Do not keep a reference to 15834 // |data| outside of this function. See OnWebSocketRequest documentation for 15835 // intended usage. 15836 /// 15837 extern(System) void function ( 15838 cef_server_handler_t* self, 15839 cef_server_t* server, 15840 int connection_id, 15841 const(void)* data, 15842 size_t data_size) nothrow on_web_socket_message; 15843 } 15844 15845 15846 15847 // CEF_INCLUDE_CAPI_CEF_SERVER_CAPI_H_ 15848 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 15849 // 15850 // Redistribution and use in source and binary forms, with or without 15851 // modification, are permitted provided that the following conditions are 15852 // met: 15853 // 15854 // * Redistributions of source code must retain the above copyright 15855 // notice, this list of conditions and the following disclaimer. 15856 // * Redistributions in binary form must reproduce the above 15857 // copyright notice, this list of conditions and the following disclaimer 15858 // in the documentation and/or other materials provided with the 15859 // distribution. 15860 // * Neither the name of Google Inc. nor the name Chromium Embedded 15861 // Framework nor the names of its contributors may be used to endorse 15862 // or promote products derived from this software without specific prior 15863 // written permission. 15864 // 15865 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 15866 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 15867 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 15868 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 15869 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 15870 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 15871 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 15872 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 15873 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 15874 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 15875 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15876 // 15877 // --------------------------------------------------------------------------- 15878 // 15879 // This file was generated by the CEF translator tool and should not edited 15880 // by hand. See the translator.README.txt file in the tools directory for 15881 // more information. 15882 // 15883 // $hash=aefb3b63aba8f5df6ab6dc11e2029820c75c36cf$ 15884 // 15885 15886 extern (C): 15887 15888 /// 15889 // Structure representing SSL information. 15890 /// 15891 struct cef_sslinfo_t 15892 { 15893 /// 15894 // Base structure. 15895 /// 15896 cef_base_ref_counted_t base; 15897 15898 /// 15899 // Returns a bitmask containing any and all problems verifying the server 15900 // certificate. 15901 /// 15902 extern(System) cef_cert_status_t function (cef_sslinfo_t* self) nothrow get_cert_status; 15903 15904 /// 15905 // Returns the X.509 certificate. 15906 /// 15907 extern(System) cef_x509certificate_t* function ( 15908 cef_sslinfo_t* self) nothrow get_x509certificate; 15909 } 15910 15911 15912 15913 /// 15914 // Returns true (1) if the certificate status represents an error. 15915 /// 15916 int cef_is_cert_status_error (cef_cert_status_t status); 15917 15918 // CEF_INCLUDE_CAPI_CEF_SSL_INFO_CAPI_H_ 15919 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 15920 // 15921 // Redistribution and use in source and binary forms, with or without 15922 // modification, are permitted provided that the following conditions are 15923 // met: 15924 // 15925 // * Redistributions of source code must retain the above copyright 15926 // notice, this list of conditions and the following disclaimer. 15927 // * Redistributions in binary form must reproduce the above 15928 // copyright notice, this list of conditions and the following disclaimer 15929 // in the documentation and/or other materials provided with the 15930 // distribution. 15931 // * Neither the name of Google Inc. nor the name Chromium Embedded 15932 // Framework nor the names of its contributors may be used to endorse 15933 // or promote products derived from this software without specific prior 15934 // written permission. 15935 // 15936 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 15937 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 15938 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 15939 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 15940 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 15941 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 15942 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 15943 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 15944 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 15945 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 15946 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15947 // 15948 // --------------------------------------------------------------------------- 15949 // 15950 // This file was generated by the CEF translator tool and should not edited 15951 // by hand. See the translator.README.txt file in the tools directory for 15952 // more information. 15953 // 15954 // $hash=93eb2bc0f51da08a41fb906436654b3452b74fb3$ 15955 // 15956 15957 extern (C): 15958 15959 /// 15960 // Structure representing the SSL information for a navigation entry. 15961 /// 15962 struct cef_sslstatus_t 15963 { 15964 /// 15965 // Base structure. 15966 /// 15967 cef_base_ref_counted_t base; 15968 15969 /// 15970 // Returns true (1) if the status is related to a secure SSL/TLS connection. 15971 /// 15972 extern(System) int function (cef_sslstatus_t* self) nothrow is_secure_connection; 15973 15974 /// 15975 // Returns a bitmask containing any and all problems verifying the server 15976 // certificate. 15977 /// 15978 extern(System) cef_cert_status_t function (cef_sslstatus_t* self) nothrow get_cert_status; 15979 15980 /// 15981 // Returns the SSL version used for the SSL connection. 15982 /// 15983 extern(System) cef_ssl_version_t function (cef_sslstatus_t* self) nothrow get_sslversion; 15984 15985 /// 15986 // Returns a bitmask containing the page security content status. 15987 /// 15988 extern(System) cef_ssl_content_status_t function ( 15989 cef_sslstatus_t* self) nothrow get_content_status; 15990 15991 /// 15992 // Returns the X.509 certificate. 15993 /// 15994 extern(System) cef_x509certificate_t* function ( 15995 cef_sslstatus_t* self) nothrow get_x509certificate; 15996 } 15997 15998 15999 16000 // CEF_INCLUDE_CAPI_CEF_SSL_STATUS_CAPI_H_ 16001 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 16002 // 16003 // Redistribution and use in source and binary forms, with or without 16004 // modification, are permitted provided that the following conditions are 16005 // met: 16006 // 16007 // * Redistributions of source code must retain the above copyright 16008 // notice, this list of conditions and the following disclaimer. 16009 // * Redistributions in binary form must reproduce the above 16010 // copyright notice, this list of conditions and the following disclaimer 16011 // in the documentation and/or other materials provided with the 16012 // distribution. 16013 // * Neither the name of Google Inc. nor the name Chromium Embedded 16014 // Framework nor the names of its contributors may be used to endorse 16015 // or promote products derived from this software without specific prior 16016 // written permission. 16017 // 16018 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 16019 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 16020 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 16021 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 16022 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 16023 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 16024 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 16025 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 16026 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 16027 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 16028 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 16029 // 16030 // --------------------------------------------------------------------------- 16031 // 16032 // This file was generated by the CEF translator tool and should not edited 16033 // by hand. See the translator.README.txt file in the tools directory for 16034 // more information. 16035 // 16036 // $hash=61ff7a4ebc917482bad5daba7089b92cc62bada8$ 16037 // 16038 16039 extern (C): 16040 16041 /// 16042 // Structure the client can implement to provide a custom stream reader. The 16043 // functions of this structure may be called on any thread. 16044 /// 16045 struct cef_read_handler_t 16046 { 16047 /// 16048 // Base structure. 16049 /// 16050 cef_base_ref_counted_t base; 16051 16052 /// 16053 // Read raw binary data. 16054 /// 16055 extern(System) size_t function ( 16056 cef_read_handler_t* self, 16057 void* ptr, 16058 size_t size, 16059 size_t n) nothrow read; 16060 16061 /// 16062 // Seek to the specified offset position. |whence| may be any one of SEEK_CUR, 16063 // SEEK_END or SEEK_SET. Return zero on success and non-zero on failure. 16064 /// 16065 extern(System) int function (cef_read_handler_t* self, int64 offset, int whence) nothrow seek; 16066 16067 /// 16068 // Return the current offset position. 16069 /// 16070 extern(System) int64 function (cef_read_handler_t* self) nothrow tell; 16071 16072 /// 16073 // Return non-zero if at end of file. 16074 /// 16075 extern(System) int function (cef_read_handler_t* self) nothrow eof; 16076 16077 /// 16078 // Return true (1) if this handler performs work like accessing the file 16079 // system which may block. Used as a hint for determining the thread to access 16080 // the handler from. 16081 /// 16082 extern(System) int function (cef_read_handler_t* self) nothrow may_block; 16083 } 16084 16085 16086 16087 /// 16088 // Structure used to read data from a stream. The functions of this structure 16089 // may be called on any thread. 16090 /// 16091 struct cef_stream_reader_t 16092 { 16093 /// 16094 // Base structure. 16095 /// 16096 cef_base_ref_counted_t base; 16097 16098 /// 16099 // Read raw binary data. 16100 /// 16101 extern(System) size_t function ( 16102 cef_stream_reader_t* self, 16103 void* ptr, 16104 size_t size, 16105 size_t n) nothrow read; 16106 16107 /// 16108 // Seek to the specified offset position. |whence| may be any one of SEEK_CUR, 16109 // SEEK_END or SEEK_SET. Returns zero on success and non-zero on failure. 16110 /// 16111 extern(System) int function (cef_stream_reader_t* self, int64 offset, int whence) nothrow seek; 16112 16113 /// 16114 // Return the current offset position. 16115 /// 16116 extern(System) int64 function (cef_stream_reader_t* self) nothrow tell; 16117 16118 /// 16119 // Return non-zero if at end of file. 16120 /// 16121 extern(System) int function (cef_stream_reader_t* self) nothrow eof; 16122 16123 /// 16124 // Returns true (1) if this reader performs work like accessing the file 16125 // system which may block. Used as a hint for determining the thread to access 16126 // the reader from. 16127 /// 16128 extern(System) int function (cef_stream_reader_t* self) nothrow may_block; 16129 } 16130 16131 16132 16133 /// 16134 // Create a new cef_stream_reader_t object from a file. 16135 /// 16136 cef_stream_reader_t* cef_stream_reader_create_for_file ( 16137 const(cef_string_t)* fileName); 16138 16139 /// 16140 // Create a new cef_stream_reader_t object from data. 16141 /// 16142 cef_stream_reader_t* cef_stream_reader_create_for_data ( 16143 void* data, 16144 size_t size); 16145 16146 /// 16147 // Create a new cef_stream_reader_t object from a custom handler. 16148 /// 16149 cef_stream_reader_t* cef_stream_reader_create_for_handler ( 16150 cef_read_handler_t* handler); 16151 16152 /// 16153 // Structure the client can implement to provide a custom stream writer. The 16154 // functions of this structure may be called on any thread. 16155 /// 16156 struct cef_write_handler_t 16157 { 16158 /// 16159 // Base structure. 16160 /// 16161 cef_base_ref_counted_t base; 16162 16163 /// 16164 // Write raw binary data. 16165 /// 16166 extern(System) size_t function ( 16167 cef_write_handler_t* self, 16168 const(void)* ptr, 16169 size_t size, 16170 size_t n) nothrow write; 16171 16172 /// 16173 // Seek to the specified offset position. |whence| may be any one of SEEK_CUR, 16174 // SEEK_END or SEEK_SET. Return zero on success and non-zero on failure. 16175 /// 16176 extern(System) int function (cef_write_handler_t* self, int64 offset, int whence) nothrow seek; 16177 16178 /// 16179 // Return the current offset position. 16180 /// 16181 extern(System) int64 function (cef_write_handler_t* self) nothrow tell; 16182 16183 /// 16184 // Flush the stream. 16185 /// 16186 extern(System) int function (cef_write_handler_t* self) nothrow flush; 16187 16188 /// 16189 // Return true (1) if this handler performs work like accessing the file 16190 // system which may block. Used as a hint for determining the thread to access 16191 // the handler from. 16192 /// 16193 extern(System) int function (cef_write_handler_t* self) nothrow may_block; 16194 } 16195 16196 16197 16198 /// 16199 // Structure used to write data to a stream. The functions of this structure may 16200 // be called on any thread. 16201 /// 16202 struct cef_stream_writer_t 16203 { 16204 /// 16205 // Base structure. 16206 /// 16207 cef_base_ref_counted_t base; 16208 16209 /// 16210 // Write raw binary data. 16211 /// 16212 extern(System) size_t function ( 16213 cef_stream_writer_t* self, 16214 const(void)* ptr, 16215 size_t size, 16216 size_t n) nothrow write; 16217 16218 /// 16219 // Seek to the specified offset position. |whence| may be any one of SEEK_CUR, 16220 // SEEK_END or SEEK_SET. Returns zero on success and non-zero on failure. 16221 /// 16222 extern(System) int function (cef_stream_writer_t* self, int64 offset, int whence) nothrow seek; 16223 16224 /// 16225 // Return the current offset position. 16226 /// 16227 extern(System) int64 function (cef_stream_writer_t* self) nothrow tell; 16228 16229 /// 16230 // Flush the stream. 16231 /// 16232 extern(System) int function (cef_stream_writer_t* self) nothrow flush; 16233 16234 /// 16235 // Returns true (1) if this writer performs work like accessing the file 16236 // system which may block. Used as a hint for determining the thread to access 16237 // the writer from. 16238 /// 16239 extern(System) int function (cef_stream_writer_t* self) nothrow may_block; 16240 } 16241 16242 16243 16244 /// 16245 // Create a new cef_stream_writer_t object for a file. 16246 /// 16247 cef_stream_writer_t* cef_stream_writer_create_for_file ( 16248 const(cef_string_t)* fileName); 16249 16250 /// 16251 // Create a new cef_stream_writer_t object for a custom handler. 16252 /// 16253 cef_stream_writer_t* cef_stream_writer_create_for_handler ( 16254 cef_write_handler_t* handler); 16255 16256 // CEF_INCLUDE_CAPI_CEF_STREAM_CAPI_H_ 16257 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 16258 // 16259 // Redistribution and use in source and binary forms, with or without 16260 // modification, are permitted provided that the following conditions are 16261 // met: 16262 // 16263 // * Redistributions of source code must retain the above copyright 16264 // notice, this list of conditions and the following disclaimer. 16265 // * Redistributions in binary form must reproduce the above 16266 // copyright notice, this list of conditions and the following disclaimer 16267 // in the documentation and/or other materials provided with the 16268 // distribution. 16269 // * Neither the name of Google Inc. nor the name Chromium Embedded 16270 // Framework nor the names of its contributors may be used to endorse 16271 // or promote products derived from this software without specific prior 16272 // written permission. 16273 // 16274 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 16275 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 16276 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 16277 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 16278 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 16279 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 16280 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 16281 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 16282 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 16283 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 16284 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 16285 // 16286 // --------------------------------------------------------------------------- 16287 // 16288 // This file was generated by the CEF translator tool and should not edited 16289 // by hand. See the translator.README.txt file in the tools directory for 16290 // more information. 16291 // 16292 // $hash=30d4a63d53bce310ad641cbe5096ae126a664076$ 16293 // 16294 16295 extern (C): 16296 16297 /// 16298 // Implement this structure to receive string values asynchronously. 16299 /// 16300 struct cef_string_visitor_t 16301 { 16302 /// 16303 // Base structure. 16304 /// 16305 cef_base_ref_counted_t base; 16306 16307 /// 16308 // Method that will be executed. 16309 /// 16310 extern(System) void function ( 16311 cef_string_visitor_t* self, 16312 const(cef_string_t)* string) nothrow visit; 16313 } 16314 16315 16316 16317 // CEF_INCLUDE_CAPI_CEF_STRING_VISITOR_CAPI_H_ 16318 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 16319 // 16320 // Redistribution and use in source and binary forms, with or without 16321 // modification, are permitted provided that the following conditions are 16322 // met: 16323 // 16324 // * Redistributions of source code must retain the above copyright 16325 // notice, this list of conditions and the following disclaimer. 16326 // * Redistributions in binary form must reproduce the above 16327 // copyright notice, this list of conditions and the following disclaimer 16328 // in the documentation and/or other materials provided with the 16329 // distribution. 16330 // * Neither the name of Google Inc. nor the name Chromium Embedded 16331 // Framework nor the names of its contributors may be used to endorse 16332 // or promote products derived from this software without specific prior 16333 // written permission. 16334 // 16335 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 16336 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 16337 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 16338 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 16339 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 16340 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 16341 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 16342 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 16343 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 16344 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 16345 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 16346 // 16347 // --------------------------------------------------------------------------- 16348 // 16349 // This file was generated by the CEF translator tool and should not edited 16350 // by hand. See the translator.README.txt file in the tools directory for 16351 // more information. 16352 // 16353 // $hash=a8b2162b7c3b7cede392e8531c46a1277e990689$ 16354 // 16355 16356 extern (C): 16357 16358 /// 16359 // Implement this structure for asynchronous task execution. If the task is 16360 // posted successfully and if the associated message loop is still running then 16361 // the execute() function will be called on the target thread. If the task fails 16362 // to post then the task object may be destroyed on the source thread instead of 16363 // the target thread. For this reason be cautious when performing work in the 16364 // task object destructor. 16365 /// 16366 struct cef_task_t 16367 { 16368 /// 16369 // Base structure. 16370 /// 16371 cef_base_ref_counted_t base; 16372 16373 /// 16374 // Method that will be executed on the target thread. 16375 /// 16376 extern(System) void function (cef_task_t* self) nothrow execute; 16377 } 16378 16379 16380 16381 /// 16382 // Structure that asynchronously executes tasks on the associated thread. It is 16383 // safe to call the functions of this structure on any thread. 16384 // 16385 // CEF maintains multiple internal threads that are used for handling different 16386 // types of tasks in different processes. The cef_thread_id_t definitions in 16387 // cef_types.h list the common CEF threads. Task runners are also available for 16388 // other CEF threads as appropriate (for example, V8 WebWorker threads). 16389 /// 16390 struct cef_task_runner_t 16391 { 16392 /// 16393 // Base structure. 16394 /// 16395 cef_base_ref_counted_t base; 16396 16397 /// 16398 // Returns true (1) if this object is pointing to the same task runner as 16399 // |that| object. 16400 /// 16401 extern(System) int function (cef_task_runner_t* self, cef_task_runner_t* that) nothrow is_same; 16402 16403 /// 16404 // Returns true (1) if this task runner belongs to the current thread. 16405 /// 16406 extern(System) int function (cef_task_runner_t* self) nothrow belongs_to_current_thread; 16407 16408 /// 16409 // Returns true (1) if this task runner is for the specified CEF thread. 16410 /// 16411 extern(System) int function ( 16412 cef_task_runner_t* self, 16413 cef_thread_id_t threadId) nothrow belongs_to_thread; 16414 16415 /// 16416 // Post a task for execution on the thread associated with this task runner. 16417 // Execution will occur asynchronously. 16418 /// 16419 extern(System) int function (cef_task_runner_t* self, cef_task_t* task) nothrow post_task; 16420 16421 /// 16422 // Post a task for delayed execution on the thread associated with this task 16423 // runner. Execution will occur asynchronously. Delayed tasks are not 16424 // supported on V8 WebWorker threads and will be executed without the 16425 // specified delay. 16426 /// 16427 extern(System) int function ( 16428 cef_task_runner_t* self, 16429 cef_task_t* task, 16430 int64 delay_ms) nothrow post_delayed_task; 16431 } 16432 16433 16434 16435 /// 16436 // Returns the task runner for the current thread. Only CEF threads will have 16437 // task runners. An NULL reference will be returned if this function is called 16438 // on an invalid thread. 16439 /// 16440 cef_task_runner_t* cef_task_runner_get_for_current_thread (); 16441 16442 /// 16443 // Returns the task runner for the specified CEF thread. 16444 /// 16445 cef_task_runner_t* cef_task_runner_get_for_thread (cef_thread_id_t threadId); 16446 16447 /// 16448 // Returns true (1) if called on the specified thread. Equivalent to using 16449 // cef_task_runner_t::GetForThread(threadId)->belongs_to_current_thread(). 16450 /// 16451 int cef_currently_on (cef_thread_id_t threadId); 16452 16453 /// 16454 // Post a task for execution on the specified thread. Equivalent to using 16455 // cef_task_runner_t::GetForThread(threadId)->PostTask(task). 16456 /// 16457 int cef_post_task (cef_thread_id_t threadId, cef_task_t* task); 16458 16459 /// 16460 // Post a task for delayed execution on the specified thread. Equivalent to 16461 // using cef_task_runner_t::GetForThread(threadId)->PostDelayedTask(task, 16462 // delay_ms). 16463 /// 16464 int cef_post_delayed_task ( 16465 cef_thread_id_t threadId, 16466 cef_task_t* task, 16467 int64 delay_ms); 16468 16469 // CEF_INCLUDE_CAPI_CEF_TASK_CAPI_H_ 16470 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 16471 // 16472 // Redistribution and use in source and binary forms, with or without 16473 // modification, are permitted provided that the following conditions are 16474 // met: 16475 // 16476 // * Redistributions of source code must retain the above copyright 16477 // notice, this list of conditions and the following disclaimer. 16478 // * Redistributions in binary form must reproduce the above 16479 // copyright notice, this list of conditions and the following disclaimer 16480 // in the documentation and/or other materials provided with the 16481 // distribution. 16482 // * Neither the name of Google Inc. nor the name Chromium Embedded 16483 // Framework nor the names of its contributors may be used to endorse 16484 // or promote products derived from this software without specific prior 16485 // written permission. 16486 // 16487 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 16488 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 16489 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 16490 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 16491 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 16492 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 16493 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 16494 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 16495 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 16496 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 16497 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 16498 // 16499 // --------------------------------------------------------------------------- 16500 // 16501 // This file was generated by the CEF translator tool and should not edited 16502 // by hand. See the translator.README.txt file in the tools directory for 16503 // more information. 16504 // 16505 // $hash=9a471c97e43ad3d1d042ba3dc6d887f2f4b0d851$ 16506 // 16507 16508 extern (C): 16509 16510 /// 16511 // A simple thread abstraction that establishes a message loop on a new thread. 16512 // The consumer uses cef_task_runner_t to execute code on the thread's message 16513 // loop. The thread is terminated when the cef_thread_t object is destroyed or 16514 // stop() is called. All pending tasks queued on the thread's message loop will 16515 // run to completion before the thread is terminated. cef_thread_create() can be 16516 // called on any valid CEF thread in either the browser or render process. This 16517 // structure should only be used for tasks that require a dedicated thread. In 16518 // most cases you can post tasks to an existing CEF thread instead of creating a 16519 // new one; see cef_task.h for details. 16520 /// 16521 struct cef_thread_t 16522 { 16523 /// 16524 // Base structure. 16525 /// 16526 cef_base_ref_counted_t base; 16527 16528 /// 16529 // Returns the cef_task_runner_t that will execute code on this thread's 16530 // message loop. This function is safe to call from any thread. 16531 /// 16532 extern(System) cef_task_runner_t* function (cef_thread_t* self) nothrow get_task_runner; 16533 16534 /// 16535 // Returns the platform thread ID. It will return the same value after stop() 16536 // is called. This function is safe to call from any thread. 16537 /// 16538 extern(System) cef_platform_thread_id_t function ( 16539 cef_thread_t* self) nothrow get_platform_thread_id; 16540 16541 /// 16542 // Stop and join the thread. This function must be called from the same thread 16543 // that called cef_thread_create(). Do not call this function if 16544 // cef_thread_create() was called with a |stoppable| value of false (0). 16545 /// 16546 extern(System) void function (cef_thread_t* self) nothrow stop; 16547 16548 /// 16549 // Returns true (1) if the thread is currently running. This function must be 16550 // called from the same thread that called cef_thread_create(). 16551 /// 16552 extern(System) int function (cef_thread_t* self) nothrow is_running; 16553 } 16554 16555 16556 16557 /// 16558 // Create and start a new thread. This function does not block waiting for the 16559 // thread to run initialization. |display_name| is the name that will be used to 16560 // identify the thread. |priority| is the thread execution priority. 16561 // |message_loop_type| indicates the set of asynchronous events that the thread 16562 // can process. If |stoppable| is true (1) the thread will stopped and joined on 16563 // destruction or when stop() is called; otherwise, the thread cannot be stopped 16564 // and will be leaked on shutdown. On Windows the |com_init_mode| value 16565 // specifies how COM will be initialized for the thread. If |com_init_mode| is 16566 // set to COM_INIT_MODE_STA then |message_loop_type| must be set to ML_TYPE_UI. 16567 /// 16568 cef_thread_t* cef_thread_create ( 16569 const(cef_string_t)* display_name, 16570 cef_thread_priority_t priority, 16571 cef_message_loop_type_t message_loop_type, 16572 int stoppable, 16573 cef_com_init_mode_t com_init_mode); 16574 16575 // CEF_INCLUDE_CAPI_CEF_THREAD_CAPI_H_ 16576 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 16577 // 16578 // Redistribution and use in source and binary forms, with or without 16579 // modification, are permitted provided that the following conditions are 16580 // met: 16581 // 16582 // * Redistributions of source code must retain the above copyright 16583 // notice, this list of conditions and the following disclaimer. 16584 // * Redistributions in binary form must reproduce the above 16585 // copyright notice, this list of conditions and the following disclaimer 16586 // in the documentation and/or other materials provided with the 16587 // distribution. 16588 // * Neither the name of Google Inc. nor the name Chromium Embedded 16589 // Framework nor the names of its contributors may be used to endorse 16590 // or promote products derived from this software without specific prior 16591 // written permission. 16592 // 16593 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 16594 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 16595 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 16596 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 16597 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 16598 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 16599 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 16600 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 16601 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 16602 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 16603 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 16604 // 16605 // --------------------------------------------------------------------------- 16606 // 16607 // This file was generated by the CEF translator tool and should not edited 16608 // by hand. See the translator.README.txt file in the tools directory for 16609 // more information. 16610 // 16611 // $hash=99779f8a728d2e1a0b87d6d6b89bd28e5da16d4c$ 16612 // 16613 16614 extern (C): 16615 16616 /// 16617 // Implement this structure to receive notification when tracing has completed. 16618 // The functions of this structure will be called on the browser process UI 16619 // thread. 16620 /// 16621 struct cef_end_tracing_callback_t 16622 { 16623 /// 16624 // Base structure. 16625 /// 16626 cef_base_ref_counted_t base; 16627 16628 /// 16629 // Called after all processes have sent their trace data. |tracing_file| is 16630 // the path at which tracing data was written. The client is responsible for 16631 // deleting |tracing_file|. 16632 /// 16633 extern(System) void function ( 16634 cef_end_tracing_callback_t* self, 16635 const(cef_string_t)* tracing_file) nothrow on_end_tracing_complete; 16636 } 16637 16638 16639 16640 /// 16641 // Start tracing events on all processes. Tracing is initialized asynchronously 16642 // and |callback| will be executed on the UI thread after initialization is 16643 // complete. 16644 // 16645 // If CefBeginTracing was called previously, or if a CefEndTracingAsync call is 16646 // pending, CefBeginTracing will fail and return false (0). 16647 // 16648 // |categories| is a comma-delimited list of category wildcards. A category can 16649 // have an optional '-' prefix to make it an excluded category. Having both 16650 // included and excluded categories in the same list is not supported. 16651 // 16652 // Example: "test_MyTest*" Example: "test_MyTest*,test_OtherStuff" Example: 16653 // "-excluded_category1,-excluded_category2" 16654 // 16655 // This function must be called on the browser process UI thread. 16656 /// 16657 int cef_begin_tracing ( 16658 const(cef_string_t)* categories, 16659 cef_completion_callback_t* callback); 16660 16661 /// 16662 // Stop tracing events on all processes. 16663 // 16664 // This function will fail and return false (0) if a previous call to 16665 // CefEndTracingAsync is already pending or if CefBeginTracing was not called. 16666 // 16667 // |tracing_file| is the path at which tracing data will be written and 16668 // |callback| is the callback that will be executed once all processes have sent 16669 // their trace data. If |tracing_file| is NULL a new temporary file path will be 16670 // used. If |callback| is NULL no trace data will be written. 16671 // 16672 // This function must be called on the browser process UI thread. 16673 /// 16674 int cef_end_tracing ( 16675 const(cef_string_t)* tracing_file, 16676 cef_end_tracing_callback_t* callback); 16677 16678 /// 16679 // Returns the current system trace time or, if none is defined, the current 16680 // high-res time. Can be used by clients to synchronize with the time 16681 // information in trace events. 16682 /// 16683 int64 cef_now_from_system_trace_time (); 16684 16685 // CEF_INCLUDE_CAPI_CEF_TRACE_CAPI_H_ 16686 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 16687 // 16688 // Redistribution and use in source and binary forms, with or without 16689 // modification, are permitted provided that the following conditions are 16690 // met: 16691 // 16692 // * Redistributions of source code must retain the above copyright 16693 // notice, this list of conditions and the following disclaimer. 16694 // * Redistributions in binary form must reproduce the above 16695 // copyright notice, this list of conditions and the following disclaimer 16696 // in the documentation and/or other materials provided with the 16697 // distribution. 16698 // * Neither the name of Google Inc. nor the name Chromium Embedded 16699 // Framework nor the names of its contributors may be used to endorse 16700 // or promote products derived from this software without specific prior 16701 // written permission. 16702 // 16703 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 16704 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 16705 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 16706 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 16707 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 16708 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 16709 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 16710 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 16711 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 16712 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 16713 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 16714 // 16715 // --------------------------------------------------------------------------- 16716 // 16717 // This file was generated by the CEF translator tool and should not edited 16718 // by hand. See the translator.README.txt file in the tools directory for 16719 // more information. 16720 // 16721 // $hash=11c227079ec0687adeaa8a085aeec37c89346ee7$ 16722 // 16723 16724 extern (C): 16725 16726 /// 16727 // Structure used to make a URL request. URL requests are not associated with a 16728 // browser instance so no cef_client_t callbacks will be executed. URL requests 16729 // can be created on any valid CEF thread in either the browser or render 16730 // process. Once created the functions of the URL request object must be 16731 // accessed on the same thread that created it. 16732 /// 16733 struct cef_urlrequest_t 16734 { 16735 /// 16736 // Base structure. 16737 /// 16738 cef_base_ref_counted_t base; 16739 16740 /// 16741 // Returns the request object used to create this URL request. The returned 16742 // object is read-only and should not be modified. 16743 /// 16744 extern(System) cef_request_t* function (cef_urlrequest_t* self) nothrow get_request; 16745 16746 /// 16747 // Returns the client. 16748 /// 16749 extern(System) cef_urlrequest_client_t* function (cef_urlrequest_t* self) nothrow get_client; 16750 16751 /// 16752 // Returns the request status. 16753 /// 16754 extern(System) cef_urlrequest_status_t function ( 16755 cef_urlrequest_t* self) nothrow get_request_status; 16756 16757 /// 16758 // Returns the request error if status is UR_CANCELED or UR_FAILED, or 0 16759 // otherwise. 16760 /// 16761 extern(System) cef_errorcode_t function (cef_urlrequest_t* self) nothrow get_request_error; 16762 16763 /// 16764 // Returns the response, or NULL if no response information is available. 16765 // Response information will only be available after the upload has completed. 16766 // The returned object is read-only and should not be modified. 16767 /// 16768 extern(System) cef_response_t* function (cef_urlrequest_t* self) nothrow get_response; 16769 16770 /// 16771 // Returns true (1) if the response body was served from the cache. This 16772 // includes responses for which revalidation was required. 16773 /// 16774 extern(System) int function (cef_urlrequest_t* self) nothrow response_was_cached; 16775 16776 /// 16777 // Cancel the request. 16778 /// 16779 extern(System) void function (cef_urlrequest_t* self) nothrow cancel; 16780 } 16781 16782 16783 16784 /// 16785 // Create a new URL request that is not associated with a specific browser or 16786 // frame. Use cef_frame_t::CreateURLRequest instead if you want the request to 16787 // have this association, in which case it may be handled differently (see 16788 // documentation on that function). A request created with this function may 16789 // only originate from the browser process, and will behave as follows: 16790 // - It may be intercepted by the client via CefResourceRequestHandler or 16791 // CefSchemeHandlerFactory. 16792 // - POST data may only contain only a single element of type PDE_TYPE_FILE 16793 // or PDE_TYPE_BYTES. 16794 // - If |request_context| is empty the global request context will be used. 16795 // 16796 // The |request| object will be marked as read-only after calling this function. 16797 /// 16798 cef_urlrequest_t* cef_urlrequest_create ( 16799 cef_request_t* request, 16800 cef_urlrequest_client_t* client, 16801 cef_request_context_t* request_context); 16802 16803 /// 16804 // Structure that should be implemented by the cef_urlrequest_t client. The 16805 // functions of this structure will be called on the same thread that created 16806 // the request unless otherwise documented. 16807 /// 16808 struct cef_urlrequest_client_t 16809 { 16810 /// 16811 // Base structure. 16812 /// 16813 cef_base_ref_counted_t base; 16814 16815 /// 16816 // Notifies the client that the request has completed. Use the 16817 // cef_urlrequest_t::GetRequestStatus function to determine if the request was 16818 // successful or not. 16819 /// 16820 extern(System) void function ( 16821 cef_urlrequest_client_t* self, 16822 cef_urlrequest_t* request) nothrow on_request_complete; 16823 16824 /// 16825 // Notifies the client of upload progress. |current| denotes the number of 16826 // bytes sent so far and |total| is the total size of uploading data (or -1 if 16827 // chunked upload is enabled). This function will only be called if the 16828 // UR_FLAG_REPORT_UPLOAD_PROGRESS flag is set on the request. 16829 /// 16830 extern(System) void function ( 16831 cef_urlrequest_client_t* self, 16832 cef_urlrequest_t* request, 16833 int64 current, 16834 int64 total) nothrow on_upload_progress; 16835 16836 /// 16837 // Notifies the client of download progress. |current| denotes the number of 16838 // bytes received up to the call and |total| is the expected total size of the 16839 // response (or -1 if not determined). 16840 /// 16841 extern(System) void function ( 16842 cef_urlrequest_client_t* self, 16843 cef_urlrequest_t* request, 16844 int64 current, 16845 int64 total) nothrow on_download_progress; 16846 16847 /// 16848 // Called when some part of the response is read. |data| contains the current 16849 // bytes received since the last call. This function will not be called if the 16850 // UR_FLAG_NO_DOWNLOAD_DATA flag is set on the request. 16851 /// 16852 extern(System) void function ( 16853 cef_urlrequest_client_t* self, 16854 cef_urlrequest_t* request, 16855 const(void)* data, 16856 size_t data_length) nothrow on_download_data; 16857 16858 /// 16859 // Called on the IO thread when the browser needs credentials from the user. 16860 // |isProxy| indicates whether the host is a proxy server. |host| contains the 16861 // hostname and |port| contains the port number. Return true (1) to continue 16862 // the request and call cef_auth_callback_t::cont() when the authentication 16863 // information is available. If the request has an associated browser/frame 16864 // then returning false (0) will result in a call to GetAuthCredentials on the 16865 // cef_request_handler_t associated with that browser, if any. Otherwise, 16866 // returning false (0) will cancel the request immediately. This function will 16867 // only be called for requests initiated from the browser process. 16868 /// 16869 extern(System) int function ( 16870 cef_urlrequest_client_t* self, 16871 int isProxy, 16872 const(cef_string_t)* host, 16873 int port, 16874 const(cef_string_t)* realm, 16875 const(cef_string_t)* scheme, 16876 cef_auth_callback_t* callback) nothrow get_auth_credentials; 16877 } 16878 16879 16880 16881 // CEF_INCLUDE_CAPI_CEF_URLREQUEST_CAPI_H_ 16882 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 16883 // 16884 // Redistribution and use in source and binary forms, with or without 16885 // modification, are permitted provided that the following conditions are 16886 // met: 16887 // 16888 // * Redistributions of source code must retain the above copyright 16889 // notice, this list of conditions and the following disclaimer. 16890 // * Redistributions in binary form must reproduce the above 16891 // copyright notice, this list of conditions and the following disclaimer 16892 // in the documentation and/or other materials provided with the 16893 // distribution. 16894 // * Neither the name of Google Inc. nor the name Chromium Embedded 16895 // Framework nor the names of its contributors may be used to endorse 16896 // or promote products derived from this software without specific prior 16897 // written permission. 16898 // 16899 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 16900 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 16901 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 16902 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 16903 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 16904 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 16905 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 16906 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 16907 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 16908 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 16909 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 16910 // 16911 // --------------------------------------------------------------------------- 16912 // 16913 // This file was generated by the CEF translator tool and should not edited 16914 // by hand. See the translator.README.txt file in the tools directory for 16915 // more information. 16916 // 16917 // $hash=23dc3ab761547687a491e5d7303b73b2d0d54e7a$ 16918 // 16919 16920 extern (C): 16921 16922 /// 16923 // Structure representing a V8 context handle. V8 handles can only be accessed 16924 // from the thread on which they are created. Valid threads for creating a V8 16925 // handle include the render process main thread (TID_RENDERER) and WebWorker 16926 // threads. A task runner for posting tasks on the associated thread can be 16927 // retrieved via the cef_v8context_t::get_task_runner() function. 16928 /// 16929 struct cef_v8context_t 16930 { 16931 /// 16932 // Base structure. 16933 /// 16934 cef_base_ref_counted_t base; 16935 16936 /// 16937 // Returns the task runner associated with this context. V8 handles can only 16938 // be accessed from the thread on which they are created. This function can be 16939 // called on any render process thread. 16940 /// 16941 extern(System) cef_task_runner_t* function (cef_v8context_t* self) nothrow get_task_runner; 16942 16943 /// 16944 // Returns true (1) if the underlying handle is valid and it can be accessed 16945 // on the current thread. Do not call any other functions if this function 16946 // returns false (0). 16947 /// 16948 extern(System) int function (cef_v8context_t* self) nothrow is_valid; 16949 16950 /// 16951 // Returns the browser for this context. This function will return an NULL 16952 // reference for WebWorker contexts. 16953 /// 16954 extern(System) cef_browser_t* function (cef_v8context_t* self) nothrow get_browser; 16955 16956 /// 16957 // Returns the frame for this context. This function will return an NULL 16958 // reference for WebWorker contexts. 16959 /// 16960 extern(System) cef_frame_t* function (cef_v8context_t* self) nothrow get_frame; 16961 16962 /// 16963 // Returns the global object for this context. The context must be entered 16964 // before calling this function. 16965 /// 16966 extern(System) cef_v8value_t* function (cef_v8context_t* self) nothrow get_global; 16967 16968 /// 16969 // Enter this context. A context must be explicitly entered before creating a 16970 // V8 Object, Array, Function or Date asynchronously. exit() must be called 16971 // the same number of times as enter() before releasing this context. V8 16972 // objects belong to the context in which they are created. Returns true (1) 16973 // if the scope was entered successfully. 16974 /// 16975 extern(System) int function (cef_v8context_t* self) nothrow enter; 16976 16977 /// 16978 // Exit this context. Call this function only after calling enter(). Returns 16979 // true (1) if the scope was exited successfully. 16980 /// 16981 extern(System) int function (cef_v8context_t* self) nothrow exit; 16982 16983 /// 16984 // Returns true (1) if this object is pointing to the same handle as |that| 16985 // object. 16986 /// 16987 extern(System) int function (cef_v8context_t* self, cef_v8context_t* that) nothrow is_same; 16988 16989 /// 16990 // Execute a string of JavaScript code in this V8 context. The |script_url| 16991 // parameter is the URL where the script in question can be found, if any. The 16992 // |start_line| parameter is the base line number to use for error reporting. 16993 // On success |retval| will be set to the return value, if any, and the 16994 // function will return true (1). On failure |exception| will be set to the 16995 // exception, if any, and the function will return false (0). 16996 /// 16997 extern(System) int function ( 16998 cef_v8context_t* self, 16999 const(cef_string_t)* code, 17000 const(cef_string_t)* script_url, 17001 int start_line, 17002 cef_v8value_t** retval, 17003 cef_v8exception_t** exception) nothrow eval; 17004 } 17005 17006 17007 17008 /// 17009 // Returns the current (top) context object in the V8 context stack. 17010 /// 17011 cef_v8context_t* cef_v8context_get_current_context (); 17012 17013 /// 17014 // Returns the entered (bottom) context object in the V8 context stack. 17015 /// 17016 cef_v8context_t* cef_v8context_get_entered_context (); 17017 17018 /// 17019 // Returns true (1) if V8 is currently inside a context. 17020 /// 17021 int cef_v8context_in_context (); 17022 17023 /// 17024 // Structure that should be implemented to handle V8 function calls. The 17025 // functions of this structure will be called on the thread associated with the 17026 // V8 function. 17027 /// 17028 struct cef_v8handler_t 17029 { 17030 /// 17031 // Base structure. 17032 /// 17033 cef_base_ref_counted_t base; 17034 17035 /// 17036 // Handle execution of the function identified by |name|. |object| is the 17037 // receiver ('this' object) of the function. |arguments| is the list of 17038 // arguments passed to the function. If execution succeeds set |retval| to the 17039 // function return value. If execution fails set |exception| to the exception 17040 // that will be thrown. Return true (1) if execution was handled. 17041 /// 17042 extern(System) int function ( 17043 cef_v8handler_t* self, 17044 const(cef_string_t)* name, 17045 cef_v8value_t* object, 17046 size_t argumentsCount, 17047 cef_v8value_t** arguments, 17048 cef_v8value_t** retval, 17049 cef_string_t* exception) nothrow execute; 17050 } 17051 17052 17053 17054 /// 17055 // Structure that should be implemented to handle V8 accessor calls. Accessor 17056 // identifiers are registered by calling cef_v8value_t::set_value(). The 17057 // functions of this structure will be called on the thread associated with the 17058 // V8 accessor. 17059 /// 17060 struct cef_v8accessor_t 17061 { 17062 /// 17063 // Base structure. 17064 /// 17065 cef_base_ref_counted_t base; 17066 17067 /// 17068 // Handle retrieval the accessor value identified by |name|. |object| is the 17069 // receiver ('this' object) of the accessor. If retrieval succeeds set 17070 // |retval| to the return value. If retrieval fails set |exception| to the 17071 // exception that will be thrown. Return true (1) if accessor retrieval was 17072 // handled. 17073 /// 17074 extern(System) int function ( 17075 cef_v8accessor_t* self, 17076 const(cef_string_t)* name, 17077 cef_v8value_t* object, 17078 cef_v8value_t** retval, 17079 cef_string_t* exception) nothrow get; 17080 17081 /// 17082 // Handle assignment of the accessor value identified by |name|. |object| is 17083 // the receiver ('this' object) of the accessor. |value| is the new value 17084 // being assigned to the accessor. If assignment fails set |exception| to the 17085 // exception that will be thrown. Return true (1) if accessor assignment was 17086 // handled. 17087 /// 17088 extern(System) int function ( 17089 cef_v8accessor_t* self, 17090 const(cef_string_t)* name, 17091 cef_v8value_t* object, 17092 cef_v8value_t* value, 17093 cef_string_t* exception) nothrow set; 17094 } 17095 17096 17097 17098 /// 17099 // Structure that should be implemented to handle V8 interceptor calls. The 17100 // functions of this structure will be called on the thread associated with the 17101 // V8 interceptor. Interceptor's named property handlers (with first argument of 17102 // type CefString) are called when object is indexed by string. Indexed property 17103 // handlers (with first argument of type int) are called when object is indexed 17104 // by integer. 17105 /// 17106 struct cef_v8interceptor_t 17107 { 17108 /// 17109 // Base structure. 17110 /// 17111 cef_base_ref_counted_t base; 17112 17113 /// 17114 // Handle retrieval of the interceptor value identified by |name|. |object| is 17115 // the receiver ('this' object) of the interceptor. If retrieval succeeds, set 17116 // |retval| to the return value. If the requested value does not exist, don't 17117 // set either |retval| or |exception|. If retrieval fails, set |exception| to 17118 // the exception that will be thrown. If the property has an associated 17119 // accessor, it will be called only if you don't set |retval|. Return true (1) 17120 // if interceptor retrieval was handled, false (0) otherwise. 17121 /// 17122 extern(System) int function ( 17123 cef_v8interceptor_t* self, 17124 const(cef_string_t)* name, 17125 cef_v8value_t* object, 17126 cef_v8value_t** retval, 17127 cef_string_t* exception) nothrow get_byname; 17128 17129 /// 17130 // Handle retrieval of the interceptor value identified by |index|. |object| 17131 // is the receiver ('this' object) of the interceptor. If retrieval succeeds, 17132 // set |retval| to the return value. If the requested value does not exist, 17133 // don't set either |retval| or |exception|. If retrieval fails, set 17134 // |exception| to the exception that will be thrown. Return true (1) if 17135 // interceptor retrieval was handled, false (0) otherwise. 17136 /// 17137 extern(System) int function ( 17138 cef_v8interceptor_t* self, 17139 int index, 17140 cef_v8value_t* object, 17141 cef_v8value_t** retval, 17142 cef_string_t* exception) nothrow get_byindex; 17143 17144 /// 17145 // Handle assignment of the interceptor value identified by |name|. |object| 17146 // is the receiver ('this' object) of the interceptor. |value| is the new 17147 // value being assigned to the interceptor. If assignment fails, set 17148 // |exception| to the exception that will be thrown. This setter will always 17149 // be called, even when the property has an associated accessor. Return true 17150 // (1) if interceptor assignment was handled, false (0) otherwise. 17151 /// 17152 extern(System) int function ( 17153 cef_v8interceptor_t* self, 17154 const(cef_string_t)* name, 17155 cef_v8value_t* object, 17156 cef_v8value_t* value, 17157 cef_string_t* exception) nothrow set_byname; 17158 17159 /// 17160 // Handle assignment of the interceptor value identified by |index|. |object| 17161 // is the receiver ('this' object) of the interceptor. |value| is the new 17162 // value being assigned to the interceptor. If assignment fails, set 17163 // |exception| to the exception that will be thrown. Return true (1) if 17164 // interceptor assignment was handled, false (0) otherwise. 17165 /// 17166 extern(System) int function ( 17167 cef_v8interceptor_t* self, 17168 int index, 17169 cef_v8value_t* object, 17170 cef_v8value_t* value, 17171 cef_string_t* exception) nothrow set_byindex; 17172 } 17173 17174 17175 17176 /// 17177 // Structure representing a V8 exception. The functions of this structure may be 17178 // called on any render process thread. 17179 /// 17180 struct cef_v8exception_t 17181 { 17182 /// 17183 // Base structure. 17184 /// 17185 cef_base_ref_counted_t base; 17186 17187 /// 17188 // Returns the exception message. 17189 /// 17190 // The resulting string must be freed by calling cef_string_userfree_free(). 17191 extern(System) cef_string_userfree_t function (cef_v8exception_t* self) nothrow get_message; 17192 17193 /// 17194 // Returns the line of source code that the exception occurred within. 17195 /// 17196 // The resulting string must be freed by calling cef_string_userfree_free(). 17197 extern(System) cef_string_userfree_t function (cef_v8exception_t* self) nothrow get_source_line; 17198 17199 /// 17200 // Returns the resource name for the script from where the function causing 17201 // the error originates. 17202 /// 17203 // The resulting string must be freed by calling cef_string_userfree_free(). 17204 extern(System) cef_string_userfree_t function ( 17205 cef_v8exception_t* self) nothrow get_script_resource_name; 17206 17207 /// 17208 // Returns the 1-based number of the line where the error occurred or 0 if the 17209 // line number is unknown. 17210 /// 17211 extern(System) int function (cef_v8exception_t* self) nothrow get_line_number; 17212 17213 /// 17214 // Returns the index within the script of the first character where the error 17215 // occurred. 17216 /// 17217 extern(System) int function (cef_v8exception_t* self) nothrow get_start_position; 17218 17219 /// 17220 // Returns the index within the script of the last character where the error 17221 // occurred. 17222 /// 17223 extern(System) int function (cef_v8exception_t* self) nothrow get_end_position; 17224 17225 /// 17226 // Returns the index within the line of the first character where the error 17227 // occurred. 17228 /// 17229 extern(System) int function (cef_v8exception_t* self) nothrow get_start_column; 17230 17231 /// 17232 // Returns the index within the line of the last character where the error 17233 // occurred. 17234 /// 17235 extern(System) int function (cef_v8exception_t* self) nothrow get_end_column; 17236 } 17237 17238 17239 17240 /// 17241 // Callback structure that is passed to cef_v8value_t::CreateArrayBuffer. 17242 /// 17243 struct cef_v8array_buffer_release_callback_t 17244 { 17245 /// 17246 // Base structure. 17247 /// 17248 cef_base_ref_counted_t base; 17249 17250 /// 17251 // Called to release |buffer| when the ArrayBuffer JS object is garbage 17252 // collected. |buffer| is the value that was passed to CreateArrayBuffer along 17253 // with this object. 17254 /// 17255 extern(System) void function ( 17256 cef_v8array_buffer_release_callback_t* self, 17257 void* buffer) nothrow release_buffer; 17258 } 17259 17260 17261 17262 /// 17263 // Structure representing a V8 value handle. V8 handles can only be accessed 17264 // from the thread on which they are created. Valid threads for creating a V8 17265 // handle include the render process main thread (TID_RENDERER) and WebWorker 17266 // threads. A task runner for posting tasks on the associated thread can be 17267 // retrieved via the cef_v8context_t::get_task_runner() function. 17268 /// 17269 struct cef_v8value_t 17270 { 17271 /// 17272 // Base structure. 17273 /// 17274 cef_base_ref_counted_t base; 17275 17276 /// 17277 // Returns true (1) if the underlying handle is valid and it can be accessed 17278 // on the current thread. Do not call any other functions if this function 17279 // returns false (0). 17280 /// 17281 extern(System) int function (cef_v8value_t* self) nothrow is_valid; 17282 17283 /// 17284 // True if the value type is undefined. 17285 /// 17286 extern(System) int function (cef_v8value_t* self) nothrow is_undefined; 17287 17288 /// 17289 // True if the value type is null. 17290 /// 17291 extern(System) int function (cef_v8value_t* self) nothrow is_null; 17292 17293 /// 17294 // True if the value type is bool. 17295 /// 17296 extern(System) int function (cef_v8value_t* self) nothrow is_bool; 17297 17298 /// 17299 // True if the value type is int. 17300 /// 17301 extern(System) int function (cef_v8value_t* self) nothrow is_int; 17302 17303 /// 17304 // True if the value type is unsigned int. 17305 /// 17306 extern(System) int function (cef_v8value_t* self) nothrow is_uint; 17307 17308 /// 17309 // True if the value type is double. 17310 /// 17311 extern(System) int function (cef_v8value_t* self) nothrow is_double; 17312 17313 /// 17314 // True if the value type is Date. 17315 /// 17316 extern(System) int function (cef_v8value_t* self) nothrow is_date; 17317 17318 /// 17319 // True if the value type is string. 17320 /// 17321 extern(System) int function (cef_v8value_t* self) nothrow is_string; 17322 17323 /// 17324 // True if the value type is object. 17325 /// 17326 extern(System) int function (cef_v8value_t* self) nothrow is_object; 17327 17328 /// 17329 // True if the value type is array. 17330 /// 17331 extern(System) int function (cef_v8value_t* self) nothrow is_array; 17332 17333 /// 17334 // True if the value type is an ArrayBuffer. 17335 /// 17336 extern(System) int function (cef_v8value_t* self) nothrow is_array_buffer; 17337 17338 /// 17339 // True if the value type is function. 17340 /// 17341 extern(System) int function (cef_v8value_t* self) nothrow is_function; 17342 17343 /// 17344 // Returns true (1) if this object is pointing to the same handle as |that| 17345 // object. 17346 /// 17347 extern(System) int function (cef_v8value_t* self, cef_v8value_t* that) nothrow is_same; 17348 17349 /// 17350 // Return a bool value. 17351 /// 17352 extern(System) int function (cef_v8value_t* self) nothrow get_bool_value; 17353 17354 /// 17355 // Return an int value. 17356 /// 17357 extern(System) int32 function (cef_v8value_t* self) nothrow get_int_value; 17358 17359 /// 17360 // Return an unsigned int value. 17361 /// 17362 extern(System) uint32 function (cef_v8value_t* self) nothrow get_uint_value; 17363 17364 /// 17365 // Return a double value. 17366 /// 17367 extern(System) double function (cef_v8value_t* self) nothrow get_double_value; 17368 17369 /// 17370 // Return a Date value. 17371 /// 17372 extern(System) cef_time_t function (cef_v8value_t* self) nothrow get_date_value; 17373 17374 /// 17375 // Return a string value. 17376 /// 17377 // The resulting string must be freed by calling cef_string_userfree_free(). 17378 extern(System) cef_string_userfree_t function (cef_v8value_t* self) nothrow get_string_value; 17379 17380 // OBJECT METHODS - These functions are only available on objects. Arrays and 17381 // functions are also objects. String- and integer-based keys can be used 17382 // interchangably with the framework converting between them as necessary. 17383 17384 /// 17385 // Returns true (1) if this is a user created object. 17386 /// 17387 extern(System) int function (cef_v8value_t* self) nothrow is_user_created; 17388 17389 /// 17390 // Returns true (1) if the last function call resulted in an exception. This 17391 // attribute exists only in the scope of the current CEF value object. 17392 /// 17393 extern(System) int function (cef_v8value_t* self) nothrow has_exception; 17394 17395 /// 17396 // Returns the exception resulting from the last function call. This attribute 17397 // exists only in the scope of the current CEF value object. 17398 /// 17399 extern(System) cef_v8exception_t* function (cef_v8value_t* self) nothrow get_exception; 17400 17401 /// 17402 // Clears the last exception and returns true (1) on success. 17403 /// 17404 extern(System) int function (cef_v8value_t* self) nothrow clear_exception; 17405 17406 /// 17407 // Returns true (1) if this object will re-throw future exceptions. This 17408 // attribute exists only in the scope of the current CEF value object. 17409 /// 17410 extern(System) int function (cef_v8value_t* self) nothrow will_rethrow_exceptions; 17411 17412 /// 17413 // Set whether this object will re-throw future exceptions. By default 17414 // exceptions are not re-thrown. If a exception is re-thrown the current 17415 // context should not be accessed again until after the exception has been 17416 // caught and not re-thrown. Returns true (1) on success. This attribute 17417 // exists only in the scope of the current CEF value object. 17418 /// 17419 extern(System) int function (cef_v8value_t* self, int rethrow) nothrow set_rethrow_exceptions; 17420 17421 /// 17422 // Returns true (1) if the object has a value with the specified identifier. 17423 /// 17424 extern(System) int function ( 17425 cef_v8value_t* self, 17426 const(cef_string_t)* key) nothrow has_value_bykey; 17427 17428 /// 17429 // Returns true (1) if the object has a value with the specified identifier. 17430 /// 17431 extern(System) int function (cef_v8value_t* self, int index) nothrow has_value_byindex; 17432 17433 /// 17434 // Deletes the value with the specified identifier and returns true (1) on 17435 // success. Returns false (0) if this function is called incorrectly or an 17436 // exception is thrown. For read-only and don't-delete values this function 17437 // will return true (1) even though deletion failed. 17438 /// 17439 extern(System) int function ( 17440 cef_v8value_t* self, 17441 const(cef_string_t)* key) nothrow delete_value_bykey; 17442 17443 /// 17444 // Deletes the value with the specified identifier and returns true (1) on 17445 // success. Returns false (0) if this function is called incorrectly, deletion 17446 // fails or an exception is thrown. For read-only and don't-delete values this 17447 // function will return true (1) even though deletion failed. 17448 /// 17449 extern(System) int function (cef_v8value_t* self, int index) nothrow delete_value_byindex; 17450 17451 /// 17452 // Returns the value with the specified identifier on success. Returns NULL if 17453 // this function is called incorrectly or an exception is thrown. 17454 /// 17455 extern(System) cef_v8value_t* function ( 17456 cef_v8value_t* self, 17457 const(cef_string_t)* key) nothrow get_value_bykey; 17458 17459 /// 17460 // Returns the value with the specified identifier on success. Returns NULL if 17461 // this function is called incorrectly or an exception is thrown. 17462 /// 17463 extern(System) cef_v8value_t* function ( 17464 cef_v8value_t* self, 17465 int index) nothrow get_value_byindex; 17466 17467 /// 17468 // Associates a value with the specified identifier and returns true (1) on 17469 // success. Returns false (0) if this function is called incorrectly or an 17470 // exception is thrown. For read-only values this function will return true 17471 // (1) even though assignment failed. 17472 /// 17473 extern(System) int function ( 17474 cef_v8value_t* self, 17475 const(cef_string_t)* key, 17476 cef_v8value_t* value, 17477 cef_v8_propertyattribute_t attribute) nothrow set_value_bykey; 17478 17479 /// 17480 // Associates a value with the specified identifier and returns true (1) on 17481 // success. Returns false (0) if this function is called incorrectly or an 17482 // exception is thrown. For read-only values this function will return true 17483 // (1) even though assignment failed. 17484 /// 17485 extern(System) int function ( 17486 cef_v8value_t* self, 17487 int index, 17488 cef_v8value_t* value) nothrow set_value_byindex; 17489 17490 /// 17491 // Registers an identifier and returns true (1) on success. Access to the 17492 // identifier will be forwarded to the cef_v8accessor_t instance passed to 17493 // cef_v8value_t::cef_v8value_create_object(). Returns false (0) if this 17494 // function is called incorrectly or an exception is thrown. For read-only 17495 // values this function will return true (1) even though assignment failed. 17496 /// 17497 extern(System) int function ( 17498 cef_v8value_t* self, 17499 const(cef_string_t)* key, 17500 cef_v8_accesscontrol_t settings, 17501 cef_v8_propertyattribute_t attribute) nothrow set_value_byaccessor; 17502 17503 /// 17504 // Read the keys for the object's values into the specified vector. Integer- 17505 // based keys will also be returned as strings. 17506 /// 17507 extern(System) int function (cef_v8value_t* self, cef_string_list_t keys) nothrow get_keys; 17508 17509 /// 17510 // Sets the user data for this object and returns true (1) on success. Returns 17511 // false (0) if this function is called incorrectly. This function can only be 17512 // called on user created objects. 17513 /// 17514 extern(System) int function ( 17515 cef_v8value_t* self, 17516 cef_base_ref_counted_t* user_data) nothrow set_user_data; 17517 17518 /// 17519 // Returns the user data, if any, assigned to this object. 17520 /// 17521 extern(System) cef_base_ref_counted_t* function (cef_v8value_t* self) nothrow get_user_data; 17522 17523 /// 17524 // Returns the amount of externally allocated memory registered for the 17525 // object. 17526 /// 17527 extern(System) int function (cef_v8value_t* self) nothrow get_externally_allocated_memory; 17528 17529 /// 17530 // Adjusts the amount of registered external memory for the object. Used to 17531 // give V8 an indication of the amount of externally allocated memory that is 17532 // kept alive by JavaScript objects. V8 uses this information to decide when 17533 // to perform global garbage collection. Each cef_v8value_t tracks the amount 17534 // of external memory associated with it and automatically decreases the 17535 // global total by the appropriate amount on its destruction. 17536 // |change_in_bytes| specifies the number of bytes to adjust by. This function 17537 // returns the number of bytes associated with the object after the 17538 // adjustment. This function can only be called on user created objects. 17539 /// 17540 extern(System) int function ( 17541 cef_v8value_t* self, 17542 int change_in_bytes) nothrow adjust_externally_allocated_memory; 17543 17544 // ARRAY METHODS - These functions are only available on arrays. 17545 17546 /// 17547 // Returns the number of elements in the array. 17548 /// 17549 extern(System) int function (cef_v8value_t* self) nothrow get_array_length; 17550 17551 // ARRAY BUFFER METHODS - These functions are only available on ArrayBuffers. 17552 17553 /// 17554 // Returns the ReleaseCallback object associated with the ArrayBuffer or NULL 17555 // if the ArrayBuffer was not created with CreateArrayBuffer. 17556 /// 17557 extern(System) cef_v8array_buffer_release_callback_t* function ( 17558 cef_v8value_t* self) nothrow get_array_buffer_release_callback; 17559 17560 /// 17561 // Prevent the ArrayBuffer from using it's memory block by setting the length 17562 // to zero. This operation cannot be undone. If the ArrayBuffer was created 17563 // with CreateArrayBuffer then 17564 // cef_v8array_buffer_release_callback_t::ReleaseBuffer will be called to 17565 // release the underlying buffer. 17566 /// 17567 extern(System) int function (cef_v8value_t* self) nothrow neuter_array_buffer; 17568 17569 // FUNCTION METHODS - These functions are only available on functions. 17570 17571 /// 17572 // Returns the function name. 17573 /// 17574 // The resulting string must be freed by calling cef_string_userfree_free(). 17575 extern(System) cef_string_userfree_t function (cef_v8value_t* self) nothrow get_function_name; 17576 17577 /// 17578 // Returns the function handler or NULL if not a CEF-created function. 17579 /// 17580 extern(System) cef_v8handler_t* function (cef_v8value_t* self) nothrow get_function_handler; 17581 17582 /// 17583 // Execute the function using the current V8 context. This function should 17584 // only be called from within the scope of a cef_v8handler_t or 17585 // cef_v8accessor_t callback, or in combination with calling enter() and 17586 // exit() on a stored cef_v8context_t reference. |object| is the receiver 17587 // ('this' object) of the function. If |object| is NULL the current context's 17588 // global object will be used. |arguments| is the list of arguments that will 17589 // be passed to the function. Returns the function return value on success. 17590 // Returns NULL if this function is called incorrectly or an exception is 17591 // thrown. 17592 /// 17593 extern(System) cef_v8value_t* function ( 17594 cef_v8value_t* self, 17595 cef_v8value_t* object, 17596 size_t argumentsCount, 17597 cef_v8value_t** arguments) nothrow execute_function; 17598 17599 /// 17600 // Execute the function using the specified V8 context. |object| is the 17601 // receiver ('this' object) of the function. If |object| is NULL the specified 17602 // context's global object will be used. |arguments| is the list of arguments 17603 // that will be passed to the function. Returns the function return value on 17604 // success. Returns NULL if this function is called incorrectly or an 17605 // exception is thrown. 17606 /// 17607 extern(System) cef_v8value_t* function ( 17608 cef_v8value_t* self, 17609 cef_v8context_t* context, 17610 cef_v8value_t* object, 17611 size_t argumentsCount, 17612 cef_v8value_t** arguments) nothrow execute_function_with_context; 17613 } 17614 17615 17616 17617 /// 17618 // Create a new cef_v8value_t object of type undefined. 17619 /// 17620 cef_v8value_t* cef_v8value_create_undefined (); 17621 17622 /// 17623 // Create a new cef_v8value_t object of type null. 17624 /// 17625 cef_v8value_t* cef_v8value_create_null (); 17626 17627 /// 17628 // Create a new cef_v8value_t object of type bool. 17629 /// 17630 cef_v8value_t* cef_v8value_create_bool (int value); 17631 17632 /// 17633 // Create a new cef_v8value_t object of type int. 17634 /// 17635 cef_v8value_t* cef_v8value_create_int (int32 value); 17636 17637 /// 17638 // Create a new cef_v8value_t object of type unsigned int. 17639 /// 17640 cef_v8value_t* cef_v8value_create_uint (uint32 value); 17641 17642 /// 17643 // Create a new cef_v8value_t object of type double. 17644 /// 17645 cef_v8value_t* cef_v8value_create_double (double value); 17646 17647 /// 17648 // Create a new cef_v8value_t object of type Date. This function should only be 17649 // called from within the scope of a cef_render_process_handler_t, 17650 // cef_v8handler_t or cef_v8accessor_t callback, or in combination with calling 17651 // enter() and exit() on a stored cef_v8context_t reference. 17652 /// 17653 cef_v8value_t* cef_v8value_create_date (const(cef_time_t)* date); 17654 17655 /// 17656 // Create a new cef_v8value_t object of type string. 17657 /// 17658 cef_v8value_t* cef_v8value_create_string (const(cef_string_t)* value); 17659 17660 /// 17661 // Create a new cef_v8value_t object of type object with optional accessor 17662 // and/or interceptor. This function should only be called from within the scope 17663 // of a cef_render_process_handler_t, cef_v8handler_t or cef_v8accessor_t 17664 // callback, or in combination with calling enter() and exit() on a stored 17665 // cef_v8context_t reference. 17666 /// 17667 cef_v8value_t* cef_v8value_create_object ( 17668 cef_v8accessor_t* accessor, 17669 cef_v8interceptor_t* interceptor); 17670 17671 /// 17672 // Create a new cef_v8value_t object of type array with the specified |length|. 17673 // If |length| is negative the returned array will have length 0. This function 17674 // should only be called from within the scope of a 17675 // cef_render_process_handler_t, cef_v8handler_t or cef_v8accessor_t callback, 17676 // or in combination with calling enter() and exit() on a stored cef_v8context_t 17677 // reference. 17678 /// 17679 cef_v8value_t* cef_v8value_create_array (int length); 17680 17681 /// 17682 // Create a new cef_v8value_t object of type ArrayBuffer which wraps the 17683 // provided |buffer| of size |length| bytes. The ArrayBuffer is externalized, 17684 // meaning that it does not own |buffer|. The caller is responsible for freeing 17685 // |buffer| when requested via a call to cef_v8array_buffer_release_callback_t:: 17686 // ReleaseBuffer. This function should only be called from within the scope of a 17687 // cef_render_process_handler_t, cef_v8handler_t or cef_v8accessor_t callback, 17688 // or in combination with calling enter() and exit() on a stored cef_v8context_t 17689 // reference. 17690 /// 17691 cef_v8value_t* cef_v8value_create_array_buffer ( 17692 void* buffer, 17693 size_t length, 17694 cef_v8array_buffer_release_callback_t* release_callback); 17695 17696 /// 17697 // Create a new cef_v8value_t object of type function. This function should only 17698 // be called from within the scope of a cef_render_process_handler_t, 17699 // cef_v8handler_t or cef_v8accessor_t callback, or in combination with calling 17700 // enter() and exit() on a stored cef_v8context_t reference. 17701 /// 17702 extern(System) cef_v8value_t* cef_v8value_create_function ( 17703 const(cef_string_t)* name, 17704 cef_v8handler_t* handler) nothrow; 17705 17706 /// 17707 // Structure representing a V8 stack trace handle. V8 handles can only be 17708 // accessed from the thread on which they are created. Valid threads for 17709 // creating a V8 handle include the render process main thread (TID_RENDERER) 17710 // and WebWorker threads. A task runner for posting tasks on the associated 17711 // thread can be retrieved via the cef_v8context_t::get_task_runner() function. 17712 /// 17713 struct cef_v8stack_trace_t 17714 { 17715 /// 17716 // Base structure. 17717 /// 17718 cef_base_ref_counted_t base; 17719 17720 /// 17721 // Returns true (1) if the underlying handle is valid and it can be accessed 17722 // on the current thread. Do not call any other functions if this function 17723 // returns false (0). 17724 /// 17725 extern(System) int function (cef_v8stack_trace_t* self) nothrow is_valid; 17726 17727 /// 17728 // Returns the number of stack frames. 17729 /// 17730 extern(System) int function (cef_v8stack_trace_t* self) nothrow get_frame_count; 17731 17732 /// 17733 // Returns the stack frame at the specified 0-based index. 17734 /// 17735 extern(System) cef_v8stack_frame_t* function ( 17736 cef_v8stack_trace_t* self, 17737 int index) nothrow get_frame; 17738 } 17739 17740 17741 17742 /// 17743 // Returns the stack trace for the currently active context. |frame_limit| is 17744 // the maximum number of frames that will be captured. 17745 /// 17746 cef_v8stack_trace_t* cef_v8stack_trace_get_current (int frame_limit); 17747 17748 /// 17749 // Structure representing a V8 stack frame handle. V8 handles can only be 17750 // accessed from the thread on which they are created. Valid threads for 17751 // creating a V8 handle include the render process main thread (TID_RENDERER) 17752 // and WebWorker threads. A task runner for posting tasks on the associated 17753 // thread can be retrieved via the cef_v8context_t::get_task_runner() function. 17754 /// 17755 struct cef_v8stack_frame_t 17756 { 17757 /// 17758 // Base structure. 17759 /// 17760 cef_base_ref_counted_t base; 17761 17762 /// 17763 // Returns true (1) if the underlying handle is valid and it can be accessed 17764 // on the current thread. Do not call any other functions if this function 17765 // returns false (0). 17766 /// 17767 extern(System) int function (cef_v8stack_frame_t* self) nothrow is_valid; 17768 17769 /// 17770 // Returns the name of the resource script that contains the function. 17771 /// 17772 // The resulting string must be freed by calling cef_string_userfree_free(). 17773 extern(System) cef_string_userfree_t function ( 17774 cef_v8stack_frame_t* self) nothrow get_script_name; 17775 17776 /// 17777 // Returns the name of the resource script that contains the function or the 17778 // sourceURL value if the script name is undefined and its source ends with a 17779 // "//@ sourceURL=..." string. 17780 /// 17781 // The resulting string must be freed by calling cef_string_userfree_free(). 17782 extern(System) cef_string_userfree_t function ( 17783 cef_v8stack_frame_t* self) nothrow get_script_name_or_source_url; 17784 17785 /// 17786 // Returns the name of the function. 17787 /// 17788 // The resulting string must be freed by calling cef_string_userfree_free(). 17789 extern(System) cef_string_userfree_t function ( 17790 cef_v8stack_frame_t* self) nothrow get_function_name; 17791 17792 /// 17793 // Returns the 1-based line number for the function call or 0 if unknown. 17794 /// 17795 extern(System) int function (cef_v8stack_frame_t* self) nothrow get_line_number; 17796 17797 /// 17798 // Returns the 1-based column offset on the line for the function call or 0 if 17799 // unknown. 17800 /// 17801 extern(System) int function (cef_v8stack_frame_t* self) nothrow get_column; 17802 17803 /// 17804 // Returns true (1) if the function was compiled using eval(). 17805 /// 17806 extern(System) int function (cef_v8stack_frame_t* self) nothrow is_eval; 17807 17808 /// 17809 // Returns true (1) if the function was called as a constructor via "new". 17810 /// 17811 extern(System) int function (cef_v8stack_frame_t* self) nothrow is_constructor; 17812 } 17813 17814 17815 17816 /// 17817 // Register a new V8 extension with the specified JavaScript extension code and 17818 // handler. Functions implemented by the handler are prototyped using the 17819 // keyword 'native'. The calling of a native function is restricted to the scope 17820 // in which the prototype of the native function is defined. This function may 17821 // only be called on the render process main thread. 17822 // 17823 // Example JavaScript extension code: <pre> 17824 // // create the 'example' global object if it doesn't already exist. 17825 // if (!example) 17826 // example = {}; 17827 // // create the 'example.test' global object if it doesn't already exist. 17828 // if (!example.test) 17829 // example.test = {}; 17830 // (function() { 17831 // // Define the function 'example.test.myfunction'. 17832 // example.test.myfunction = function() { 17833 // // Call CefV8Handler::Execute() with the function name 'MyFunction' 17834 // // and no arguments. 17835 // native function MyFunction(); 17836 // return MyFunction(); 17837 // }; 17838 // // Define the getter function for parameter 'example.test.myparam'. 17839 // example.test.__defineGetter__('myparam', function() { 17840 // // Call CefV8Handler::Execute() with the function name 'GetMyParam' 17841 // // and no arguments. 17842 // native function GetMyParam(); 17843 // return GetMyParam(); 17844 // }); 17845 // // Define the setter function for parameter 'example.test.myparam'. 17846 // example.test.__defineSetter__('myparam', function(b) { 17847 // // Call CefV8Handler::Execute() with the function name 'SetMyParam' 17848 // // and a single argument. 17849 // native function SetMyParam(); 17850 // if(b) SetMyParam(b); 17851 // }); 17852 // 17853 // // Extension definitions can also contain normal JavaScript variables 17854 // // and functions. 17855 // var myint = 0; 17856 // example.test.increment = function() { 17857 // myint += 1; 17858 // return myint; 17859 // }; 17860 // })(); 17861 // </pre> Example usage in the page: <pre> 17862 // // Call the function. 17863 // example.test.myfunction(); 17864 // // Set the parameter. 17865 // example.test.myparam = value; 17866 // // Get the parameter. 17867 // value = example.test.myparam; 17868 // // Call another function. 17869 // example.test.increment(); 17870 // </pre> 17871 /// 17872 int cef_register_extension ( 17873 const(cef_string_t)* extension_name, 17874 const(cef_string_t)* javascript_code, 17875 cef_v8handler_t* handler); 17876 17877 // CEF_INCLUDE_CAPI_CEF_V8_CAPI_H_ 17878 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 17879 // 17880 // Redistribution and use in source and binary forms, with or without 17881 // modification, are permitted provided that the following conditions are 17882 // met: 17883 // 17884 // * Redistributions of source code must retain the above copyright 17885 // notice, this list of conditions and the following disclaimer. 17886 // * Redistributions in binary form must reproduce the above 17887 // copyright notice, this list of conditions and the following disclaimer 17888 // in the documentation and/or other materials provided with the 17889 // distribution. 17890 // * Neither the name of Google Inc. nor the name Chromium Embedded 17891 // Framework nor the names of its contributors may be used to endorse 17892 // or promote products derived from this software without specific prior 17893 // written permission. 17894 // 17895 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17896 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 17897 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 17898 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 17899 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 17900 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 17901 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 17902 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 17903 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 17904 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 17905 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 17906 // 17907 // --------------------------------------------------------------------------- 17908 // 17909 // This file was generated by the CEF translator tool and should not edited 17910 // by hand. See the translator.README.txt file in the tools directory for 17911 // more information. 17912 // 17913 // $hash=d9074be0e6960c69cfe2c39b92b4dd6f529210d1$ 17914 // 17915 17916 extern (C): 17917 17918 /// 17919 // Structure that wraps other data value types. Complex types (binary, 17920 // dictionary and list) will be referenced but not owned by this object. Can be 17921 // used on any process and thread. 17922 /// 17923 struct cef_value_t 17924 { 17925 /// 17926 // Base structure. 17927 /// 17928 cef_base_ref_counted_t base; 17929 17930 /// 17931 // Returns true (1) if the underlying data is valid. This will always be true 17932 // (1) for simple types. For complex types (binary, dictionary and list) the 17933 // underlying data may become invalid if owned by another object (e.g. list or 17934 // dictionary) and that other object is then modified or destroyed. This value 17935 // object can be re-used by calling Set*() even if the underlying data is 17936 // invalid. 17937 /// 17938 extern(System) int function (cef_value_t* self) nothrow is_valid; 17939 17940 /// 17941 // Returns true (1) if the underlying data is owned by another object. 17942 /// 17943 extern(System) int function (cef_value_t* self) nothrow is_owned; 17944 17945 /// 17946 // Returns true (1) if the underlying data is read-only. Some APIs may expose 17947 // read-only objects. 17948 /// 17949 extern(System) int function (cef_value_t* self) nothrow is_read_only; 17950 17951 /// 17952 // Returns true (1) if this object and |that| object have the same underlying 17953 // data. If true (1) modifications to this object will also affect |that| 17954 // object and vice-versa. 17955 /// 17956 extern(System) int function (cef_value_t* self, cef_value_t* that) nothrow is_same; 17957 17958 /// 17959 // Returns true (1) if this object and |that| object have an equivalent 17960 // underlying value but are not necessarily the same object. 17961 /// 17962 extern(System) int function (cef_value_t* self, cef_value_t* that) nothrow is_equal; 17963 17964 /// 17965 // Returns a copy of this object. The underlying data will also be copied. 17966 /// 17967 extern(System) cef_value_t* function (cef_value_t* self) nothrow copy; 17968 17969 /// 17970 // Returns the underlying value type. 17971 /// 17972 extern(System) cef_value_type_t function (cef_value_t* self) nothrow get_type; 17973 17974 /// 17975 // Returns the underlying value as type bool. 17976 /// 17977 extern(System) int function (cef_value_t* self) nothrow get_bool; 17978 17979 /// 17980 // Returns the underlying value as type int. 17981 /// 17982 extern(System) int function (cef_value_t* self) nothrow get_int; 17983 17984 /// 17985 // Returns the underlying value as type double. 17986 /// 17987 extern(System) double function (cef_value_t* self) nothrow get_double; 17988 17989 /// 17990 // Returns the underlying value as type string. 17991 /// 17992 // The resulting string must be freed by calling cef_string_userfree_free(). 17993 extern(System) cef_string_userfree_t function (cef_value_t* self) nothrow get_string; 17994 17995 /// 17996 // Returns the underlying value as type binary. The returned reference may 17997 // become invalid if the value is owned by another object or if ownership is 17998 // transferred to another object in the future. To maintain a reference to the 17999 // value after assigning ownership to a dictionary or list pass this object to 18000 // the set_value() function instead of passing the returned reference to 18001 // set_binary(). 18002 /// 18003 extern(System) cef_binary_value_t* function (cef_value_t* self) nothrow get_binary; 18004 18005 /// 18006 // Returns the underlying value as type dictionary. The returned reference may 18007 // become invalid if the value is owned by another object or if ownership is 18008 // transferred to another object in the future. To maintain a reference to the 18009 // value after assigning ownership to a dictionary or list pass this object to 18010 // the set_value() function instead of passing the returned reference to 18011 // set_dictionary(). 18012 /// 18013 extern(System) cef_dictionary_value_t* function (cef_value_t* self) nothrow get_dictionary; 18014 18015 /// 18016 // Returns the underlying value as type list. The returned reference may 18017 // become invalid if the value is owned by another object or if ownership is 18018 // transferred to another object in the future. To maintain a reference to the 18019 // value after assigning ownership to a dictionary or list pass this object to 18020 // the set_value() function instead of passing the returned reference to 18021 // set_list(). 18022 /// 18023 extern(System) cef_list_value_t* function (cef_value_t* self) nothrow get_list; 18024 18025 /// 18026 // Sets the underlying value as type null. Returns true (1) if the value was 18027 // set successfully. 18028 /// 18029 extern(System) int function (cef_value_t* self) nothrow set_null; 18030 18031 /// 18032 // Sets the underlying value as type bool. Returns true (1) if the value was 18033 // set successfully. 18034 /// 18035 extern(System) int function (cef_value_t* self, int value) nothrow set_bool; 18036 18037 /// 18038 // Sets the underlying value as type int. Returns true (1) if the value was 18039 // set successfully. 18040 /// 18041 extern(System) int function (cef_value_t* self, int value) nothrow set_int; 18042 18043 /// 18044 // Sets the underlying value as type double. Returns true (1) if the value was 18045 // set successfully. 18046 /// 18047 extern(System) int function (cef_value_t* self, double value) nothrow set_double; 18048 18049 /// 18050 // Sets the underlying value as type string. Returns true (1) if the value was 18051 // set successfully. 18052 /// 18053 extern(System) int function (cef_value_t* self, const(cef_string_t)* value) nothrow set_string; 18054 18055 /// 18056 // Sets the underlying value as type binary. Returns true (1) if the value was 18057 // set successfully. This object keeps a reference to |value| and ownership of 18058 // the underlying data remains unchanged. 18059 /// 18060 extern(System) int function (cef_value_t* self, cef_binary_value_t* value) nothrow set_binary; 18061 18062 /// 18063 // Sets the underlying value as type dict. Returns true (1) if the value was 18064 // set successfully. This object keeps a reference to |value| and ownership of 18065 // the underlying data remains unchanged. 18066 /// 18067 extern(System) int function ( 18068 cef_value_t* self, 18069 cef_dictionary_value_t* value) nothrow set_dictionary; 18070 18071 /// 18072 // Sets the underlying value as type list. Returns true (1) if the value was 18073 // set successfully. This object keeps a reference to |value| and ownership of 18074 // the underlying data remains unchanged. 18075 /// 18076 extern(System) int function (cef_value_t* self, cef_list_value_t* value) nothrow set_list; 18077 } 18078 18079 18080 18081 /// 18082 // Creates a new object. 18083 /// 18084 cef_value_t* cef_value_create (); 18085 18086 /// 18087 // Structure representing a binary value. Can be used on any process and thread. 18088 /// 18089 struct cef_binary_value_t 18090 { 18091 /// 18092 // Base structure. 18093 /// 18094 cef_base_ref_counted_t base; 18095 18096 /// 18097 // Returns true (1) if this object is valid. This object may become invalid if 18098 // the underlying data is owned by another object (e.g. list or dictionary) 18099 // and that other object is then modified or destroyed. Do not call any other 18100 // functions if this function returns false (0). 18101 /// 18102 extern(System) int function (cef_binary_value_t* self) nothrow is_valid; 18103 18104 /// 18105 // Returns true (1) if this object is currently owned by another object. 18106 /// 18107 extern(System) int function (cef_binary_value_t* self) nothrow is_owned; 18108 18109 /// 18110 // Returns true (1) if this object and |that| object have the same underlying 18111 // data. 18112 /// 18113 extern(System) int function ( 18114 cef_binary_value_t* self, 18115 cef_binary_value_t* that) nothrow is_same; 18116 18117 /// 18118 // Returns true (1) if this object and |that| object have an equivalent 18119 // underlying value but are not necessarily the same object. 18120 /// 18121 extern(System) int function ( 18122 cef_binary_value_t* self, 18123 cef_binary_value_t* that) nothrow is_equal; 18124 18125 /// 18126 // Returns a copy of this object. The data in this object will also be copied. 18127 /// 18128 extern(System) cef_binary_value_t* function (cef_binary_value_t* self) nothrow copy; 18129 18130 /// 18131 // Returns the data size. 18132 /// 18133 extern(System) size_t function (cef_binary_value_t* self) nothrow get_size; 18134 18135 /// 18136 // Read up to |buffer_size| number of bytes into |buffer|. Reading begins at 18137 // the specified byte |data_offset|. Returns the number of bytes read. 18138 /// 18139 extern(System) size_t function ( 18140 cef_binary_value_t* self, 18141 void* buffer, 18142 size_t buffer_size, 18143 size_t data_offset) nothrow get_data; 18144 } 18145 18146 18147 18148 /// 18149 // Creates a new object that is not owned by any other object. The specified 18150 // |data| will be copied. 18151 /// 18152 cef_binary_value_t* cef_binary_value_create ( 18153 const(void)* data, 18154 size_t data_size); 18155 18156 /// 18157 // Structure representing a dictionary value. Can be used on any process and 18158 // thread. 18159 /// 18160 struct cef_dictionary_value_t 18161 { 18162 /// 18163 // Base structure. 18164 /// 18165 cef_base_ref_counted_t base; 18166 18167 /// 18168 // Returns true (1) if this object is valid. This object may become invalid if 18169 // the underlying data is owned by another object (e.g. list or dictionary) 18170 // and that other object is then modified or destroyed. Do not call any other 18171 // functions if this function returns false (0). 18172 /// 18173 extern(System) int function (cef_dictionary_value_t* self) nothrow is_valid; 18174 18175 /// 18176 // Returns true (1) if this object is currently owned by another object. 18177 /// 18178 extern(System) int function (cef_dictionary_value_t* self) nothrow is_owned; 18179 18180 /// 18181 // Returns true (1) if the values of this object are read-only. Some APIs may 18182 // expose read-only objects. 18183 /// 18184 extern(System) int function (cef_dictionary_value_t* self) nothrow is_read_only; 18185 18186 /// 18187 // Returns true (1) if this object and |that| object have the same underlying 18188 // data. If true (1) modifications to this object will also affect |that| 18189 // object and vice-versa. 18190 /// 18191 extern(System) int function ( 18192 cef_dictionary_value_t* self, 18193 cef_dictionary_value_t* that) nothrow is_same; 18194 18195 /// 18196 // Returns true (1) if this object and |that| object have an equivalent 18197 // underlying value but are not necessarily the same object. 18198 /// 18199 extern(System) int function ( 18200 cef_dictionary_value_t* self, 18201 cef_dictionary_value_t* that) nothrow is_equal; 18202 18203 /// 18204 // Returns a writable copy of this object. If |exclude_NULL_children| is true 18205 // (1) any NULL dictionaries or lists will be excluded from the copy. 18206 /// 18207 extern(System) cef_dictionary_value_t* function ( 18208 cef_dictionary_value_t* self, 18209 int exclude_empty_children) nothrow copy; 18210 18211 /// 18212 // Returns the number of values. 18213 /// 18214 extern(System) size_t function (cef_dictionary_value_t* self) nothrow get_size; 18215 18216 /// 18217 // Removes all values. Returns true (1) on success. 18218 /// 18219 extern(System) int function (cef_dictionary_value_t* self) nothrow clear; 18220 18221 /// 18222 // Returns true (1) if the current dictionary has a value for the given key. 18223 /// 18224 extern(System) int function ( 18225 cef_dictionary_value_t* self, 18226 const(cef_string_t)* key) nothrow has_key; 18227 18228 /// 18229 // Reads all keys for this dictionary into the specified vector. 18230 /// 18231 extern(System) int function ( 18232 cef_dictionary_value_t* self, 18233 cef_string_list_t keys) nothrow get_keys; 18234 18235 /// 18236 // Removes the value at the specified key. Returns true (1) is the value was 18237 // removed successfully. 18238 /// 18239 extern(System) int function ( 18240 cef_dictionary_value_t* self, 18241 const(cef_string_t)* key) nothrow remove; 18242 18243 /// 18244 // Returns the value type for the specified key. 18245 /// 18246 extern(System) cef_value_type_t function ( 18247 cef_dictionary_value_t* self, 18248 const(cef_string_t)* key) nothrow get_type; 18249 18250 /// 18251 // Returns the value at the specified key. For simple types the returned value 18252 // will copy existing data and modifications to the value will not modify this 18253 // object. For complex types (binary, dictionary and list) the returned value 18254 // will reference existing data and modifications to the value will modify 18255 // this object. 18256 /// 18257 extern(System) cef_value_t* function ( 18258 cef_dictionary_value_t* self, 18259 const(cef_string_t)* key) nothrow get_value; 18260 18261 /// 18262 // Returns the value at the specified key as type bool. 18263 /// 18264 extern(System) int function ( 18265 cef_dictionary_value_t* self, 18266 const(cef_string_t)* key) nothrow get_bool; 18267 18268 /// 18269 // Returns the value at the specified key as type int. 18270 /// 18271 extern(System) int function ( 18272 cef_dictionary_value_t* self, 18273 const(cef_string_t)* key) nothrow get_int; 18274 18275 /// 18276 // Returns the value at the specified key as type double. 18277 /// 18278 extern(System) double function ( 18279 cef_dictionary_value_t* self, 18280 const(cef_string_t)* key) nothrow get_double; 18281 18282 /// 18283 // Returns the value at the specified key as type string. 18284 /// 18285 // The resulting string must be freed by calling cef_string_userfree_free(). 18286 extern(System) cef_string_userfree_t function ( 18287 cef_dictionary_value_t* self, 18288 const(cef_string_t)* key) nothrow get_string; 18289 18290 /// 18291 // Returns the value at the specified key as type binary. The returned value 18292 // will reference existing data. 18293 /// 18294 extern(System) cef_binary_value_t* function ( 18295 cef_dictionary_value_t* self, 18296 const(cef_string_t)* key) nothrow get_binary; 18297 18298 /// 18299 // Returns the value at the specified key as type dictionary. The returned 18300 // value will reference existing data and modifications to the value will 18301 // modify this object. 18302 /// 18303 extern(System) cef_dictionary_value_t* function ( 18304 cef_dictionary_value_t* self, 18305 const(cef_string_t)* key) nothrow get_dictionary; 18306 18307 /// 18308 // Returns the value at the specified key as type list. The returned value 18309 // will reference existing data and modifications to the value will modify 18310 // this object. 18311 /// 18312 extern(System) cef_list_value_t* function ( 18313 cef_dictionary_value_t* self, 18314 const(cef_string_t)* key) nothrow get_list; 18315 18316 /// 18317 // Sets the value at the specified key. Returns true (1) if the value was set 18318 // successfully. If |value| represents simple data then the underlying data 18319 // will be copied and modifications to |value| will not modify this object. If 18320 // |value| represents complex data (binary, dictionary or list) then the 18321 // underlying data will be referenced and modifications to |value| will modify 18322 // this object. 18323 /// 18324 extern(System) int function ( 18325 cef_dictionary_value_t* self, 18326 const(cef_string_t)* key, 18327 cef_value_t* value) nothrow set_value; 18328 18329 /// 18330 // Sets the value at the specified key as type null. Returns true (1) if the 18331 // value was set successfully. 18332 /// 18333 extern(System) int function ( 18334 cef_dictionary_value_t* self, 18335 const(cef_string_t)* key) nothrow set_null; 18336 18337 /// 18338 // Sets the value at the specified key as type bool. Returns true (1) if the 18339 // value was set successfully. 18340 /// 18341 extern(System) int function ( 18342 cef_dictionary_value_t* self, 18343 const(cef_string_t)* key, 18344 int value) nothrow set_bool; 18345 18346 /// 18347 // Sets the value at the specified key as type int. Returns true (1) if the 18348 // value was set successfully. 18349 /// 18350 extern(System) int function ( 18351 cef_dictionary_value_t* self, 18352 const(cef_string_t)* key, 18353 int value) nothrow set_int; 18354 18355 /// 18356 // Sets the value at the specified key as type double. Returns true (1) if the 18357 // value was set successfully. 18358 /// 18359 extern(System) int function ( 18360 cef_dictionary_value_t* self, 18361 const(cef_string_t)* key, 18362 double value) nothrow set_double; 18363 18364 /// 18365 // Sets the value at the specified key as type string. Returns true (1) if the 18366 // value was set successfully. 18367 /// 18368 extern(System) int function ( 18369 cef_dictionary_value_t* self, 18370 const(cef_string_t)* key, 18371 const(cef_string_t)* value) nothrow set_string; 18372 18373 /// 18374 // Sets the value at the specified key as type binary. Returns true (1) if the 18375 // value was set successfully. If |value| is currently owned by another object 18376 // then the value will be copied and the |value| reference will not change. 18377 // Otherwise, ownership will be transferred to this object and the |value| 18378 // reference will be invalidated. 18379 /// 18380 extern(System) int function ( 18381 cef_dictionary_value_t* self, 18382 const(cef_string_t)* key, 18383 cef_binary_value_t* value) nothrow set_binary; 18384 18385 /// 18386 // Sets the value at the specified key as type dict. Returns true (1) if the 18387 // value was set successfully. If |value| is currently owned by another object 18388 // then the value will be copied and the |value| reference will not change. 18389 // Otherwise, ownership will be transferred to this object and the |value| 18390 // reference will be invalidated. 18391 /// 18392 extern(System) int function ( 18393 cef_dictionary_value_t* self, 18394 const(cef_string_t)* key, 18395 cef_dictionary_value_t* value) nothrow set_dictionary; 18396 18397 /// 18398 // Sets the value at the specified key as type list. Returns true (1) if the 18399 // value was set successfully. If |value| is currently owned by another object 18400 // then the value will be copied and the |value| reference will not change. 18401 // Otherwise, ownership will be transferred to this object and the |value| 18402 // reference will be invalidated. 18403 /// 18404 extern(System) int function ( 18405 cef_dictionary_value_t* self, 18406 const(cef_string_t)* key, 18407 cef_list_value_t* value) nothrow set_list; 18408 } 18409 18410 18411 18412 /// 18413 // Creates a new object that is not owned by any other object. 18414 /// 18415 cef_dictionary_value_t* cef_dictionary_value_create (); 18416 18417 /// 18418 // Structure representing a list value. Can be used on any process and thread. 18419 /// 18420 struct cef_list_value_t 18421 { 18422 /// 18423 // Base structure. 18424 /// 18425 cef_base_ref_counted_t base; 18426 18427 /// 18428 // Returns true (1) if this object is valid. This object may become invalid if 18429 // the underlying data is owned by another object (e.g. list or dictionary) 18430 // and that other object is then modified or destroyed. Do not call any other 18431 // functions if this function returns false (0). 18432 /// 18433 extern(System) int function (cef_list_value_t* self) nothrow is_valid; 18434 18435 /// 18436 // Returns true (1) if this object is currently owned by another object. 18437 /// 18438 extern(System) int function (cef_list_value_t* self) nothrow is_owned; 18439 18440 /// 18441 // Returns true (1) if the values of this object are read-only. Some APIs may 18442 // expose read-only objects. 18443 /// 18444 extern(System) int function (cef_list_value_t* self) nothrow is_read_only; 18445 18446 /// 18447 // Returns true (1) if this object and |that| object have the same underlying 18448 // data. If true (1) modifications to this object will also affect |that| 18449 // object and vice-versa. 18450 /// 18451 extern(System) int function (cef_list_value_t* self, cef_list_value_t* that) nothrow is_same; 18452 18453 /// 18454 // Returns true (1) if this object and |that| object have an equivalent 18455 // underlying value but are not necessarily the same object. 18456 /// 18457 extern(System) int function (cef_list_value_t* self, cef_list_value_t* that) nothrow is_equal; 18458 18459 /// 18460 // Returns a writable copy of this object. 18461 /// 18462 extern(System) cef_list_value_t* function (cef_list_value_t* self) nothrow copy; 18463 18464 /// 18465 // Sets the number of values. If the number of values is expanded all new 18466 // value slots will default to type null. Returns true (1) on success. 18467 /// 18468 extern(System) int function (cef_list_value_t* self, size_t size) nothrow set_size; 18469 18470 /// 18471 // Returns the number of values. 18472 /// 18473 extern(System) size_t function (cef_list_value_t* self) nothrow get_size; 18474 18475 /// 18476 // Removes all values. Returns true (1) on success. 18477 /// 18478 extern(System) int function (cef_list_value_t* self) nothrow clear; 18479 18480 /// 18481 // Removes the value at the specified index. 18482 /// 18483 extern(System) int function (cef_list_value_t* self, size_t index) nothrow remove; 18484 18485 /// 18486 // Returns the value type at the specified index. 18487 /// 18488 extern(System) cef_value_type_t function (cef_list_value_t* self, size_t index) nothrow get_type; 18489 18490 /// 18491 // Returns the value at the specified index. For simple types the returned 18492 // value will copy existing data and modifications to the value will not 18493 // modify this object. For complex types (binary, dictionary and list) the 18494 // returned value will reference existing data and modifications to the value 18495 // will modify this object. 18496 /// 18497 extern(System) cef_value_t* function (cef_list_value_t* self, size_t index) nothrow get_value; 18498 18499 /// 18500 // Returns the value at the specified index as type bool. 18501 /// 18502 extern(System) int function (cef_list_value_t* self, size_t index) nothrow get_bool; 18503 18504 /// 18505 // Returns the value at the specified index as type int. 18506 /// 18507 extern(System) int function (cef_list_value_t* self, size_t index) nothrow get_int; 18508 18509 /// 18510 // Returns the value at the specified index as type double. 18511 /// 18512 extern(System) double function (cef_list_value_t* self, size_t index) nothrow get_double; 18513 18514 /// 18515 // Returns the value at the specified index as type string. 18516 /// 18517 // The resulting string must be freed by calling cef_string_userfree_free(). 18518 extern(System) cef_string_userfree_t function ( 18519 cef_list_value_t* self, 18520 size_t index) nothrow get_string; 18521 18522 /// 18523 // Returns the value at the specified index as type binary. The returned value 18524 // will reference existing data. 18525 /// 18526 extern(System) cef_binary_value_t* function ( 18527 cef_list_value_t* self, 18528 size_t index) nothrow get_binary; 18529 18530 /// 18531 // Returns the value at the specified index as type dictionary. The returned 18532 // value will reference existing data and modifications to the value will 18533 // modify this object. 18534 /// 18535 extern(System) cef_dictionary_value_t* function ( 18536 cef_list_value_t* self, 18537 size_t index) nothrow get_dictionary; 18538 18539 /// 18540 // Returns the value at the specified index as type list. The returned value 18541 // will reference existing data and modifications to the value will modify 18542 // this object. 18543 /// 18544 extern(System) cef_list_value_t* function ( 18545 cef_list_value_t* self, 18546 size_t index) nothrow get_list; 18547 18548 /// 18549 // Sets the value at the specified index. Returns true (1) if the value was 18550 // set successfully. If |value| represents simple data then the underlying 18551 // data will be copied and modifications to |value| will not modify this 18552 // object. If |value| represents complex data (binary, dictionary or list) 18553 // then the underlying data will be referenced and modifications to |value| 18554 // will modify this object. 18555 /// 18556 extern(System) int function ( 18557 cef_list_value_t* self, 18558 size_t index, 18559 cef_value_t* value) nothrow set_value; 18560 18561 /// 18562 // Sets the value at the specified index as type null. Returns true (1) if the 18563 // value was set successfully. 18564 /// 18565 extern(System) int function (cef_list_value_t* self, size_t index) nothrow set_null; 18566 18567 /// 18568 // Sets the value at the specified index as type bool. Returns true (1) if the 18569 // value was set successfully. 18570 /// 18571 extern(System) int function (cef_list_value_t* self, size_t index, int value) nothrow set_bool; 18572 18573 /// 18574 // Sets the value at the specified index as type int. Returns true (1) if the 18575 // value was set successfully. 18576 /// 18577 extern(System) int function (cef_list_value_t* self, size_t index, int value) nothrow set_int; 18578 18579 /// 18580 // Sets the value at the specified index as type double. Returns true (1) if 18581 // the value was set successfully. 18582 /// 18583 extern(System) int function ( 18584 cef_list_value_t* self, 18585 size_t index, 18586 double value) nothrow set_double; 18587 18588 /// 18589 // Sets the value at the specified index as type string. Returns true (1) if 18590 // the value was set successfully. 18591 /// 18592 extern(System) int function ( 18593 cef_list_value_t* self, 18594 size_t index, 18595 const(cef_string_t)* value) nothrow set_string; 18596 18597 /// 18598 // Sets the value at the specified index as type binary. Returns true (1) if 18599 // the value was set successfully. If |value| is currently owned by another 18600 // object then the value will be copied and the |value| reference will not 18601 // change. Otherwise, ownership will be transferred to this object and the 18602 // |value| reference will be invalidated. 18603 /// 18604 extern(System) int function ( 18605 cef_list_value_t* self, 18606 size_t index, 18607 cef_binary_value_t* value) nothrow set_binary; 18608 18609 /// 18610 // Sets the value at the specified index as type dict. Returns true (1) if the 18611 // value was set successfully. If |value| is currently owned by another object 18612 // then the value will be copied and the |value| reference will not change. 18613 // Otherwise, ownership will be transferred to this object and the |value| 18614 // reference will be invalidated. 18615 /// 18616 extern(System) int function ( 18617 cef_list_value_t* self, 18618 size_t index, 18619 cef_dictionary_value_t* value) nothrow set_dictionary; 18620 18621 /// 18622 // Sets the value at the specified index as type list. Returns true (1) if the 18623 // value was set successfully. If |value| is currently owned by another object 18624 // then the value will be copied and the |value| reference will not change. 18625 // Otherwise, ownership will be transferred to this object and the |value| 18626 // reference will be invalidated. 18627 /// 18628 extern(System) int function ( 18629 cef_list_value_t* self, 18630 size_t index, 18631 cef_list_value_t* value) nothrow set_list; 18632 } 18633 18634 18635 18636 /// 18637 // Creates a new object that is not owned by any other object. 18638 /// 18639 cef_list_value_t* cef_list_value_create (); 18640 18641 // CEF_INCLUDE_CAPI_CEF_VALUES_CAPI_H_ 18642 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 18643 // 18644 // Redistribution and use in source and binary forms, with or without 18645 // modification, are permitted provided that the following conditions are 18646 // met: 18647 // 18648 // * Redistributions of source code must retain the above copyright 18649 // notice, this list of conditions and the following disclaimer. 18650 // * Redistributions in binary form must reproduce the above 18651 // copyright notice, this list of conditions and the following disclaimer 18652 // in the documentation and/or other materials provided with the 18653 // distribution. 18654 // * Neither the name of Google Inc. nor the name Chromium Embedded 18655 // Framework nor the names of its contributors may be used to endorse 18656 // or promote products derived from this software without specific prior 18657 // written permission. 18658 // 18659 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18660 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18661 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18662 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 18663 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 18664 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 18665 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 18666 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 18667 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 18668 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 18669 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 18670 // 18671 // --------------------------------------------------------------------------- 18672 // 18673 // This file was generated by the CEF translator tool and should not edited 18674 // by hand. See the translator.README.txt file in the tools directory for 18675 // more information. 18676 // 18677 // $hash=ed698ff6cb09ee2ed87614e2733c742db827ed4f$ 18678 // 18679 18680 extern (C): 18681 18682 /// 18683 // WaitableEvent is a thread synchronization tool that allows one thread to wait 18684 // for another thread to finish some work. This is equivalent to using a 18685 // Lock+ConditionVariable to protect a simple boolean value. However, using 18686 // WaitableEvent in conjunction with a Lock to wait for a more complex state 18687 // change (e.g., for an item to be added to a queue) is not recommended. In that 18688 // case consider using a ConditionVariable instead of a WaitableEvent. It is 18689 // safe to create and/or signal a WaitableEvent from any thread. Blocking on a 18690 // WaitableEvent by calling the *wait() functions is not allowed on the browser 18691 // process UI or IO threads. 18692 /// 18693 struct cef_waitable_event_t 18694 { 18695 /// 18696 // Base structure. 18697 /// 18698 cef_base_ref_counted_t base; 18699 18700 /// 18701 // Put the event in the un-signaled state. 18702 /// 18703 extern(System) void function (cef_waitable_event_t* self) nothrow reset; 18704 18705 /// 18706 // Put the event in the signaled state. This causes any thread blocked on Wait 18707 // to be woken up. 18708 /// 18709 extern(System) void function (cef_waitable_event_t* self) nothrow signal; 18710 18711 /// 18712 // Returns true (1) if the event is in the signaled state, else false (0). If 18713 // the event was created with |automatic_reset| set to true (1) then calling 18714 // this function will also cause a reset. 18715 /// 18716 extern(System) int function (cef_waitable_event_t* self) nothrow is_signaled; 18717 18718 /// 18719 // Wait indefinitely for the event to be signaled. This function will not 18720 // return until after the call to signal() has completed. This function cannot 18721 // be called on the browser process UI or IO threads. 18722 /// 18723 extern(System) void function (cef_waitable_event_t* self) nothrow wait; 18724 18725 /// 18726 // Wait up to |max_ms| milliseconds for the event to be signaled. Returns true 18727 // (1) if the event was signaled. A return value of false (0) does not 18728 // necessarily mean that |max_ms| was exceeded. This function will not return 18729 // until after the call to signal() has completed. This function cannot be 18730 // called on the browser process UI or IO threads. 18731 /// 18732 extern(System) int function (cef_waitable_event_t* self, int64 max_ms) nothrow timed_wait; 18733 } 18734 18735 18736 18737 /// 18738 // Create a new waitable event. If |automatic_reset| is true (1) then the event 18739 // state is automatically reset to un-signaled after a single waiting thread has 18740 // been released; otherwise, the state remains signaled until reset() is called 18741 // manually. If |initially_signaled| is true (1) then the event will start in 18742 // the signaled state. 18743 /// 18744 cef_waitable_event_t* cef_waitable_event_create ( 18745 int automatic_reset, 18746 int initially_signaled); 18747 18748 // CEF_INCLUDE_CAPI_CEF_WAITABLE_EVENT_CAPI_H_ 18749 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 18750 // 18751 // Redistribution and use in source and binary forms, with or without 18752 // modification, are permitted provided that the following conditions are 18753 // met: 18754 // 18755 // * Redistributions of source code must retain the above copyright 18756 // notice, this list of conditions and the following disclaimer. 18757 // * Redistributions in binary form must reproduce the above 18758 // copyright notice, this list of conditions and the following disclaimer 18759 // in the documentation and/or other materials provided with the 18760 // distribution. 18761 // * Neither the name of Google Inc. nor the name Chromium Embedded 18762 // Framework nor the names of its contributors may be used to endorse 18763 // or promote products derived from this software without specific prior 18764 // written permission. 18765 // 18766 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18767 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18768 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18769 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 18770 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 18771 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 18772 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 18773 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 18774 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 18775 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 18776 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 18777 // 18778 // --------------------------------------------------------------------------- 18779 // 18780 // This file was generated by the CEF translator tool and should not edited 18781 // by hand. See the translator.README.txt file in the tools directory for 18782 // more information. 18783 // 18784 // $hash=f51ad9ffc67d94b9cbfad154e7f224111c2a96fa$ 18785 // 18786 18787 extern (C): 18788 18789 18790 18791 /// 18792 // Information about a specific web plugin. 18793 /// 18794 struct cef_web_plugin_info_t 18795 { 18796 /// 18797 // Base structure. 18798 /// 18799 cef_base_ref_counted_t base; 18800 18801 /// 18802 // Returns the plugin name. 18803 /// 18804 // The resulting string must be freed by calling cef_string_userfree_free(). 18805 extern(System) cef_string_userfree_t function (cef_web_plugin_info_t* self) nothrow get_name; 18806 18807 /// 18808 // Returns the plugin file path (DLL/bundle/library). 18809 /// 18810 // The resulting string must be freed by calling cef_string_userfree_free(). 18811 extern(System) cef_string_userfree_t function (cef_web_plugin_info_t* self) nothrow get_path; 18812 18813 /// 18814 // Returns the version of the plugin (may be OS-specific). 18815 /// 18816 // The resulting string must be freed by calling cef_string_userfree_free(). 18817 extern(System) cef_string_userfree_t function (cef_web_plugin_info_t* self) nothrow get_version; 18818 18819 /// 18820 // Returns a description of the plugin from the version information. 18821 /// 18822 // The resulting string must be freed by calling cef_string_userfree_free(). 18823 extern(System) cef_string_userfree_t function ( 18824 cef_web_plugin_info_t* self) nothrow get_description; 18825 } 18826 18827 18828 18829 /// 18830 // Structure to implement for visiting web plugin information. The functions of 18831 // this structure will be called on the browser process UI thread. 18832 /// 18833 struct cef_web_plugin_info_visitor_t 18834 { 18835 /// 18836 // Base structure. 18837 /// 18838 cef_base_ref_counted_t base; 18839 18840 /// 18841 // Method that will be called once for each plugin. |count| is the 0-based 18842 // index for the current plugin. |total| is the total number of plugins. 18843 // Return false (0) to stop visiting plugins. This function may never be 18844 // called if no plugins are found. 18845 /// 18846 extern(System) int function ( 18847 cef_web_plugin_info_visitor_t* self, 18848 cef_web_plugin_info_t* info, 18849 int count, 18850 int total) nothrow visit; 18851 } 18852 18853 18854 18855 /// 18856 // Structure to implement for receiving unstable plugin information. The 18857 // functions of this structure will be called on the browser process IO thread. 18858 /// 18859 struct cef_web_plugin_unstable_callback_t 18860 { 18861 /// 18862 // Base structure. 18863 /// 18864 cef_base_ref_counted_t base; 18865 18866 /// 18867 // Method that will be called for the requested plugin. |unstable| will be 18868 // true (1) if the plugin has reached the crash count threshold of 3 times in 18869 // 120 seconds. 18870 /// 18871 extern(System) void function ( 18872 cef_web_plugin_unstable_callback_t* self, 18873 const(cef_string_t)* path, 18874 int unstable) nothrow is_unstable; 18875 } 18876 18877 18878 18879 /// 18880 // Visit web plugin information. Can be called on any thread in the browser 18881 // process. 18882 /// 18883 void cef_visit_web_plugin_info (cef_web_plugin_info_visitor_t* visitor); 18884 18885 /// 18886 // Cause the plugin list to refresh the next time it is accessed regardless of 18887 // whether it has already been loaded. Can be called on any thread in the 18888 // browser process. 18889 /// 18890 void cef_refresh_web_plugins (); 18891 18892 /// 18893 // Unregister an internal plugin. This may be undone the next time 18894 // cef_refresh_web_plugins() is called. Can be called on any thread in the 18895 // browser process. 18896 /// 18897 void cef_unregister_internal_web_plugin (const(cef_string_t)* path); 18898 18899 /// 18900 // Register a plugin crash. Can be called on any thread in the browser process 18901 // but will be executed on the IO thread. 18902 /// 18903 void cef_register_web_plugin_crash (const(cef_string_t)* path); 18904 18905 /// 18906 // Query if a plugin is unstable. Can be called on any thread in the browser 18907 // process. 18908 /// 18909 void cef_is_web_plugin_unstable ( 18910 const(cef_string_t)* path, 18911 cef_web_plugin_unstable_callback_t* callback); 18912 18913 // CEF_INCLUDE_CAPI_CEF_WEB_PLUGIN_CAPI_H_ 18914 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 18915 // 18916 // Redistribution and use in source and binary forms, with or without 18917 // modification, are permitted provided that the following conditions are 18918 // met: 18919 // 18920 // * Redistributions of source code must retain the above copyright 18921 // notice, this list of conditions and the following disclaimer. 18922 // * Redistributions in binary form must reproduce the above 18923 // copyright notice, this list of conditions and the following disclaimer 18924 // in the documentation and/or other materials provided with the 18925 // distribution. 18926 // * Neither the name of Google Inc. nor the name Chromium Embedded 18927 // Framework nor the names of its contributors may be used to endorse 18928 // or promote products derived from this software without specific prior 18929 // written permission. 18930 // 18931 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18932 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18933 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18934 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 18935 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 18936 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 18937 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 18938 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 18939 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 18940 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 18941 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 18942 // 18943 // --------------------------------------------------------------------------- 18944 // 18945 // This file was generated by the CEF translator tool and should not edited 18946 // by hand. See the translator.README.txt file in the tools directory for 18947 // more information. 18948 // 18949 // $hash=e06ad8a1e173edd1e888ce6a8f8a9d95394e6a44$ 18950 // 18951 18952 extern (C): 18953 18954 /// 18955 // Structure representing the issuer or subject field of an X.509 certificate. 18956 /// 18957 struct cef_x509cert_principal_t 18958 { 18959 /// 18960 // Base structure. 18961 /// 18962 cef_base_ref_counted_t base; 18963 18964 /// 18965 // Returns a name that can be used to represent the issuer. It tries in this 18966 // order: Common Name (CN), Organization Name (O) and Organizational Unit Name 18967 // (OU) and returns the first non-NULL one found. 18968 /// 18969 // The resulting string must be freed by calling cef_string_userfree_free(). 18970 extern(System) cef_string_userfree_t function ( 18971 cef_x509cert_principal_t* self) nothrow get_display_name; 18972 18973 /// 18974 // Returns the common name. 18975 /// 18976 // The resulting string must be freed by calling cef_string_userfree_free(). 18977 extern(System) cef_string_userfree_t function ( 18978 cef_x509cert_principal_t* self) nothrow get_common_name; 18979 18980 /// 18981 // Returns the locality name. 18982 /// 18983 // The resulting string must be freed by calling cef_string_userfree_free(). 18984 extern(System) cef_string_userfree_t function ( 18985 cef_x509cert_principal_t* self) nothrow get_locality_name; 18986 18987 /// 18988 // Returns the state or province name. 18989 /// 18990 // The resulting string must be freed by calling cef_string_userfree_free(). 18991 extern(System) cef_string_userfree_t function ( 18992 cef_x509cert_principal_t* self) nothrow get_state_or_province_name; 18993 18994 /// 18995 // Returns the country name. 18996 /// 18997 // The resulting string must be freed by calling cef_string_userfree_free(). 18998 extern(System) cef_string_userfree_t function ( 18999 cef_x509cert_principal_t* self) nothrow get_country_name; 19000 19001 /// 19002 // Retrieve the list of street addresses. 19003 /// 19004 extern(System) void function ( 19005 cef_x509cert_principal_t* self, 19006 cef_string_list_t addresses) nothrow get_street_addresses; 19007 19008 /// 19009 // Retrieve the list of organization names. 19010 /// 19011 extern(System) void function ( 19012 cef_x509cert_principal_t* self, 19013 cef_string_list_t names) nothrow get_organization_names; 19014 19015 /// 19016 // Retrieve the list of organization unit names. 19017 /// 19018 extern(System) void function ( 19019 cef_x509cert_principal_t* self, 19020 cef_string_list_t names) nothrow get_organization_unit_names; 19021 19022 /// 19023 // Retrieve the list of domain components. 19024 /// 19025 extern(System) void function ( 19026 cef_x509cert_principal_t* self, 19027 cef_string_list_t components) nothrow get_domain_components; 19028 } 19029 19030 19031 19032 /// 19033 // Structure representing a X.509 certificate. 19034 /// 19035 struct cef_x509certificate_t 19036 { 19037 /// 19038 // Base structure. 19039 /// 19040 cef_base_ref_counted_t base; 19041 19042 /// 19043 // Returns the subject of the X.509 certificate. For HTTPS server certificates 19044 // this represents the web server. The common name of the subject should 19045 // match the host name of the web server. 19046 /// 19047 extern(System) cef_x509cert_principal_t* function ( 19048 cef_x509certificate_t* self) nothrow get_subject; 19049 19050 /// 19051 // Returns the issuer of the X.509 certificate. 19052 /// 19053 extern(System) cef_x509cert_principal_t* function ( 19054 cef_x509certificate_t* self) nothrow get_issuer; 19055 19056 /// 19057 // Returns the DER encoded serial number for the X.509 certificate. The value 19058 // possibly includes a leading 00 byte. 19059 /// 19060 extern(System) cef_binary_value_t* function ( 19061 cef_x509certificate_t* self) nothrow get_serial_number; 19062 19063 /// 19064 // Returns the date before which the X.509 certificate is invalid. 19065 // CefTime.GetTimeT() will return 0 if no date was specified. 19066 /// 19067 extern(System) cef_time_t function (cef_x509certificate_t* self) nothrow get_valid_start; 19068 19069 /// 19070 // Returns the date after which the X.509 certificate is invalid. 19071 // CefTime.GetTimeT() will return 0 if no date was specified. 19072 /// 19073 extern(System) cef_time_t function (cef_x509certificate_t* self) nothrow get_valid_expiry; 19074 19075 /// 19076 // Returns the DER encoded data for the X.509 certificate. 19077 /// 19078 extern(System) cef_binary_value_t* function ( 19079 cef_x509certificate_t* self) nothrow get_derencoded; 19080 19081 /// 19082 // Returns the PEM encoded data for the X.509 certificate. 19083 /// 19084 extern(System) cef_binary_value_t* function ( 19085 cef_x509certificate_t* self) nothrow get_pemencoded; 19086 19087 /// 19088 // Returns the number of certificates in the issuer chain. If 0, the 19089 // certificate is self-signed. 19090 /// 19091 extern(System) size_t function (cef_x509certificate_t* self) nothrow get_issuer_chain_size; 19092 19093 /// 19094 // Returns the DER encoded data for the certificate issuer chain. If we failed 19095 // to encode a certificate in the chain it is still present in the array but 19096 // is an NULL string. 19097 /// 19098 extern(System) void function ( 19099 cef_x509certificate_t* self, 19100 size_t* chainCount, 19101 cef_binary_value_t** chain) nothrow get_derencoded_issuer_chain; 19102 19103 /// 19104 // Returns the PEM encoded data for the certificate issuer chain. If we failed 19105 // to encode a certificate in the chain it is still present in the array but 19106 // is an NULL string. 19107 /// 19108 extern(System) void function ( 19109 cef_x509certificate_t* self, 19110 size_t* chainCount, 19111 cef_binary_value_t** chain) nothrow get_pemencoded_issuer_chain; 19112 } 19113 19114 19115 19116 // CEF_INCLUDE_CAPI_CEF_X509_CERTIFICATE_CAPI_H_ 19117 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 19118 // 19119 // Redistribution and use in source and binary forms, with or without 19120 // modification, are permitted provided that the following conditions are 19121 // met: 19122 // 19123 // * Redistributions of source code must retain the above copyright 19124 // notice, this list of conditions and the following disclaimer. 19125 // * Redistributions in binary form must reproduce the above 19126 // copyright notice, this list of conditions and the following disclaimer 19127 // in the documentation and/or other materials provided with the 19128 // distribution. 19129 // * Neither the name of Google Inc. nor the name Chromium Embedded 19130 // Framework nor the names of its contributors may be used to endorse 19131 // or promote products derived from this software without specific prior 19132 // written permission. 19133 // 19134 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19135 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19136 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19137 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19138 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 19139 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 19140 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19141 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 19142 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 19143 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 19144 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 19145 // 19146 // --------------------------------------------------------------------------- 19147 // 19148 // This file was generated by the CEF translator tool and should not edited 19149 // by hand. See the translator.README.txt file in the tools directory for 19150 // more information. 19151 // 19152 // $hash=76de25a0d0f0a2cc4657f46c26ec44b6d7d937e8$ 19153 // 19154 19155 extern (C): 19156 19157 /// 19158 // Structure that supports the reading of XML data via the libxml streaming API. 19159 // The functions of this structure should only be called on the thread that 19160 // creates the object. 19161 /// 19162 struct cef_xml_reader_t 19163 { 19164 /// 19165 // Base structure. 19166 /// 19167 cef_base_ref_counted_t base; 19168 19169 /// 19170 // Moves the cursor to the next node in the document. This function must be 19171 // called at least once to set the current cursor position. Returns true (1) 19172 // if the cursor position was set successfully. 19173 /// 19174 extern(System) int function (cef_xml_reader_t* self) nothrow move_to_next_node; 19175 19176 /// 19177 // Close the document. This should be called directly to ensure that cleanup 19178 // occurs on the correct thread. 19179 /// 19180 extern(System) int function (cef_xml_reader_t* self) nothrow close; 19181 19182 /// 19183 // Returns true (1) if an error has been reported by the XML parser. 19184 /// 19185 extern(System) int function (cef_xml_reader_t* self) nothrow has_error; 19186 19187 /// 19188 // Returns the error string. 19189 /// 19190 // The resulting string must be freed by calling cef_string_userfree_free(). 19191 extern(System) cef_string_userfree_t function (cef_xml_reader_t* self) nothrow get_error; 19192 19193 // The below functions retrieve data for the node at the current cursor 19194 // position. 19195 19196 /// 19197 // Returns the node type. 19198 /// 19199 extern(System) cef_xml_node_type_t function (cef_xml_reader_t* self) nothrow get_type; 19200 19201 /// 19202 // Returns the node depth. Depth starts at 0 for the root node. 19203 /// 19204 extern(System) int function (cef_xml_reader_t* self) nothrow get_depth; 19205 19206 /// 19207 // Returns the local name. See http://www.w3.org/TR/REC-xml-names/#NT- 19208 // LocalPart for additional details. 19209 /// 19210 // The resulting string must be freed by calling cef_string_userfree_free(). 19211 extern(System) cef_string_userfree_t function (cef_xml_reader_t* self) nothrow get_local_name; 19212 19213 /// 19214 // Returns the namespace prefix. See http://www.w3.org/TR/REC-xml-names/ for 19215 // additional details. 19216 /// 19217 // The resulting string must be freed by calling cef_string_userfree_free(). 19218 extern(System) cef_string_userfree_t function (cef_xml_reader_t* self) nothrow get_prefix; 19219 19220 /// 19221 // Returns the qualified name, equal to (Prefix:)LocalName. See 19222 // http://www.w3.org/TR/REC-xml-names/#ns-qualnames for additional details. 19223 /// 19224 // The resulting string must be freed by calling cef_string_userfree_free(). 19225 extern(System) cef_string_userfree_t function ( 19226 cef_xml_reader_t* self) nothrow get_qualified_name; 19227 19228 /// 19229 // Returns the URI defining the namespace associated with the node. See 19230 // http://www.w3.org/TR/REC-xml-names/ for additional details. 19231 /// 19232 // The resulting string must be freed by calling cef_string_userfree_free(). 19233 extern(System) cef_string_userfree_t function (cef_xml_reader_t* self) nothrow get_namespace_uri; 19234 19235 /// 19236 // Returns the base URI of the node. See http://www.w3.org/TR/xmlbase/ for 19237 // additional details. 19238 /// 19239 // The resulting string must be freed by calling cef_string_userfree_free(). 19240 extern(System) cef_string_userfree_t function (cef_xml_reader_t* self) nothrow get_base_uri; 19241 19242 /// 19243 // Returns the xml:lang scope within which the node resides. See 19244 // http://www.w3.org/TR/REC-xml/#sec-lang-tag for additional details. 19245 /// 19246 // The resulting string must be freed by calling cef_string_userfree_free(). 19247 extern(System) cef_string_userfree_t function (cef_xml_reader_t* self) nothrow get_xml_lang; 19248 19249 /// 19250 // Returns true (1) if the node represents an NULL element. <a/> is considered 19251 // NULL but <a></a> is not. 19252 /// 19253 extern(System) int function (cef_xml_reader_t* self) nothrow is_empty_element; 19254 19255 /// 19256 // Returns true (1) if the node has a text value. 19257 /// 19258 extern(System) int function (cef_xml_reader_t* self) nothrow has_value; 19259 19260 /// 19261 // Returns the text value. 19262 /// 19263 // The resulting string must be freed by calling cef_string_userfree_free(). 19264 extern(System) cef_string_userfree_t function (cef_xml_reader_t* self) nothrow get_value; 19265 19266 /// 19267 // Returns true (1) if the node has attributes. 19268 /// 19269 extern(System) int function (cef_xml_reader_t* self) nothrow has_attributes; 19270 19271 /// 19272 // Returns the number of attributes. 19273 /// 19274 extern(System) size_t function (cef_xml_reader_t* self) nothrow get_attribute_count; 19275 19276 /// 19277 // Returns the value of the attribute at the specified 0-based index. 19278 /// 19279 // The resulting string must be freed by calling cef_string_userfree_free(). 19280 extern(System) cef_string_userfree_t function ( 19281 cef_xml_reader_t* self, 19282 int index) nothrow get_attribute_byindex; 19283 19284 /// 19285 // Returns the value of the attribute with the specified qualified name. 19286 /// 19287 // The resulting string must be freed by calling cef_string_userfree_free(). 19288 extern(System) cef_string_userfree_t function ( 19289 cef_xml_reader_t* self, 19290 const(cef_string_t)* qualifiedName) nothrow get_attribute_byqname; 19291 19292 /// 19293 // Returns the value of the attribute with the specified local name and 19294 // namespace URI. 19295 /// 19296 // The resulting string must be freed by calling cef_string_userfree_free(). 19297 extern(System) cef_string_userfree_t function ( 19298 cef_xml_reader_t* self, 19299 const(cef_string_t)* localName, 19300 const(cef_string_t)* namespaceURI) nothrow get_attribute_bylname; 19301 19302 /// 19303 // Returns an XML representation of the current node's children. 19304 /// 19305 // The resulting string must be freed by calling cef_string_userfree_free(). 19306 extern(System) cef_string_userfree_t function (cef_xml_reader_t* self) nothrow get_inner_xml; 19307 19308 /// 19309 // Returns an XML representation of the current node including its children. 19310 /// 19311 // The resulting string must be freed by calling cef_string_userfree_free(). 19312 extern(System) cef_string_userfree_t function (cef_xml_reader_t* self) nothrow get_outer_xml; 19313 19314 /// 19315 // Returns the line number for the current node. 19316 /// 19317 extern(System) int function (cef_xml_reader_t* self) nothrow get_line_number; 19318 19319 // Attribute nodes are not traversed by default. The below functions can be 19320 // used to move the cursor to an attribute node. move_to_carrying_element() 19321 // can be called afterwards to return the cursor to the carrying element. The 19322 // depth of an attribute node will be 1 + the depth of the carrying element. 19323 19324 /// 19325 // Moves the cursor to the attribute at the specified 0-based index. Returns 19326 // true (1) if the cursor position was set successfully. 19327 /// 19328 extern(System) int function ( 19329 cef_xml_reader_t* self, 19330 int index) nothrow move_to_attribute_byindex; 19331 19332 /// 19333 // Moves the cursor to the attribute with the specified qualified name. 19334 // Returns true (1) if the cursor position was set successfully. 19335 /// 19336 extern(System) int function ( 19337 cef_xml_reader_t* self, 19338 const(cef_string_t)* qualifiedName) nothrow move_to_attribute_byqname; 19339 19340 /// 19341 // Moves the cursor to the attribute with the specified local name and 19342 // namespace URI. Returns true (1) if the cursor position was set 19343 // successfully. 19344 /// 19345 extern(System) int function ( 19346 cef_xml_reader_t* self, 19347 const(cef_string_t)* localName, 19348 const(cef_string_t)* namespaceURI) nothrow move_to_attribute_bylname; 19349 19350 /// 19351 // Moves the cursor to the first attribute in the current element. Returns 19352 // true (1) if the cursor position was set successfully. 19353 /// 19354 extern(System) int function (cef_xml_reader_t* self) nothrow move_to_first_attribute; 19355 19356 /// 19357 // Moves the cursor to the next attribute in the current element. Returns true 19358 // (1) if the cursor position was set successfully. 19359 /// 19360 extern(System) int function (cef_xml_reader_t* self) nothrow move_to_next_attribute; 19361 19362 /// 19363 // Moves the cursor back to the carrying element. Returns true (1) if the 19364 // cursor position was set successfully. 19365 /// 19366 extern(System) int function (cef_xml_reader_t* self) nothrow move_to_carrying_element; 19367 } 19368 19369 19370 19371 /// 19372 // Create a new cef_xml_reader_t object. The returned object's functions can 19373 // only be called from the thread that created the object. 19374 /// 19375 cef_xml_reader_t* cef_xml_reader_create ( 19376 cef_stream_reader_t* stream, 19377 cef_xml_encoding_type_t encodingType, 19378 const(cef_string_t)* URI); 19379 19380 // CEF_INCLUDE_CAPI_CEF_XML_READER_CAPI_H_ 19381 // Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved. 19382 // 19383 // Redistribution and use in source and binary forms, with or without 19384 // modification, are permitted provided that the following conditions are 19385 // met: 19386 // 19387 // * Redistributions of source code must retain the above copyright 19388 // notice, this list of conditions and the following disclaimer. 19389 // * Redistributions in binary form must reproduce the above 19390 // copyright notice, this list of conditions and the following disclaimer 19391 // in the documentation and/or other materials provided with the 19392 // distribution. 19393 // * Neither the name of Google Inc. nor the name Chromium Embedded 19394 // Framework nor the names of its contributors may be used to endorse 19395 // or promote products derived from this software without specific prior 19396 // written permission. 19397 // 19398 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19399 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19400 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19401 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19402 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 19403 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 19404 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19405 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 19406 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 19407 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 19408 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 19409 // 19410 // --------------------------------------------------------------------------- 19411 // 19412 // This file was generated by the CEF translator tool and should not edited 19413 // by hand. See the translator.README.txt file in the tools directory for 19414 // more information. 19415 // 19416 // $hash=d3d4ee91a69edd5f12785871b5c5a55e86c5c675$ 19417 // 19418 19419 extern (C): 19420 19421 /// 19422 // Structure that supports the reading of zip archives via the zlib unzip API. 19423 // The functions of this structure should only be called on the thread that 19424 // creates the object. 19425 /// 19426 struct cef_zip_reader_t 19427 { 19428 /// 19429 // Base structure. 19430 /// 19431 cef_base_ref_counted_t base; 19432 19433 /// 19434 // Moves the cursor to the first file in the archive. Returns true (1) if the 19435 // cursor position was set successfully. 19436 /// 19437 extern(System) int function (cef_zip_reader_t* self) nothrow move_to_first_file; 19438 19439 /// 19440 // Moves the cursor to the next file in the archive. Returns true (1) if the 19441 // cursor position was set successfully. 19442 /// 19443 extern(System) int function (cef_zip_reader_t* self) nothrow move_to_next_file; 19444 19445 /// 19446 // Moves the cursor to the specified file in the archive. If |caseSensitive| 19447 // is true (1) then the search will be case sensitive. Returns true (1) if the 19448 // cursor position was set successfully. 19449 /// 19450 extern(System) int function ( 19451 cef_zip_reader_t* self, 19452 const(cef_string_t)* fileName, 19453 int caseSensitive) nothrow move_to_file; 19454 19455 /// 19456 // Closes the archive. This should be called directly to ensure that cleanup 19457 // occurs on the correct thread. 19458 /// 19459 extern(System) int function (cef_zip_reader_t* self) nothrow close; 19460 19461 // The below functions act on the file at the current cursor position. 19462 19463 /// 19464 // Returns the name of the file. 19465 /// 19466 // The resulting string must be freed by calling cef_string_userfree_free(). 19467 extern(System) cef_string_userfree_t function (cef_zip_reader_t* self) nothrow get_file_name; 19468 19469 /// 19470 // Returns the uncompressed size of the file. 19471 /// 19472 extern(System) int64 function (cef_zip_reader_t* self) nothrow get_file_size; 19473 19474 /// 19475 // Returns the last modified timestamp for the file. 19476 /// 19477 extern(System) cef_time_t function (cef_zip_reader_t* self) nothrow get_file_last_modified; 19478 19479 /// 19480 // Opens the file for reading of uncompressed data. A read password may 19481 // optionally be specified. 19482 /// 19483 extern(System) int function ( 19484 cef_zip_reader_t* self, 19485 const(cef_string_t)* password) nothrow open_file; 19486 19487 /// 19488 // Closes the file. 19489 /// 19490 extern(System) int function (cef_zip_reader_t* self) nothrow close_file; 19491 19492 /// 19493 // Read uncompressed file contents into the specified buffer. Returns < 0 if 19494 // an error occurred, 0 if at the end of file, or the number of bytes read. 19495 /// 19496 extern(System) int function ( 19497 cef_zip_reader_t* self, 19498 void* buffer, 19499 size_t bufferSize) nothrow read_file; 19500 19501 /// 19502 // Returns the current offset in the uncompressed file contents. 19503 /// 19504 extern(System) int64 function (cef_zip_reader_t* self) nothrow tell; 19505 19506 /// 19507 // Returns true (1) if at end of the file contents. 19508 /// 19509 extern(System) int function (cef_zip_reader_t* self) nothrow eof; 19510 } 19511 19512 19513 19514 /// 19515 // Create a new cef_zip_reader_t object. The returned object's functions can 19516 // only be called from the thread that created the object. 19517 /// 19518 cef_zip_reader_t* cef_zip_reader_create (cef_stream_reader_t* stream); 19519 19520 // CEF_INCLUDE_CAPI_CEF_ZIP_READER_CAPI_H_ 19521 } 19522 19523 } 19524 19525 19526 version(Windows) { 19527 19528 /* ************************************ */ 19529 19530 // File generated by idl2d from 19531 // C:\Users\me\source\repos\webviewtest\packages\Microsoft.Web.WebView2.1.0.664.37\WebView2.idl 19532 //module webview2; 19533 19534 public import core.sys.windows.windows; 19535 public import core.sys.windows.unknwn; 19536 public import core.sys.windows.oaidl; 19537 public import core.sys.windows.objidl; 19538 19539 alias EventRegistrationToken = long; 19540 19541 // Copyright (C) Microsoft Corporation. All rights reserved. 19542 // Use of this source code is governed by a BSD-style license that can be 19543 // found in the LICENSE file. 19544 19545 /+ 19546 Copyright (C) Microsoft Corporation. All rights reserved. 19547 19548 Redistribution and use in source and binary forms, with or without 19549 modification, are permitted provided that the following conditions are 19550 met: 19551 19552 * Redistributions of source code must retain the above copyright 19553 notice, this list of conditions and the following disclaimer. 19554 * Redistributions in binary form must reproduce the above 19555 copyright notice, this list of conditions and the following disclaimer 19556 in the documentation and/or other materials provided with the 19557 distribution. 19558 * The name of Microsoft Corporation, or the names of its contributors 19559 may not be used to endorse or promote products derived from this 19560 software without specific prior written permission. 19561 19562 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19563 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19564 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19565 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19566 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 19567 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 19568 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19569 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 19570 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 19571 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 19572 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 19573 +/ 19574 19575 // # API Review 19576 // All APIs need API review. List API review documents here with the URI to the 19577 // doc and the change ID of the IDL when the document was created. 19578 // API documents: 19579 // * 916246ec [WebView2 API Specification](https://aka.ms/WebView2APISpecification) 19580 // 19581 // # Style 19582 // Follow the [Win32 API Design Guidelines](https://aka.ms/Win32APIDesignGuidelines) 19583 // while editing this file. For any style rules unspecified follow the Anaheim 19584 // style. Specifically, follow Anaheim indenting and line limit style rules in 19585 // this file. 19586 // 19587 // # Documentation 19588 // Please ensure that any new API includes complete documentation in its 19589 // JavaDoc comments in this file and sample usage in the Sample App. 19590 // Comments intended for public API documentation should start with 3 slashes. 19591 // The first sentence is the brief the brief description of the API and 19592 // shouldn't include the name of the API. Use markdown to style your public API 19593 // documentation. 19594 // 19595 // # WebView and JavaScript capitalization 19596 // camel case | webViewExample | javaScriptExample 19597 // Pascal case | WebViewExample | JavaScriptExample 19598 // Upper case | WEBVIEW_EXAMPLE | JAVASCRIPT_EXAMPLE 19599 // 19600 // That said, in API names use the term 'script' rather than 'JavaScript'. 19601 // Script is shorter and there is only one supported scripting language on the 19602 // web so the specificity of JavaScript is unnecessary. 19603 // 19604 // # URI (not URL) 19605 // We use Uri in parameter names and type names 19606 // throughout. URIs identify resources while URLs (a subset of URIs) also 19607 // locates resources. This difference is not generally well understood. Because 19608 // all URLs are URIs we can ignore the conversation of trying to explain the 19609 // difference between the two and still be technically accurate by always using 19610 // the term URI. Additionally, whether a URI is locatable depends on the context 19611 // since end developers can at runtime specify custom URI scheme resolvers. 19612 // 19613 // # Event pattern 19614 // Events have a method to add and to remove event handlers: 19615 // ``` 19616 // HRESULT add_{EventName}( 19617 // ICoreWebView2{EventName}EventHandler* eventHandler, 19618 // EventRegistrationToken* token); 19619 // 19620 // HRESULT remove_{EventName}(EventRegistrationToken token); 19621 // ``` 19622 // Add takes an event handler delegate interface with a single Invoke method. 19623 // ``` 19624 // ICoreWebView2{EventName}EventHandler::Invoke( 19625 // {SenderType}* sender, 19626 // ICoreWebView2{EventHandler}EventArgs* args); 19627 // ``` 19628 // The Invoke method has two parameters. The first is the sender, the object 19629 // which is firing the event. The second is the EventArgs type. It doesn't take 19630 // the event arg parameters directly so we can version interfaces correctly. 19631 // If the event has no properties on its event args type, then the Invoke method 19632 // should take IUnknown* as its event args parameter so it is possible to add 19633 // event args interfaces in the future without requiring a new event. For events 19634 // with no sender (a static event), the Invoke method has only the event args 19635 // parameter. 19636 // 19637 // # Deferrable event pattern 19638 // Generally, events should be deferrable when their event args have settable 19639 // properties. In order for the caller to use asynchronous methods to produce 19640 // the value for those settable properties we must allow the caller to defer 19641 // the WebView reading those properties until asynchronously later. A deferrable 19642 // event should have the following method on its event args interface: 19643 // `HRESULT GetDeferral([out, retval] ICoreWebView2Deferral** deferral);` 19644 // If called, the event is deferred and calling Complete on the 19645 // ICoreWebView2Deferral ends the deferral. 19646 // 19647 // # Asynchronous method pattern 19648 // Async methods take a final parameter that is the completed handler: 19649 // `{MethodName}(..., ICoreWebView2{MethodName}CompletedHandler* handler)` 19650 // The handler has a single Invoke method: 19651 // `ICoreWebView2{MethodName}CompletedHandler::Invoke( 19652 // HRESULT errorCode, {AsyncReturnType});` 19653 // 19654 // # Property pattern 19655 // For properties with getters in IDL you have 19656 // `[propget] HRESULT {PropertyName}([out, retval] {PropertyType}*)` 19657 // And for properties which also have setters in IDL you have 19658 // `[propput] HRESULT {PropertyName}([in] {PropertyType});` 19659 // 19660 // # Versioning 19661 // The loader DLL may be older or newer than the client DLL. We have to deal 19662 // with compatibility across several dimensions: 19663 // * There's the DLL export contract between the loader DLL and the client 19664 // DLL as well as the interfaces defined in this IDL that are built into both 19665 // the app code and the client DLL. 19666 // * There are two kinds of versioned changes we need to be able to make: 19667 // compatible changes and breaking changes. In both cases we need to make the 19668 // change in a safe manner. For compatible that means everything continues to 19669 // work unchanged despite the loader and client being different versions. For 19670 // breaking changes this means the host app is unable to create a 19671 // WebView using the different version browser and receives an associated 19672 // error message (doesn't crash). 19673 // * We also need to consider when the loader and host app is using a newer 19674 // version than the browser and when the loader and host app is using an 19675 // older version than the browser. 19676 // 19677 // ## Scenario 1: Older SDK in host app, Newer browser, Compatible change 19678 // In order to be compatible the newer client DLL must still support the older 19679 // client DLL exports. Similarly for the interfaces - they must all be exactly 19680 // the same with no modified IIDs, no reordered methods, no modified method 19681 // parameters and so on. The client DLL may have more DLL exports and more interfaces 19682 // but no changes to the older shipped DLL export or interfaces. 19683 // App code doesn't need to do anything special in this case. 19684 // 19685 // ## Scenario 2: Older SDK in host app, Newer browser, Breaking change 19686 // For breaking changes in the DLL export, the client DLL must change the DLL 19687 // export name. The old loader will attempt to use the old client DLL export. 19688 // When the loader finds the export missing it will fail. 19689 // For breaking changes in the interface, we must change the IID of the modified 19690 // interface. Additionally the loader DLL must validate that the returned object 19691 // supports the IID it expects and fail otherwise. 19692 // The app code must ensure that WebView objects succeed in their QueryInterface 19693 // calls. Basically the app code must have error handling for objects failing 19694 // QueryInterface and for the initial creation failing in order to handle 19695 // breaking changes gracefully. 19696 // 19697 // ## Scenario 3: Newer SDK in host app, Older browser, Compatible change 19698 // In order to be compatible, the newer loader DLL must fallback to calling the 19699 // older client DLL exports if the client DLL doesn't have the most recent DLL 19700 // exports. 19701 // For interface versioning the loader DLL shouldn't be impacted. 19702 // The app code must not assume an object supports all newer versioned 19703 // interfaces. Ideally it checks the success of QueryInterface for newer 19704 // interfaces and if not supported turns off associated app features or 19705 // otherwise fails gracefully. 19706 // 19707 // ## Scenario 4: Newer SDK in host app, Older browser, Breaking change 19708 // For breaking changes in the DLL export, a new export name will be used after 19709 // a breaking change and the loader DLL will just not check for pre-breaking 19710 // change exports from the client DLL. If the client DLL doesn't have the 19711 // correct exports, then the loader returns failure to the caller. 19712 // For breaking changes in the interface, the IIDs of broken interfaces will 19713 // have been modified. The loader will validate that the 19714 // object returned supports the correct base interface IID and return failure to 19715 // the caller otherwise. 19716 // The app code must allow for QueryInterface calls to fail if the object 19717 // doesn't support the newer IIDs. 19718 // 19719 // ## Actions 19720 // * DLL export compatible changes: Create a new DLL export with a new name. 19721 // Ideally implement the existing DLL export as a call into the new DLL 19722 // export to reduce upkeep burden. 19723 // * DLL export breaking changes: Give the modified DLL export a new name and 19724 // remove all older DLL exports. 19725 // * Interface compatible changes: Don't modify shipped interfaces. Add a new 19726 // interface with an incremented version number suffix 19727 // (ICoreWebView2_3) or feature group name suffix 19728 // (ICoreWebView2WithNavigationHistory). 19729 // * Interface breaking changes: After modifying a shipped interface, give it 19730 // a new IID. 19731 // * Loader: When finding the client DLL export it must check its known range 19732 // of compatible exports in order from newest to oldest and use the newest 19733 // one found. It must not attempt to use an older export from before a 19734 // breaking change. Before returning objects to the caller, the loader must 19735 // validate that the object actually implements the expected interface. 19736 // * App code: Check for error from the DLL export methods as they can fail if 19737 // the loader is used with an old browser from before a breaking change or 19738 // with a newer browser that is after a breaking change. 19739 // Check for errors when calling QueryInterface on a WebView object. The 19740 // QueryInterface call may fail with E_NOINTERFACE if the object is from an 19741 // older browser version that doesn't support the newer interface or if 19742 // using a newer browser version that had a breaking change on that 19743 // interface. 19744 19745 /+[uuid(26d34152-879f-4065-bea2-3daa2cfadfb8), version(1.0)]+/ 19746 /+ library WebView2 +/ 19747 19748 // Interface forward declarations 19749 /+ interface ICoreWebView2AcceleratorKeyPressedEventArgs; +/ 19750 /+ interface ICoreWebView2AcceleratorKeyPressedEventHandler; +/ 19751 /+ interface ICoreWebView2AddScriptToExecuteOnDocumentCreatedCompletedHandler; +/ 19752 /+ interface ICoreWebView2CallDevToolsProtocolMethodCompletedHandler; +/ 19753 /+ interface ICoreWebView2CapturePreviewCompletedHandler; +/ 19754 /+ interface ICoreWebView2; +/ 19755 /+ interface ICoreWebView2Controller; +/ 19756 /+ interface ICoreWebView2ContentLoadingEventArgs; +/ 19757 /+ interface ICoreWebView2ContentLoadingEventHandler; +/ 19758 /+ interface ICoreWebView2DocumentTitleChangedEventHandler; +/ 19759 /+ interface ICoreWebView2ContainsFullScreenElementChangedEventHandler; +/ 19760 /+ interface ICoreWebView2CreateCoreWebView2ControllerCompletedHandler; +/ 19761 /+ interface ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler; +/ 19762 /+ interface ICoreWebView2Deferral; +/ 19763 /+ interface ICoreWebView2DevToolsProtocolEventReceivedEventArgs; +/ 19764 /+ interface ICoreWebView2DevToolsProtocolEventReceivedEventHandler; +/ 19765 /+ interface ICoreWebView2DevToolsProtocolEventReceiver; +/ 19766 /+ interface ICoreWebView2Environment; +/ 19767 /+ interface ICoreWebView2EnvironmentOptions; +/ 19768 /+ interface ICoreWebView2ExecuteScriptCompletedHandler; +/ 19769 /+ interface ICoreWebView2FocusChangedEventHandler; +/ 19770 /+ interface ICoreWebView2HistoryChangedEventHandler; +/ 19771 /+ interface ICoreWebView2HttpHeadersCollectionIterator; +/ 19772 /+ interface ICoreWebView2HttpRequestHeaders; +/ 19773 /+ interface ICoreWebView2HttpResponseHeaders; +/ 19774 /+ interface ICoreWebView2MoveFocusRequestedEventArgs; +/ 19775 /+ interface ICoreWebView2MoveFocusRequestedEventHandler; +/ 19776 /+ interface ICoreWebView2NavigationCompletedEventArgs; +/ 19777 /+ interface ICoreWebView2NavigationCompletedEventHandler; +/ 19778 /+ interface ICoreWebView2NavigationStartingEventArgs; +/ 19779 /+ interface ICoreWebView2NavigationStartingEventHandler; +/ 19780 /+ interface ICoreWebView2NewBrowserVersionAvailableEventHandler; +/ 19781 /+ interface ICoreWebView2NewWindowRequestedEventArgs; +/ 19782 /+ interface ICoreWebView2NewWindowRequestedEventHandler; +/ 19783 /+ interface ICoreWebView2PermissionRequestedEventArgs; +/ 19784 /+ interface ICoreWebView2PermissionRequestedEventHandler; +/ 19785 /+ interface ICoreWebView2ProcessFailedEventArgs; +/ 19786 /+ interface ICoreWebView2ProcessFailedEventHandler; +/ 19787 /+ interface ICoreWebView2ScriptDialogOpeningEventArgs; +/ 19788 /+ interface ICoreWebView2ScriptDialogOpeningEventHandler; +/ 19789 /+ interface ICoreWebView2Settings; +/ 19790 /+ interface ICoreWebView2SourceChangedEventArgs; +/ 19791 /+ interface ICoreWebView2SourceChangedEventHandler; +/ 19792 /+ interface ICoreWebView2WebMessageReceivedEventArgs; +/ 19793 /+ interface ICoreWebView2WebMessageReceivedEventHandler; +/ 19794 /+ interface ICoreWebView2WebResourceRequest; +/ 19795 /+ interface ICoreWebView2WebResourceRequestedEventArgs; +/ 19796 /+ interface ICoreWebView2WebResourceRequestedEventHandler; +/ 19797 /+ interface ICoreWebView2WebResourceResponse; +/ 19798 /+ interface ICoreWebView2WindowCloseRequestedEventHandler; +/ 19799 /+ interface ICoreWebView2WindowFeatures; +/ 19800 /+ interface ICoreWebView2ZoomFactorChangedEventHandler; +/ 19801 19802 // Enums and structs 19803 /// Image format used by the ICoreWebView2::CapturePreview method. 19804 /+[v1_enum]+/ 19805 enum /+ COREWEBVIEW2_CAPTURE_PREVIEW_IMAGE_FORMAT+/ 19806 { 19807 /// PNG image format. 19808 COREWEBVIEW2_CAPTURE_PREVIEW_IMAGE_FORMAT_PNG, 19809 /// JPEG image format. 19810 COREWEBVIEW2_CAPTURE_PREVIEW_IMAGE_FORMAT_JPEG, 19811 } 19812 alias int COREWEBVIEW2_CAPTURE_PREVIEW_IMAGE_FORMAT; 19813 19814 /// Kind of JavaScript dialog used in the 19815 /// ICoreWebView2ScriptDialogOpeningEventHandler interface. 19816 /+[v1_enum]+/ 19817 enum /+ COREWEBVIEW2_SCRIPT_DIALOG_KIND+/ 19818 { 19819 /// A dialog invoked via the window.alert JavaScript function. 19820 COREWEBVIEW2_SCRIPT_DIALOG_KIND_ALERT, 19821 /// A dialog invoked via the window.confirm JavaScript function. 19822 COREWEBVIEW2_SCRIPT_DIALOG_KIND_CONFIRM, 19823 /// A dialog invoked via the window.prompt JavaScript function. 19824 COREWEBVIEW2_SCRIPT_DIALOG_KIND_PROMPT, 19825 /// A dialog invoked via the beforeunload JavaScript event. 19826 COREWEBVIEW2_SCRIPT_DIALOG_KIND_BEFOREUNLOAD, 19827 } 19828 alias int COREWEBVIEW2_SCRIPT_DIALOG_KIND; 19829 19830 /// Kind of process failure used in the ICoreWebView2ProcessFailedEventHandler 19831 /// interface. 19832 /+[v1_enum]+/ 19833 enum /+ COREWEBVIEW2_PROCESS_FAILED_KIND+/ 19834 { 19835 /// Indicates the browser process terminated unexpectedly. 19836 /// The WebView automatically goes into the Closed state. 19837 /// The app has to recreate a new WebView to recover from this failure. 19838 COREWEBVIEW2_PROCESS_FAILED_KIND_BROWSER_PROCESS_EXITED, 19839 19840 /// Indicates the render process terminated unexpectedly. 19841 /// A new render process will be created automatically and navigated to an 19842 /// error page. 19843 /// The app can use Reload to try to recover from this failure. 19844 COREWEBVIEW2_PROCESS_FAILED_KIND_RENDER_PROCESS_EXITED, 19845 19846 /// Indicates the render process becomes unresponsive. 19847 // Note that this does not seem to work right now. 19848 // Does not fire for simple long running script case, the only related test 19849 // SitePerProcessBrowserTest::NoCommitTimeoutForInvisibleWebContents is 19850 // disabled. 19851 COREWEBVIEW2_PROCESS_FAILED_KIND_RENDER_PROCESS_UNRESPONSIVE, 19852 } 19853 alias int COREWEBVIEW2_PROCESS_FAILED_KIND; 19854 19855 /// The type of a permission request. 19856 /+[v1_enum]+/ 19857 enum /+ COREWEBVIEW2_PERMISSION_KIND+/ 19858 { 19859 /// Unknown permission. 19860 COREWEBVIEW2_PERMISSION_KIND_UNKNOWN_PERMISSION, 19861 19862 /// Permission to capture audio. 19863 COREWEBVIEW2_PERMISSION_KIND_MICROPHONE, 19864 19865 /// Permission to capture video. 19866 COREWEBVIEW2_PERMISSION_KIND_CAMERA, 19867 19868 /// Permission to access geolocation. 19869 COREWEBVIEW2_PERMISSION_KIND_GEOLOCATION, 19870 19871 /// Permission to send web notifications. 19872 /// This permission request is currently auto rejected and 19873 /// no event is fired for it. 19874 COREWEBVIEW2_PERMISSION_KIND_NOTIFICATIONS, 19875 19876 /// Permission to access generic sensor. 19877 /// Generic Sensor covering ambient-light-sensor, accelerometer, gyroscope 19878 /// and magnetometer. 19879 COREWEBVIEW2_PERMISSION_KIND_OTHER_SENSORS, 19880 19881 /// Permission to read system clipboard without a user gesture. 19882 COREWEBVIEW2_PERMISSION_KIND_CLIPBOARD_READ, 19883 } 19884 alias int COREWEBVIEW2_PERMISSION_KIND; 19885 19886 /// Response to a permission request. 19887 /+[v1_enum]+/ 19888 enum /+ COREWEBVIEW2_PERMISSION_STATE+/ 19889 { 19890 /// Use default browser behavior, which normally prompt users for decision. 19891 COREWEBVIEW2_PERMISSION_STATE_DEFAULT, 19892 19893 /// Grant the permission request. 19894 COREWEBVIEW2_PERMISSION_STATE_ALLOW, 19895 19896 /// Deny the permission request. 19897 COREWEBVIEW2_PERMISSION_STATE_DENY, 19898 } 19899 alias int COREWEBVIEW2_PERMISSION_STATE; 19900 19901 /// Error status values for web navigations. 19902 /+[v1_enum]+/ 19903 enum /+ COREWEBVIEW2_WEB_ERROR_STATUS+/ 19904 { 19905 /// An unknown error occurred. 19906 COREWEBVIEW2_WEB_ERROR_STATUS_UNKNOWN, 19907 19908 /// The SSL certificate common name does not match the web address. 19909 COREWEBVIEW2_WEB_ERROR_STATUS_CERTIFICATE_COMMON_NAME_IS_INCORRECT, 19910 19911 /// The SSL certificate has expired. 19912 COREWEBVIEW2_WEB_ERROR_STATUS_CERTIFICATE_EXPIRED, 19913 19914 /// The SSL client certificate contains errors. 19915 COREWEBVIEW2_WEB_ERROR_STATUS_CLIENT_CERTIFICATE_CONTAINS_ERRORS, 19916 19917 /// The SSL certificate has been revoked. 19918 COREWEBVIEW2_WEB_ERROR_STATUS_CERTIFICATE_REVOKED, 19919 19920 /// The SSL certificate is invalid -- this could mean the certificate did not 19921 /// match the public key pins for the host name, the certificate is signed by 19922 /// an untrusted authority or using a weak sign algorithm, the certificate 19923 /// claimed DNS names violate name constraints, the certificate contains a 19924 /// weak key, the certificate's validity period is too long, lack of 19925 /// revocation information or revocation mechanism, non-unique host name, lack 19926 /// of certificate transparency information, or the certificate is chained to 19927 /// a [legacy Symantec 19928 /// root](https://security.googleblog.com/2018/03/distrust-of-symantec-pki-immediate.html). 19929 COREWEBVIEW2_WEB_ERROR_STATUS_CERTIFICATE_IS_INVALID, 19930 19931 /// The host is unreachable. 19932 COREWEBVIEW2_WEB_ERROR_STATUS_SERVER_UNREACHABLE, 19933 19934 /// The connection has timed out. 19935 COREWEBVIEW2_WEB_ERROR_STATUS_TIMEOUT, 19936 19937 /// The server returned an invalid or unrecognized response. 19938 COREWEBVIEW2_WEB_ERROR_STATUS_ERROR_HTTP_INVALID_SERVER_RESPONSE, 19939 19940 /// The connection was aborted. 19941 COREWEBVIEW2_WEB_ERROR_STATUS_CONNECTION_ABORTED, 19942 19943 /// The connection was reset. 19944 COREWEBVIEW2_WEB_ERROR_STATUS_CONNECTION_RESET, 19945 19946 /// The Internet connection has been lost. 19947 COREWEBVIEW2_WEB_ERROR_STATUS_DISCONNECTED, 19948 19949 /// Cannot connect to destination. 19950 COREWEBVIEW2_WEB_ERROR_STATUS_CANNOT_CONNECT, 19951 19952 /// Could not resolve provided host name. 19953 COREWEBVIEW2_WEB_ERROR_STATUS_HOST_NAME_NOT_RESOLVED, 19954 19955 /// The operation was canceled. 19956 COREWEBVIEW2_WEB_ERROR_STATUS_OPERATION_CANCELED, 19957 19958 /// The request redirect failed. 19959 COREWEBVIEW2_WEB_ERROR_STATUS_REDIRECT_FAILED, 19960 19961 /// An unexpected error occurred. 19962 COREWEBVIEW2_WEB_ERROR_STATUS_UNEXPECTED_ERROR, 19963 } 19964 alias int COREWEBVIEW2_WEB_ERROR_STATUS; 19965 19966 /// Enum for web resource request contexts. 19967 /+[v1_enum]+/ 19968 enum /+ COREWEBVIEW2_WEB_RESOURCE_CONTEXT+/ 19969 { 19970 /// All resources 19971 COREWEBVIEW2_WEB_RESOURCE_CONTEXT_ALL, 19972 /// Document resources 19973 COREWEBVIEW2_WEB_RESOURCE_CONTEXT_DOCUMENT, 19974 /// CSS resources 19975 COREWEBVIEW2_WEB_RESOURCE_CONTEXT_STYLESHEET, 19976 /// Image resources 19977 COREWEBVIEW2_WEB_RESOURCE_CONTEXT_IMAGE, 19978 /// Other media resources such as videos 19979 COREWEBVIEW2_WEB_RESOURCE_CONTEXT_MEDIA, 19980 /// Font resources 19981 COREWEBVIEW2_WEB_RESOURCE_CONTEXT_FONT, 19982 /// Script resources 19983 COREWEBVIEW2_WEB_RESOURCE_CONTEXT_SCRIPT, 19984 /// XML HTTP requests 19985 COREWEBVIEW2_WEB_RESOURCE_CONTEXT_XML_HTTP_REQUEST, 19986 /// Fetch API communication 19987 COREWEBVIEW2_WEB_RESOURCE_CONTEXT_FETCH, 19988 /// TextTrack resources 19989 COREWEBVIEW2_WEB_RESOURCE_CONTEXT_TEXT_TRACK, 19990 /// EventSource API communication 19991 COREWEBVIEW2_WEB_RESOURCE_CONTEXT_EVENT_SOURCE, 19992 /// WebSocket API communication 19993 COREWEBVIEW2_WEB_RESOURCE_CONTEXT_WEBSOCKET, 19994 /// Web App Manifests 19995 COREWEBVIEW2_WEB_RESOURCE_CONTEXT_MANIFEST, 19996 /// Signed HTTP Exchanges 19997 COREWEBVIEW2_WEB_RESOURCE_CONTEXT_SIGNED_EXCHANGE, 19998 /// Ping requests 19999 COREWEBVIEW2_WEB_RESOURCE_CONTEXT_PING, 20000 /// CSP Violation Reports 20001 COREWEBVIEW2_WEB_RESOURCE_CONTEXT_CSP_VIOLATION_REPORT, 20002 /// Other resources 20003 COREWEBVIEW2_WEB_RESOURCE_CONTEXT_OTHER 20004 } 20005 alias int COREWEBVIEW2_WEB_RESOURCE_CONTEXT; 20006 20007 /// Reason for moving focus. 20008 /+[v1_enum]+/ 20009 enum /+ COREWEBVIEW2_MOVE_FOCUS_REASON+/ 20010 { 20011 /// Code setting focus into WebView. 20012 COREWEBVIEW2_MOVE_FOCUS_REASON_PROGRAMMATIC, 20013 20014 /// Moving focus due to Tab traversal forward. 20015 COREWEBVIEW2_MOVE_FOCUS_REASON_NEXT, 20016 20017 /// Moving focus due to Tab traversal backward. 20018 COREWEBVIEW2_MOVE_FOCUS_REASON_PREVIOUS, 20019 } 20020 alias int COREWEBVIEW2_MOVE_FOCUS_REASON; 20021 20022 /// The type of key event that triggered an AcceleratorKeyPressed event. 20023 /+[v1_enum]+/ 20024 enum /+ COREWEBVIEW2_KEY_EVENT_KIND+/ 20025 { 20026 /// Correspond to window message WM_KEYDOWN. 20027 COREWEBVIEW2_KEY_EVENT_KIND_KEY_DOWN, 20028 20029 /// Correspond to window message WM_KEYUP. 20030 COREWEBVIEW2_KEY_EVENT_KIND_KEY_UP, 20031 20032 /// Correspond to window message WM_SYSKEYDOWN. 20033 COREWEBVIEW2_KEY_EVENT_KIND_SYSTEM_KEY_DOWN, 20034 20035 /// Correspond to window message WM_SYSKEYUP. 20036 COREWEBVIEW2_KEY_EVENT_KIND_SYSTEM_KEY_UP, 20037 } 20038 alias int COREWEBVIEW2_KEY_EVENT_KIND; 20039 20040 /// A structure representing the information packed into the LPARAM given 20041 /// to a Win32 key event. See the documentation for WM_KEYDOWN for details 20042 /// at https://docs.microsoft.com/windows/win32/inputdev/wm-keydown 20043 struct COREWEBVIEW2_PHYSICAL_KEY_STATUS 20044 { 20045 /// The repeat count for the current message. 20046 UINT32 RepeatCount; 20047 /// The scan code. 20048 UINT32 ScanCode; 20049 /// Indicates whether the key is an extended key. 20050 BOOL IsExtendedKey; 20051 /// The context code. 20052 BOOL IsMenuKeyDown; 20053 /// The previous key state. 20054 BOOL WasKeyDown; 20055 /// The transition state. 20056 BOOL IsKeyReleased; 20057 } 20058 // End of enums and structs 20059 20060 /// WebView2 enables you to host web content using the 20061 /// latest Edge web browser technology. 20062 /// 20063 /// ## Navigation events 20064 /// The normal sequence of navigation events is NavigationStarting, 20065 /// SourceChanged, ContentLoading and then NavigationCompleted. 20066 /// The following events describe the state of WebView during each navigation: 20067 /// NavigationStarting: WebView is starting to navigate and the navigation will 20068 /// result in a network request. The host can disallow the request at this time. 20069 /// SourceChanged: The source of WebView is changed to a new URL. This may also 20070 /// be due to a navigation that doesn't cause a network request such as a fragment 20071 /// navigation. 20072 /// HistoryChanged: WebView's history has been updated as a result of 20073 /// the navigation. 20074 /// ContentLoading: WebView has started loading new content. 20075 /// NavigationCompleted: WebView has completed loading content on the new page. 20076 /// Developers can track navigations to each new document by the navigation ID. 20077 /// WebView's navigation ID changes every time there is a successful navigation 20078 /// to a new document. 20079 /// 20080 /// 20081 /// \dot 20082 /// digraph NavigationEvents { 20083 /// node [fontname=Roboto, shape=rectangle] 20084 /// edge [fontname=Roboto] 20085 /// 20086 /// NewDocument -> NavigationStarting; 20087 /// NavigationStarting -> SourceChanged -> ContentLoading [label="New Document"]; 20088 /// ContentLoading -> HistoryChanged; 20089 /// SameDocument -> SourceChanged; 20090 /// SourceChanged -> HistoryChanged [label="Same Document"]; 20091 /// HistoryChanged -> NavigationCompleted; 20092 /// NavigationStarting -> NavigationStarting [label="Redirect"]; 20093 /// NavigationStarting -> NavigationCompleted [label="Failure"]; 20094 /// } 20095 /// \enddot 20096 /// 20097 /// Note that this is for navigation events with the same NavigationId event 20098 /// arg. Navigations events with different NavigationId event args may overlap. 20099 /// For instance, if you start a navigation wait for its NavigationStarting 20100 /// event and then start another navigation you'll see the NavigationStarting 20101 /// for the first navigate followed by the NavigationStarting of the second 20102 /// navigate, followed by the NavigationCompleted for the first navigation and 20103 /// then all the rest of the appropriate navigation events for the second 20104 /// navigation. 20105 /// In error cases there may or may not be a ContentLoading event depending 20106 /// on whether the navigation is continued to an error page. 20107 /// In case of an HTTP redirect, there will be multiple NavigationStarting 20108 /// events in a row, with ones following the first will have their IsRedirect 20109 /// flag set, however navigation ID remains the same. Same document navigations 20110 /// do not result in NavigationStarting event and also do not increment the 20111 /// navigation ID. 20112 /// 20113 /// To monitor or cancel navigations inside subframes in the WebView, use 20114 /// FrameNavigationStarting. 20115 /// 20116 /// ## Process model 20117 /// WebView2 uses the same process model as the Edge web 20118 /// browser. There is one Edge browser process per specified user data directory 20119 /// in a user session that will serve any WebView2 calling 20120 /// process that specifies that user data directory. This means one Edge browser 20121 /// process may be serving multiple calling processes and one calling 20122 /// process may be using multiple Edge browser processes. 20123 /// 20124 /// \dot 20125 /// digraph ProcessModelNClientsNServers { 20126 /// node [fontname=Roboto, shape=rectangle]; 20127 /// edge [fontname=Roboto]; 20128 /// 20129 /// Host1 [label="Calling\nprocess 1"]; 20130 /// Host2 [label="Calling\nprocess 2"]; 20131 /// Browser1 [label="Edge processes\ngroup 1"]; 20132 /// Browser2 [label="Edge processes\ngroup 2"]; 20133 /// 20134 /// Host1 -> Browser1; 20135 /// Host1 -> Browser2; 20136 /// Host2 -> Browser2; 20137 /// } 20138 /// \enddot 20139 /// 20140 /// Associated with each browser process there will be some number of 20141 /// render processes. 20142 /// These are created as 20143 /// necessary to service potentially multiple frames in different WebViews. The 20144 /// number of render processes varies based on the site isolation browser 20145 /// feature and the number of distinct disconnected origins rendered in 20146 /// associated WebViews. 20147 /// 20148 /// \dot 20149 /// digraph ProcessModelClientServer { 20150 /// node [fontname=Roboto, shape=rectangle]; 20151 /// edge [fontname=Roboto]; 20152 /// graph [fontname=Roboto]; 20153 /// 20154 /// Host [label="Calling process"]; 20155 /// subgraph cluster_0 { 20156 /// labeljust = "l"; 20157 /// label = "Edge processes group"; 20158 /// Browser [label="Edge browser\nprocess"]; 20159 /// Render1 [label="Edge render\nprocess 1"]; 20160 /// Render2 [label="Edge render\nprocess 2"]; 20161 /// RenderN [label="Edge render\nprocess N"]; 20162 /// GPU [label="Edge GPU\nprocess"]; 20163 /// } 20164 /// 20165 /// Host -> Browser; 20166 /// Browser -> Render1; 20167 /// Browser -> Render2; 20168 /// Browser -> RenderN; 20169 /// Browser -> GPU; 20170 /// } 20171 /// \enddot 20172 /// 20173 /// You can react to crashes and hangs in these browser and render processes 20174 /// using the ProcessFailure event. 20175 /// 20176 /// You can safely shutdown associated browser and render processes using the 20177 /// Close method. 20178 /// 20179 /// ## Threading model 20180 /// The WebView2 must be created on a UI thread. Specifically a 20181 /// thread with a message pump. All callbacks will occur on that thread and 20182 /// calls into the WebView must be done on that thread. It is not safe to use 20183 /// the WebView from another thread. 20184 /// 20185 /// Callbacks including event handlers and completion handlers execute serially. 20186 /// That is, if you have an event handler running and begin a message loop no 20187 /// other event handlers or completion callbacks will begin executing 20188 /// reentrantly. 20189 /// 20190 /// ## Security 20191 /// Always check the Source property of the WebView before using ExecuteScript, 20192 /// PostWebMessageAsJson, PostWebMessageAsString, or any other method to send 20193 /// information into the WebView. The WebView may have navigated to another page 20194 /// via the end user interacting with the page or script in the page causing 20195 /// navigation. Similarly, be very careful with 20196 /// AddScriptToExecuteOnDocumentCreated. All future navigations will run this 20197 /// script and if it provides access to information intended only for a certain 20198 /// origin, any HTML document may have access. 20199 /// 20200 /// When examining the result of an ExecuteScript method call, a 20201 /// WebMessageReceived event, always check the Source of the sender, or any 20202 /// other mechanism of receiving information from an HTML document in a WebView 20203 /// validate the URI of the HTML document is what you expect. 20204 /// 20205 /// When constructing a message to send into a WebView, prefer using 20206 /// PostWebMessageAsJson and construct the JSON string parameter using a JSON 20207 /// library. This will prevent accidentally encoding information into a JSON string 20208 /// or script, and ensure no attacker controlled input can 20209 /// modify the rest of the JSON message or run arbitrary script. 20210 /// 20211 /// ## String types 20212 /// String out parameters are LPWSTR null terminated strings. The callee 20213 /// allocates the string using CoTaskMemAlloc. Ownership is transferred to the 20214 /// caller and it is up to the caller to free the memory using CoTaskMemFree. 20215 /// 20216 /// String in parameters are LPCWSTR null terminated strings. The caller ensures 20217 /// the string is valid for the duration of the synchronous function call. 20218 /// If the callee needs to retain that value to some point after the function 20219 /// call completes, the callee must allocate its own copy of the string value. 20220 /// 20221 /// ## URI and JSON parsing 20222 /// Various methods provide or accept URIs and JSON as strings. Please use your 20223 /// own preferred library for parsing and generating these strings. 20224 /// 20225 /// If WinRT is available for your app you can use `Windows.Data.Json.JsonObject` 20226 /// and `IJsonObjectStatics` to parse or produce JSON strings or `Windows.Foundation.Uri` 20227 /// and `IUriRuntimeClassFactory` to parse and produce URIs. Both of these work 20228 /// in Win32 apps. 20229 /// 20230 /// If you use IUri and CreateUri to parse URIs you may want to use the 20231 /// following URI creation flags to have CreateUri behavior more closely match 20232 /// the URI parsing in the WebView: 20233 /// `Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME | Uri_CREATE_NO_DECODE_EXTRA_INFO` 20234 /// 20235 /// ## Debugging 20236 /// Open DevTools with the normal shortcuts: `F12` or `Ctrl+Shift+I`. 20237 /// You can use the `--auto-open-devtools-for-tabs` command argument switch to 20238 /// have the DevTools window open immediately when first creating a WebView. See 20239 /// CreateCoreWebView2Controller documentation for how to provide additional command 20240 /// line arguments to the browser process. 20241 /// Check out the LoaderOverride registry key in the CreateCoreWebView2Controller 20242 /// documentation. 20243 /// 20244 /// ## Versioning 20245 /// After you've used a particular version of the SDK to build your app, your 20246 /// app may end up running with an older or newer version of installed browser 20247 /// binaries. Until version 1.0.0.0 of WebView2 there may be breaking changes 20248 /// during updates that will prevent your SDK from working with different 20249 /// versions of installed browser binaries. After version 1.0.0.0 different 20250 /// versions of the SDK can work with different versions of the installed 20251 /// browser by following these best practices: 20252 /// 20253 /// To account for breaking changes to the API be sure to check for failure when 20254 /// calling the DLL export CreateCoreWebView2Environment and when 20255 /// calling QueryInterface on any CoreWebView2 object. A return value of 20256 /// E_NOINTERFACE can indicate the SDK is not compatible with the Edge 20257 /// browser binaries. 20258 /// 20259 /// Checking for failure from QueryInterface will also account for cases where 20260 /// the SDK is newer than the version of the Edge browser and your app attempts 20261 /// to use an interface of which the Edge browser is unaware. 20262 /// 20263 /// When an interface is unavailable, you can consider disabling the associated 20264 /// feature if possible, or otherwise informing the end user they need to update 20265 /// their browser. 20266 const GUID IID_ICoreWebView2 = ICoreWebView2.iid; 20267 20268 interface ICoreWebView2 : IUnknown 20269 { 20270 static const GUID iid = { 0x76eceacb,0x0462,0x4d94,[ 0xac,0x83,0x42,0x3a,0x67,0x93,0x77,0x5e ] }; 20271 extern(Windows): 20272 /// The ICoreWebView2Settings object contains various modifiable settings for 20273 /// the running WebView. 20274 /+[ propget]+/ 20275 HRESULT get_Settings(/+[out, retval]+/ ICoreWebView2Settings * settings); 20276 20277 /// The URI of the current top level document. This value potentially 20278 /// changes as a part of the SourceChanged event firing for some cases 20279 /// such as navigating to a different site or fragment navigations. It will 20280 /// remain the same for other types of navigations such as page reloads or 20281 /// history.pushState with the same URL as the current page. 20282 /// 20283 /// \snippet ControlComponent.cpp SourceChanged 20284 /+[ propget]+/ 20285 HRESULT get_Source(/+[out, retval]+/ LPWSTR* uri); 20286 20287 /// Cause a navigation of the top level document to the specified URI. See 20288 /// the navigation events for more information. Note that this starts a 20289 /// navigation and the corresponding NavigationStarting event will fire 20290 /// sometime after this Navigate call completes. 20291 /// 20292 /// \snippet ControlComponent.cpp Navigate 20293 HRESULT Navigate(in LPCWSTR uri); 20294 20295 /// Initiates a navigation to htmlContent as source HTML of a new 20296 /// document. The htmlContent parameter may not be larger than 2 MB 20297 /// in total size. The origin of the new page will be about:blank. 20298 /// 20299 /// \snippet SettingsComponent.cpp NavigateToString 20300 HRESULT NavigateToString(in LPCWSTR htmlContent); 20301 20302 /// Add an event handler for the NavigationStarting event. 20303 /// NavigationStarting fires when the WebView main frame is 20304 /// requesting permission to navigate to a different URI. This will fire for 20305 /// redirects as well. 20306 /// 20307 /// Corresponding navigations can be blocked until the event handler returns. 20308 /// 20309 /// \snippet SettingsComponent.cpp NavigationStarting 20310 HRESULT add_NavigationStarting( 20311 /+[in]+/ ICoreWebView2NavigationStartingEventHandler eventHandler, 20312 /+[out]+/ EventRegistrationToken* token); 20313 /// Remove an event handler previously added with add_NavigationStarting. 20314 HRESULT remove_NavigationStarting( 20315 in EventRegistrationToken token); 20316 20317 /// Add an event handler for the ContentLoading event. 20318 /// ContentLoading fires before any content is loaded, including scripts added 20319 /// with AddScriptToExecuteOnDocumentCreated. 20320 /// ContentLoading will not fire if a same page navigation occurs 20321 /// (such as through fragment navigations or history.pushState navigations). 20322 /// This follows the NavigationStarting and SourceChanged events and 20323 /// precedes the HistoryChanged and NavigationCompleted events. 20324 HRESULT add_ContentLoading( 20325 /+[in]+/ ICoreWebView2ContentLoadingEventHandler eventHandler, 20326 /+[out]+/ EventRegistrationToken* token); 20327 /// Remove an event handler previously added with add_ContentLoading. 20328 HRESULT remove_ContentLoading( 20329 in EventRegistrationToken token); 20330 20331 /// Add an event handler for the SourceChanged event. 20332 /// SourceChanged fires when the Source property changes. 20333 /// SourceChanged fires for navigating to a different site or fragment 20334 /// navigations. 20335 /// It will not fire for other types of navigations such as page reloads or 20336 /// history.pushState with the same URL as the current page. 20337 /// SourceChanged fires before ContentLoading for navigation to a new document. 20338 /// 20339 /// \snippet ControlComponent.cpp SourceChanged 20340 HRESULT add_SourceChanged( 20341 /+[in]+/ ICoreWebView2SourceChangedEventHandler eventHandler, 20342 /+[out]+/ EventRegistrationToken* token); 20343 /// Remove an event handler previously added with add_SourceChanged. 20344 HRESULT remove_SourceChanged( 20345 in EventRegistrationToken token); 20346 20347 /// Add an event handler for the HistoryChanged event. 20348 /// HistoryChanged listens to the change of navigation history for the top 20349 /// level document. Use HistoryChanged to check if CanGoBack/CanGoForward 20350 /// value has changed. HistoryChanged also fires for using GoBack/GoForward. 20351 /// HistoryChanged fires after SourceChanged and ContentLoading. 20352 /// 20353 /// \snippet ControlComponent.cpp HistoryChanged 20354 HRESULT add_HistoryChanged( 20355 /+[in]+/ ICoreWebView2HistoryChangedEventHandler eventHandler, 20356 /+[out]+/ EventRegistrationToken* token); 20357 /// Remove an event handler previously added with add_HistoryChanged. 20358 HRESULT remove_HistoryChanged( 20359 in EventRegistrationToken token); 20360 20361 /// Add an event handler for the NavigationCompleted event. 20362 /// NavigationCompleted fires when the WebView has completely loaded 20363 /// (body.onload has fired) or loading stopped with error. 20364 /// 20365 /// \snippet ControlComponent.cpp NavigationCompleted 20366 HRESULT add_NavigationCompleted( 20367 /+[in]+/ ICoreWebView2NavigationCompletedEventHandler eventHandler, 20368 /+[out]+/ EventRegistrationToken* token); 20369 /// Remove an event handler previously added with add_NavigationCompleted. 20370 HRESULT remove_NavigationCompleted( 20371 in EventRegistrationToken token); 20372 20373 /// Add an event handler for the FrameNavigationStarting event. 20374 /// FrameNavigationStarting fires when a child frame in the WebView 20375 /// requests permission to navigate to a different URI. This will fire for 20376 /// redirects as well. 20377 /// 20378 /// Corresponding navigations can be blocked until the event handler returns. 20379 /// 20380 /// \snippet SettingsComponent.cpp FrameNavigationStarting 20381 HRESULT add_FrameNavigationStarting( 20382 /+[in]+/ ICoreWebView2NavigationStartingEventHandler eventHandler, 20383 /+[out]+/ EventRegistrationToken* token); 20384 /// Remove an event handler previously added with add_FrameNavigationStarting. 20385 HRESULT remove_FrameNavigationStarting( 20386 in EventRegistrationToken token); 20387 20388 /// Add an event handler for the FrameNavigationCompleted event. 20389 /// FrameNavigationCompleted fires when a child frame has completely 20390 /// loaded (body.onload has fired) or loading stopped with error. 20391 /// 20392 /// \snippet ControlComponent.cpp FrameNavigationCompleted 20393 HRESULT add_FrameNavigationCompleted( 20394 /+[in]+/ ICoreWebView2NavigationCompletedEventHandler eventHandler, 20395 /+[out]+/ EventRegistrationToken* token); 20396 /// Remove an event handler previously added with add_FrameNavigationCompleted. 20397 HRESULT remove_FrameNavigationCompleted( 20398 in EventRegistrationToken token); 20399 20400 /// Add an event handler for the ScriptDialogOpening event. 20401 /// ScriptDialogOpening fires when a JavaScript dialog (alert, confirm, 20402 /// prompt, or beforeunload) will show for the webview. This event only fires 20403 /// if the ICoreWebView2Settings::AreDefaultScriptDialogsEnabled property is 20404 /// set to false. The ScriptDialogOpening event can be used to suppress 20405 /// dialogs or replace default dialogs with custom dialogs. 20406 /// 20407 /// If a deferral is not taken on the event args, the subsequent scripts can be 20408 /// blocked until the event handler returns. If a deferral is taken, then the 20409 /// scripts are blocked until the deferral is completed. 20410 /// 20411 /// \snippet SettingsComponent.cpp ScriptDialogOpening 20412 HRESULT add_ScriptDialogOpening( 20413 /+[in]+/ ICoreWebView2ScriptDialogOpeningEventHandler eventHandler, 20414 /+[out]+/ EventRegistrationToken* token); 20415 /// Remove an event handler previously added with add_ScriptDialogOpening. 20416 HRESULT remove_ScriptDialogOpening( 20417 in EventRegistrationToken token); 20418 20419 /// Add an event handler for the PermissionRequested event. 20420 /// PermissionRequested fires when content in a WebView requests permission to 20421 /// access some privileged resources. 20422 /// 20423 /// If a deferral is not taken on the event args, the subsequent scripts can 20424 /// be blocked until the event handler returns. If a deferral is taken, then 20425 /// the scripts are blocked until the deferral is completed. 20426 /// 20427 /// \snippet SettingsComponent.cpp PermissionRequested 20428 HRESULT add_PermissionRequested( 20429 /+[in]+/ ICoreWebView2PermissionRequestedEventHandler eventHandler, 20430 /+[out]+/ EventRegistrationToken* token); 20431 /// Remove an event handler previously added with add_PermissionRequested. 20432 HRESULT remove_PermissionRequested( 20433 in EventRegistrationToken token); 20434 20435 /// Add an event handler for the ProcessFailed event. 20436 /// ProcessFailed fires when a WebView process is terminated unexpectedly or 20437 /// becomes unresponsive. 20438 /// 20439 /// \snippet ProcessComponent.cpp ProcessFailed 20440 HRESULT add_ProcessFailed( 20441 /+[in]+/ ICoreWebView2ProcessFailedEventHandler eventHandler, 20442 /+[out]+/ EventRegistrationToken* token); 20443 /// Remove an event handler previously added with add_ProcessFailed. 20444 HRESULT remove_ProcessFailed( 20445 in EventRegistrationToken token); 20446 20447 /// Add the provided JavaScript to a list of scripts that should be executed 20448 /// after the global object has been created, but before the HTML document has 20449 /// been parsed and before any other script included by the HTML document is 20450 /// executed. This method injects a script that runs on all top-level document 20451 /// and child frame page navigations. 20452 /// This method runs asynchronously, and you must wait for the completion 20453 /// handler to finish before the injected script is ready to run. When this 20454 /// method completes, the handler's `Invoke` method is called with the `id` of 20455 /// the injected script. `id` is a string. To remove the injected script, use 20456 /// `RemoveScriptToExecuteOnDocumentCreated`. 20457 /// 20458 /// Note that if an HTML document has sandboxing of some kind via 20459 /// [sandbox](https://developer.mozilla.org/docs/Web/HTML/Element/iframe#attr-sandbox) 20460 /// properties or the [Content-Security-Policy HTTP 20461 /// header](https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Security-Policy) 20462 /// this will affect the script run here. So, for example, if the 20463 /// 'allow-modals' keyword is not set then calls to the `alert` function will 20464 /// be ignored. 20465 /// 20466 /// \snippet ScriptComponent.cpp AddScriptToExecuteOnDocumentCreated 20467 HRESULT AddScriptToExecuteOnDocumentCreated( 20468 in LPCWSTR javaScript, 20469 /+[in]+/ ICoreWebView2AddScriptToExecuteOnDocumentCreatedCompletedHandler handler); 20470 20471 /// Remove the corresponding JavaScript added using `AddScriptToExecuteOnDocumentCreated` 20472 /// with the specified script id. 20473 HRESULT RemoveScriptToExecuteOnDocumentCreated(in LPCWSTR id); 20474 20475 /// Execute JavaScript code from the javascript parameter in the 20476 /// current top level document rendered in the WebView. This will execute 20477 /// asynchronously and when complete, if a handler is provided in the 20478 /// ExecuteScriptCompletedHandler parameter, its Invoke method will be 20479 /// called with the result of evaluating the provided JavaScript. The result 20480 /// value is a JSON encoded string. 20481 /// If the result is undefined, contains a reference cycle, or otherwise 20482 /// cannot be encoded into JSON, the JSON null value will be returned as the 20483 /// string 'null'. Note that a function that has no explicit return value 20484 /// returns undefined. 20485 /// If the executed script throws an unhandled exception, then the result is 20486 /// also 'null'. 20487 /// This method is applied asynchronously. If the method is called after 20488 /// NavigationStarting event during a navigation, the script will be executed 20489 /// in the new document when loading it, around the time ContentLoading is 20490 /// fired. ExecuteScript will work even if 20491 /// ICoreWebView2Settings::IsScriptEnabled is set to FALSE. 20492 /// 20493 /// \snippet ScriptComponent.cpp ExecuteScript 20494 HRESULT ExecuteScript( 20495 in LPCWSTR javaScript, 20496 /+[in]+/ ICoreWebView2ExecuteScriptCompletedHandler handler); 20497 20498 /// Capture an image of what WebView is displaying. Specify the 20499 /// format of the image with the imageFormat parameter. 20500 /// The resulting image binary data is written to the provided imageStream 20501 /// parameter. When CapturePreview finishes writing to the stream, the Invoke 20502 /// method on the provided handler parameter is called. 20503 /// 20504 /// \snippet FileComponent.cpp CapturePreview 20505 HRESULT CapturePreview( 20506 in COREWEBVIEW2_CAPTURE_PREVIEW_IMAGE_FORMAT imageFormat, 20507 in IStream* imageStream, 20508 /+[in]+/ ICoreWebView2CapturePreviewCompletedHandler handler); 20509 20510 /// Reload the current page. This is similar to navigating to the URI of 20511 /// current top level document including all navigation events firing and 20512 /// respecting any entries in the HTTP cache. But, the back/forward history 20513 /// will not be modified. 20514 HRESULT Reload(); 20515 20516 /// Post the specified webMessage to the top level document in this WebView. 20517 /// The top level document's window.chrome.webview's message event fires. 20518 /// JavaScript in that document may subscribe and unsubscribe to the event 20519 /// via the following: 20520 /// 20521 /// ``` 20522 /// window.chrome.webview.addEventListener('message', handler) 20523 /// window.chrome.webview.removeEventListener('message', handler) 20524 /// ``` 20525 /// 20526 /// The event args is an instance of `MessageEvent`. 20527 /// The ICoreWebView2Settings::IsWebMessageEnabled setting must be true or 20528 /// this method will fail with E_INVALIDARG. 20529 /// The event arg's data property is the webMessage string parameter parsed 20530 /// as a JSON string into a JavaScript object. 20531 /// The event arg's source property is a reference to the 20532 /// `window.chrome.webview` object. 20533 /// See add_WebMessageReceived for information on sending messages from the 20534 /// HTML document in the WebView to the host. 20535 /// This message is sent asynchronously. If a navigation occurs before the 20536 /// message is posted to the page, then the message will not be sent. 20537 /// 20538 /// \snippet ScenarioWebMessage.cpp WebMessageReceived 20539 HRESULT PostWebMessageAsJson(in LPCWSTR webMessageAsJson); 20540 20541 /// This is a helper for posting a message that is a simple string 20542 /// rather than a JSON string representation of a JavaScript object. This 20543 /// behaves in exactly the same manner as PostWebMessageAsJson but the 20544 /// `window.chrome.webview` message event arg's data property will be a string 20545 /// with the same value as webMessageAsString. Use this instead of 20546 /// PostWebMessageAsJson if you want to communicate via simple strings rather 20547 /// than JSON objects. 20548 HRESULT PostWebMessageAsString(in LPCWSTR webMessageAsString); 20549 20550 /// Add an event handler for the WebMessageReceived event. 20551 /// WebMessageReceived fires when the 20552 /// ICoreWebView2Settings::IsWebMessageEnabled setting is set and the top 20553 /// level document of the WebView calls `window.chrome.webview.postMessage`. 20554 /// The postMessage function is `void postMessage(object)` where 20555 /// object is any object supported by JSON conversion. 20556 /// 20557 /// \snippet ScenarioWebMessage.html chromeWebView 20558 /// 20559 /// When postMessage is called, the handler's Invoke method will be called 20560 /// with the postMessage's object parameter converted to a JSON string. 20561 /// 20562 /// \snippet ScenarioWebMessage.cpp WebMessageReceived 20563 HRESULT add_WebMessageReceived( 20564 /+[in]+/ ICoreWebView2WebMessageReceivedEventHandler handler, 20565 /+[out]+/ EventRegistrationToken* token); 20566 /// Remove an event handler previously added with add_WebMessageReceived. 20567 HRESULT remove_WebMessageReceived( 20568 in EventRegistrationToken token); 20569 20570 /// Call an asynchronous DevToolsProtocol method. See the 20571 /// [DevTools Protocol Viewer](https://aka.ms/DevToolsProtocolDocs) 20572 /// for a list and description of available methods. 20573 /// The methodName parameter is the full name of the method in the format 20574 /// `{domain}.{method}`. 20575 /// The parametersAsJson parameter is a JSON formatted string containing 20576 /// the parameters for the corresponding method. 20577 /// The handler's Invoke method will be called when the method asynchronously 20578 /// completes. Invoke will be called with the method's return object as a 20579 /// JSON string. 20580 /// 20581 /// \snippet ScriptComponent.cpp CallDevToolsProtocolMethod 20582 HRESULT CallDevToolsProtocolMethod( 20583 in LPCWSTR methodName, 20584 in LPCWSTR parametersAsJson, 20585 /+[in]+/ ICoreWebView2CallDevToolsProtocolMethodCompletedHandler handler); 20586 20587 /// The process id of the browser process that hosts the WebView. 20588 /+[ propget]+/ 20589 HRESULT get_BrowserProcessId(/+[out, retval]+/ UINT32* value); 20590 20591 /// Returns true if the WebView can navigate to a previous page in the 20592 /// navigation history. 20593 /// The HistoryChanged event will fire if CanGoBack changes value. 20594 /+[ propget]+/ 20595 HRESULT get_CanGoBack(/+[out, retval]+/ BOOL* canGoBack); 20596 /// Returns true if the WebView can navigate to a next page in the navigation 20597 /// history. 20598 /// The HistoryChanged event will fire if CanGoForward changes value. 20599 /+[ propget]+/ 20600 HRESULT get_CanGoForward(/+[out, retval]+/ BOOL* canGoForward); 20601 /// Navigates the WebView to the previous page in the navigation history. 20602 HRESULT GoBack(); 20603 /// Navigates the WebView to the next page in the navigation history. 20604 HRESULT GoForward(); 20605 20606 /// Get a DevTools Protocol event receiver that allows you to subscribe to 20607 /// a DevTools Protocol event. 20608 /// The eventName parameter is the full name of the event in the format 20609 /// `{domain}.{event}`. 20610 /// See the [DevTools Protocol Viewer](https://aka.ms/DevToolsProtocolDocs) 20611 /// for a list of DevTools Protocol events description, and event args. 20612 /// 20613 /// \snippet ScriptComponent.cpp DevToolsProtocolEventReceived 20614 HRESULT GetDevToolsProtocolEventReceiver( 20615 in LPCWSTR eventName, 20616 /+[out, retval]+/ ICoreWebView2DevToolsProtocolEventReceiver * receiver); 20617 20618 /// Stop all navigations and pending resource fetches. Does not stop 20619 /// scripts. 20620 HRESULT Stop(); 20621 20622 /// Add an event handler for the NewWindowRequested event. 20623 /// NewWindowRequested fires when content inside the WebView requests to open 20624 /// a new window, such as through window.open. The app can pass a target 20625 /// WebView that will be considered the opened window. 20626 /// 20627 /// Scripts resulted in the new window requested can be blocked until the 20628 /// event handler returns if a deferral is not taken on the event args. If a 20629 /// deferral is taken, then scripts are blocked until the deferral is 20630 /// completed. 20631 /// 20632 /// \snippet AppWindow.cpp NewWindowRequested 20633 HRESULT add_NewWindowRequested( 20634 /+[in]+/ ICoreWebView2NewWindowRequestedEventHandler eventHandler, 20635 /+[out]+/ EventRegistrationToken* token); 20636 /// Remove an event handler previously added with add_NewWindowRequested. 20637 HRESULT remove_NewWindowRequested( 20638 in EventRegistrationToken token); 20639 20640 /// Add an event handler for the DocumentTitleChanged event. 20641 /// DocumentTitleChanged fires when the DocumentTitle property of the WebView 20642 /// changes and may fire before or after the NavigationCompleted event. 20643 /// 20644 /// \snippet FileComponent.cpp DocumentTitleChanged 20645 HRESULT add_DocumentTitleChanged( 20646 /+[in]+/ ICoreWebView2DocumentTitleChangedEventHandler eventHandler, 20647 /+[out]+/ EventRegistrationToken* token); 20648 /// Remove an event handler previously added with add_DocumentTitleChanged. 20649 HRESULT remove_DocumentTitleChanged( 20650 in EventRegistrationToken token); 20651 20652 /// The title for the current top level document. 20653 /// If the document has no explicit title or is otherwise empty, 20654 /// a default that may or may not match the URI of the document will be used. 20655 /+[ propget]+/ 20656 HRESULT get_DocumentTitle(/+[out, retval]+/ LPWSTR* title); 20657 20658 /// Add the provided host object to script running in the WebView with the 20659 /// specified name. 20660 /// Host objects are exposed as host object proxies via 20661 /// `window.chrome.webview.hostObjects.<name>`. 20662 /// Host object proxies are promises and will resolve to an object 20663 /// representing the host object. 20664 /// The promise is rejected if the app has not added an object with the name. 20665 /// When JavaScript code access a property or method of the object, a promise 20666 /// is return, which will resolve to the value returned from the host for the 20667 /// property or method, or rejected in case of error such as there is no such 20668 /// property or method on the object or parameters are invalid. 20669 /// For example, when the application code does the following: 20670 /// 20671 /// ``` 20672 /// VARIANT object; 20673 /// object.vt = VT_DISPATCH; 20674 /// object.pdispVal = appObject; 20675 /// webview->AddHostObjectToScript(L"host_object", &host); 20676 /// ``` 20677 /// 20678 /// JavaScript code in the WebView will be able to access appObject as 20679 /// following and then access attributes and methods of appObject: 20680 /// 20681 /// ``` 20682 /// let app_object = await window.chrome.webview.hostObjects.host_object; 20683 /// let attr1 = await app_object.attr1; 20684 /// let result = await app_object.method1(parameters); 20685 /// ``` 20686 /// 20687 /// Note that while simple types, IDispatch and array are supported, generic 20688 /// IUnknown, VT_DECIMAL, or VT_RECORD variant is not supported. 20689 /// Remote JavaScript objects like callback functions are represented as 20690 /// an VT_DISPATCH VARIANT with the object implementing IDispatch. The 20691 /// JavaScript callback method may be invoked using DISPID_VALUE for the 20692 /// DISPID. 20693 /// Nested arrays are supported up to a depth of 3. 20694 /// Arrays of by reference types are not supported. 20695 /// VT_EMPTY and VT_NULL are mapped into JavaScript as null. In JavaScript 20696 /// null and undefined are mapped to VT_EMPTY. 20697 /// 20698 /// Additionally, all host objects are exposed as 20699 /// `window.chrome.webview.hostObjects.sync.<name>`. Here the host 20700 /// objects are exposed as synchronous host object proxies. These are not 20701 /// promises and calls to functions or property access synchronously block 20702 /// running script waiting to communicate cross process for the host code to 20703 /// run. Accordingly this can result in reliability issues and it is 20704 /// recommended that you use the promise based asynchronous 20705 /// `window.chrome.webview.hostObjects.<name>` API described above. 20706 /// 20707 /// Synchronous host object proxies and asynchronous host object proxies 20708 /// can both proxy the same host object. Remote changes made by one proxy 20709 /// will be reflected in any other proxy of that same host object whether 20710 /// the other proxies and synchronous or asynchronous. 20711 /// 20712 /// While JavaScript is blocked on a synchronous call to native code, that 20713 /// native code is unable to call back to JavaScript. Attempts to do so will 20714 /// fail with HRESULT_FROM_WIN32(ERROR_POSSIBLE_DEADLOCK). 20715 /// 20716 /// Host object proxies are JavaScript Proxy objects that intercept all 20717 /// property get, property set, and method invocations. Properties or methods 20718 /// that are a part of the Function or Object prototype are run locally. 20719 /// Additionally any property or method in the array 20720 /// `chrome.webview.hostObjects.options.forceLocalProperties` will also be 20721 /// run locally. This defaults to including optional methods that have 20722 /// meaning in JavaScript like `toJSON` and `Symbol.toPrimitive`. You can add 20723 /// more to this array as required. 20724 /// 20725 /// There's a method `chrome.webview.hostObjects.cleanupSome` that will best 20726 /// effort garbage collect host object proxies. 20727 /// 20728 /// Host object proxies additionally have the following methods which run 20729 /// locally: 20730 /// * applyHostFunction, getHostProperty, setHostProperty: Perform a 20731 /// method invocation, property get, or property set on the host object. 20732 /// You can use these to explicitly force a method or property to run 20733 /// remotely if there is a conflicting local method or property. For 20734 /// instance, `proxy.toString()` will run the local toString method on the 20735 /// proxy object. But ``proxy.applyHostFunction('toString')`` runs 20736 /// `toString` on the host proxied object instead. 20737 /// * getLocalProperty, setLocalProperty: Perform property get, or property 20738 /// set locally. You can use these methods to force getting or setting a 20739 /// property on the host object proxy itself rather than on the host 20740 /// object it represents. For instance, `proxy.unknownProperty` will get the 20741 /// property named `unknownProperty` from the host proxied object. But 20742 /// ``proxy.getLocalProperty('unknownProperty')`` will get the value of the property 20743 /// `unknownProperty` on the proxy object itself. 20744 /// * sync: Asynchronous host object proxies expose a sync method which 20745 /// returns a promise for a synchronous host object proxy for the same 20746 /// host object. For example, 20747 /// `chrome.webview.hostObjects.sample.methodCall()` returns an 20748 /// asynchronous host object proxy. You can use the `sync` method to 20749 /// obtain a synchronous host object proxy instead: 20750 /// `const syncProxy = await chrome.webview.hostObjects.sample.methodCall().sync()` 20751 /// * async: Synchronous host object proxies expose an async method which 20752 /// blocks and returns an asynchronous host object proxy for the same 20753 /// host object. For example, `chrome.webview.hostObjects.sync.sample.methodCall()` returns a 20754 /// synchronous host object proxy. Calling the `async` method on this blocks 20755 /// and then returns an asynchronous host object proxy for the same host object: 20756 /// `const asyncProxy = chrome.webview.hostObjects.sync.sample.methodCall().async()` 20757 /// * then: Asynchronous host object proxies have a then method. This 20758 /// allows them to be awaitable. `then` will return a promise that resolves 20759 /// with a representation of the host object. If the proxy represents a 20760 /// JavaScript literal then a copy of that is returned locally. If 20761 /// the proxy represents a function then a non-awaitable proxy is returned. 20762 /// If the proxy represents a JavaScript object with a mix of literal 20763 /// properties and function properties, then the a copy of the object is 20764 /// returned with some properties as host object proxies. 20765 /// 20766 /// All other property and method invocations (other than the above Remote 20767 /// object proxy methods, forceLocalProperties list, and properties on 20768 /// Function and Object prototypes) are run remotely. Asynchronous host 20769 /// object proxies return a promise representing asynchronous completion of 20770 /// remotely invoking the method, or getting the property. 20771 /// The promise resolves after the remote operations complete and 20772 /// the promises resolve to the resulting value of the operation. 20773 /// Synchronous host object proxies work similarly but block JavaScript 20774 /// execution and wait for the remote operation to complete. 20775 /// 20776 /// Setting a property on an asynchronous host object proxy works slightly 20777 /// differently. The set returns immediately and the return value is the value 20778 /// that will be set. This is a requirement of the JavaScript Proxy object. 20779 /// If you need to asynchronously wait for the property set to complete, use 20780 /// the setHostProperty method which returns a promise as described above. 20781 /// Synchronous object property set property synchronously blocks until the 20782 /// property is set. 20783 /// 20784 /// For example, suppose you have a COM object with the following interface 20785 /// 20786 /// \snippet HostObjectSample.idl AddHostObjectInterface 20787 /// 20788 /// We can add an instance of this interface into our JavaScript with 20789 /// `AddHostObjectToScript`. In this case we name it `sample`: 20790 /// 20791 /// \snippet ScenarioAddHostObject.cpp AddHostObjectToScript 20792 /// 20793 /// Then in the HTML document we can use this COM object via `chrome.webview.hostObjects.sample`: 20794 /// 20795 /// \snippet ScenarioAddHostObject.html HostObjectUsage 20796 /// Exposing host objects to script has security risk. Please follow 20797 /// [best practices](https://docs.microsoft.com/microsoft-edge/webview2/concepts/security). 20798 HRESULT AddHostObjectToScript(in LPCWSTR name, in VARIANT* object); 20799 20800 /// Remove the host object specified by the name so that it is no longer 20801 /// accessible from JavaScript code in the WebView. 20802 /// While new access attempts will be denied, if the object is already 20803 /// obtained by JavaScript code in the WebView, the JavaScript code will 20804 /// continue to have access to that object. 20805 /// Calling this method for a name that is already removed or never added will 20806 /// fail. 20807 HRESULT RemoveHostObjectFromScript(in LPCWSTR name); 20808 20809 /// Opens the DevTools window for the current document in the WebView. 20810 /// Does nothing if called when the DevTools window is already open. 20811 HRESULT OpenDevToolsWindow(); 20812 20813 /// Add an event handler for the ContainsFullScreenElementChanged event. 20814 /// ContainsFullScreenElementChanged fires when the ContainsFullScreenElement 20815 /// property changes. This means that an HTML element inside the WebView is 20816 /// entering fullscreen to the size of the WebView or leaving fullscreen. This 20817 /// event is useful when, for example, a video element requests to go 20818 /// fullscreen. The listener of ContainsFullScreenElementChanged can then 20819 /// resize the WebView in response. 20820 /// 20821 /// \snippet AppWindow.cpp ContainsFullScreenElementChanged 20822 HRESULT add_ContainsFullScreenElementChanged( 20823 /+[in]+/ ICoreWebView2ContainsFullScreenElementChangedEventHandler eventHandler, 20824 /+[out]+/ EventRegistrationToken* token); 20825 /// Remove an event handler previously added with 20826 /// add_ContainsFullScreenElementChanged. 20827 HRESULT remove_ContainsFullScreenElementChanged( 20828 in EventRegistrationToken token); 20829 20830 /// Indicates if the WebView contains a fullscreen HTML element. 20831 /+[ propget]+/ 20832 HRESULT get_ContainsFullScreenElement( 20833 /+[out, retval]+/ BOOL* containsFullScreenElement); 20834 20835 /// Add an event handler for the WebResourceRequested event. 20836 /// WebResourceRequested fires when the WebView is performing a URL request to 20837 /// a matching URL and resource context filter that was added with 20838 /// AddWebResourceRequestedFilter. At least one filter must be added for the 20839 /// event to fire. 20840 /// 20841 /// The web resource requested can be blocked until the event handler returns 20842 /// if a deferral is not taken on the event args. If a deferral is taken, then 20843 /// the web resource requested is blocked until the deferral is completed. 20844 /// 20845 /// \snippet SettingsComponent.cpp WebResourceRequested 20846 HRESULT add_WebResourceRequested( 20847 /+[in]+/ ICoreWebView2WebResourceRequestedEventHandler eventHandler, 20848 /+[out]+/ EventRegistrationToken* token); 20849 /// Remove an event handler previously added with add_WebResourceRequested. 20850 HRESULT remove_WebResourceRequested( 20851 in EventRegistrationToken token); 20852 20853 /// Adds a URI and resource context filter to the WebResourceRequested event. 20854 /// The URI parameter can be a wildcard string ('*': zero or more, '?': 20855 /// exactly one). nullptr is equivalent to L"". 20856 /// See COREWEBVIEW2_WEB_RESOURCE_CONTEXT enum for description of resource 20857 /// context filters. 20858 HRESULT AddWebResourceRequestedFilter( 20859 in LPCWSTR uri, 20860 in COREWEBVIEW2_WEB_RESOURCE_CONTEXT resourceContext); 20861 /// Removes a matching WebResource filter that was previously added for the 20862 /// WebResourceRequested event. If the same filter was added multiple times, 20863 /// then it will need to be removed as many times as it was added for the 20864 /// removal to be effective. Returns E_INVALIDARG for a filter that was never 20865 /// added. 20866 HRESULT RemoveWebResourceRequestedFilter( 20867 in LPCWSTR uri, 20868 in COREWEBVIEW2_WEB_RESOURCE_CONTEXT resourceContext); 20869 20870 /// Add an event handler for the WindowCloseRequested event. 20871 /// WindowCloseRequested fires when content inside the WebView requested to 20872 /// close the window, such as after window.close is called. The app should 20873 /// close the WebView and related app window if that makes sense to the app. 20874 /// 20875 /// \snippet AppWindow.cpp WindowCloseRequested 20876 HRESULT add_WindowCloseRequested( 20877 /+[in]+/ ICoreWebView2WindowCloseRequestedEventHandler eventHandler, 20878 /+[out]+/ EventRegistrationToken* token); 20879 /// Remove an event handler previously added with add_WindowCloseRequested. 20880 HRESULT remove_WindowCloseRequested( 20881 in EventRegistrationToken token); 20882 } 20883 20884 /// This interface is the owner of the CoreWebView2 object, and provides support 20885 /// for resizing, showing and hiding, focusing, and other functionality related 20886 /// to windowing and composition. The CoreWebView2Controller owns the CoreWebView2, 20887 /// and if all references to the CoreWebView2Controller go away, the WebView will 20888 /// be closed. 20889 const GUID IID_ICoreWebView2Controller = ICoreWebView2Controller.iid; 20890 20891 interface ICoreWebView2Controller : IUnknown 20892 { 20893 static const GUID iid = { 0x4d00c0d1,0x9434,0x4eb6,[ 0x80,0x78,0x86,0x97,0xa5,0x60,0x33,0x4f ] }; 20894 extern(Windows): 20895 /// The IsVisible property determines whether to show or hide the WebView. 20896 /// If IsVisible is set to false, the WebView will be transparent and will 20897 /// not be rendered. However, this will not affect the window containing 20898 /// the WebView (the HWND parameter that was passed to CreateCoreWebView2Controller). 20899 /// If you want that window to disappear too, call ShowWindow on it directly 20900 /// in addition to modifying the IsVisible property. 20901 /// WebView as a child window won't get window messages when the top window 20902 /// is minimized or restored. For performance reason, developer should set 20903 /// IsVisible property of the WebView to false when the app window is 20904 /// minimized and back to true when app window is restored. App window can do 20905 /// this by handling SC_MINIMIZE and SC_RESTORE command upon receiving 20906 /// WM_SYSCOMMAND message. 20907 /// 20908 /// \snippet ViewComponent.cpp ToggleIsVisible 20909 /+[ propget]+/ 20910 HRESULT get_IsVisible(/+[out, retval]+/ BOOL* isVisible); 20911 /// Set the IsVisible property. 20912 /// 20913 /// \snippet ViewComponent.cpp ToggleIsVisibleOnMinimize 20914 /+[ propput]+/ 20915 HRESULT put_IsVisible(in BOOL isVisible); 20916 20917 /// The WebView bounds. 20918 /// Bounds are relative to the parent HWND. The app has two ways it can 20919 /// position a WebView: 20920 /// 1. Create a child HWND that is the WebView parent HWND. Position this 20921 /// window where the WebView should be. In this case, use (0, 0) for the 20922 /// WebView's Bound's top left corner (the offset). 20923 /// 2. Use the app's top most window as the WebView parent HWND. Set the 20924 /// WebView's Bound's top left corner so that the WebView is positioned 20925 /// correctly in the app. 20926 /// The Bound's values are in the host's coordinate space. 20927 /+[ propget]+/ 20928 HRESULT get_Bounds(/+[out, retval]+/ RECT* bounds); 20929 /// Set the Bounds property. 20930 /// 20931 /// \snippet ViewComponent.cpp ResizeWebView 20932 /+[ propput]+/ 20933 HRESULT put_Bounds(in RECT bounds); 20934 20935 /// The zoom factor for the WebView. 20936 /// Note that changing zoom factor could cause `window.innerWidth/innerHeight` 20937 /// and page layout to change. 20938 /// A zoom factor that is applied by the host by calling ZoomFactor 20939 /// becomes the new default zoom for the WebView. This zoom factor applies 20940 /// across navigations and is the zoom factor WebView is returned to when the 20941 /// user presses ctrl+0. When the zoom factor is changed by the user 20942 /// (resulting in the app receiving ZoomFactorChanged), that zoom applies 20943 /// only for the current page. Any user applied zoom is only for the current 20944 /// page and is reset on a navigation. 20945 /// Specifying a zoomFactor less than or equal to 0 is not allowed. 20946 /// WebView also has an internal supported zoom factor range. When a specified 20947 /// zoom factor is out of that range, it will be normalized to be within the 20948 /// range, and a ZoomFactorChanged event will be fired for the real 20949 /// applied zoom factor. When this range normalization happens, the 20950 /// ZoomFactor property will report the zoom factor specified during the 20951 /// previous modification of the ZoomFactor property until the 20952 /// ZoomFactorChanged event is received after WebView applies the normalized 20953 /// zoom factor. 20954 /+[ propget]+/ 20955 HRESULT get_ZoomFactor(/+[out, retval]+/ double* zoomFactor); 20956 /// Set the ZoomFactor property. 20957 /+[ propput]+/ 20958 HRESULT put_ZoomFactor(in double zoomFactor); 20959 20960 /// Add an event handler for the ZoomFactorChanged event. 20961 /// ZoomFactorChanged fires when the ZoomFactor property of the WebView changes. 20962 /// The event could fire because the caller modified the ZoomFactor property, 20963 /// or due to the user manually modifying the zoom. When it is modified by the 20964 /// caller via the ZoomFactor property, the internal zoom factor is updated 20965 /// immediately and there will be no ZoomFactorChanged event. 20966 /// WebView associates the last used zoom factor for each site. Therefore, it 20967 /// is possible for the zoom factor to change when navigating to a different 20968 /// page. When the zoom factor changes due to this, the ZoomFactorChanged 20969 /// event fires right after the ContentLoading event. 20970 /// 20971 /// \snippet ViewComponent.cpp ZoomFactorChanged 20972 HRESULT add_ZoomFactorChanged( 20973 /+[in]+/ ICoreWebView2ZoomFactorChangedEventHandler eventHandler, 20974 /+[out]+/ EventRegistrationToken* token); 20975 /// Remove an event handler previously added with add_ZoomFactorChanged. 20976 HRESULT remove_ZoomFactorChanged( 20977 in EventRegistrationToken token); 20978 20979 /// Update Bounds and ZoomFactor properties at the same time. This operation 20980 /// is atomic from the host's perspective. After returning from this function, 20981 /// the Bounds and ZoomFactor properties will have both been updated if the 20982 /// function is successful, or neither will be updated if the function fails. 20983 /// If Bounds and ZoomFactor are both updated by the same scale (i.e. Bounds 20984 /// and ZoomFactor are both doubled), then the page will not see a change in 20985 /// window.innerWidth/innerHeight and the WebView will render the content at 20986 /// the new size and zoom without intermediate renderings. 20987 /// This function can also be used to update just one of ZoomFactor or Bounds 20988 /// by passing in the new value for one and the current value for the other. 20989 /// 20990 /// \snippet ViewComponent.cpp SetBoundsAndZoomFactor 20991 HRESULT SetBoundsAndZoomFactor(in RECT bounds, in double zoomFactor); 20992 20993 /// Move focus into WebView. WebView will get focus and focus will be set to 20994 /// correspondent element in the page hosted in the WebView. 20995 /// For Programmatic reason, focus is set to previously focused element or 20996 /// the default element if there is no previously focused element. 20997 /// For Next reason, focus is set to the first element. 20998 /// For Previous reason, focus is set to the last element. 20999 /// WebView can also got focus through user interaction like clicking into 21000 /// WebView or Tab into it. 21001 /// For tabbing, the app can call MoveFocus with Next or Previous to align 21002 /// with tab and shift+tab respectively when it decides the WebView is the 21003 /// next tabbable element. Or, the app can call IsDialogMessage as part of 21004 /// its message loop to allow the platform to auto handle tabbing. The 21005 /// platform will rotate through all windows with WS_TABSTOP. When the 21006 /// WebView gets focus from IsDialogMessage, it will internally put the focus 21007 /// on the first or last element for tab and shift+tab respectively. 21008 /// 21009 /// \snippet App.cpp MoveFocus0 21010 /// 21011 /// \snippet ControlComponent.cpp MoveFocus1 21012 /// 21013 /// \snippet ControlComponent.cpp MoveFocus2 21014 HRESULT MoveFocus(in COREWEBVIEW2_MOVE_FOCUS_REASON reason); 21015 21016 /// Add an event handler for the MoveFocusRequested event. 21017 /// MoveFocusRequested fires when user tries to tab out of the WebView. 21018 /// The WebView's focus has not changed when this event is fired. 21019 /// 21020 /// \snippet ControlComponent.cpp MoveFocusRequested 21021 HRESULT add_MoveFocusRequested( 21022 /+[in]+/ ICoreWebView2MoveFocusRequestedEventHandler eventHandler, 21023 /+[out]+/ EventRegistrationToken* token); 21024 /// Remove an event handler previously added with add_MoveFocusRequested. 21025 HRESULT remove_MoveFocusRequested( 21026 in EventRegistrationToken token); 21027 21028 /// Add an event handler for the GotFocus event. 21029 /// GotFocus fires when WebView got focus. 21030 HRESULT add_GotFocus( 21031 /+[in]+/ ICoreWebView2FocusChangedEventHandler eventHandler, 21032 /+[out]+/ EventRegistrationToken* token); 21033 /// Remove an event handler previously added with add_GotFocus. 21034 HRESULT remove_GotFocus( 21035 in EventRegistrationToken token); 21036 21037 /// Add an event handler for the LostFocus event. 21038 /// LostFocus fires when WebView lost focus. 21039 /// In the case where MoveFocusRequested event is fired, the focus is still 21040 /// on WebView when MoveFocusRequested event fires. LostFocus only fires 21041 /// afterwards when app's code or default action of MoveFocusRequested event 21042 /// set focus away from WebView. 21043 HRESULT add_LostFocus( 21044 /+[in]+/ ICoreWebView2FocusChangedEventHandler eventHandler, 21045 /+[out]+/ EventRegistrationToken* token); 21046 /// Remove an event handler previously added with add_LostFocus. 21047 HRESULT remove_LostFocus( 21048 in EventRegistrationToken token); 21049 21050 /// Add an event handler for the AcceleratorKeyPressed event. 21051 /// AcceleratorKeyPressed fires when an accelerator key or key combo is 21052 /// pressed or released while the WebView is focused. A key is considered an 21053 /// accelerator if either: 21054 /// 1. Ctrl or Alt is currently being held, or 21055 /// 2. the pressed key does not map to a character. 21056 /// A few specific keys are never considered accelerators, such as Shift. 21057 /// The Escape key is always considered an accelerator. 21058 /// 21059 /// Autorepeated key events caused by holding the key down will also fire this 21060 /// event. You can filter these out by checking the event args' 21061 /// KeyEventLParam or PhysicalKeyStatus. 21062 /// 21063 /// In windowed mode, this event handler is called synchronously. Until you 21064 /// call Handled() on the event args or the event handler returns, the browser 21065 /// process will be blocked and outgoing cross-process COM calls will fail 21066 /// with RPC_E_CANTCALLOUT_ININPUTSYNCCALL. All CoreWebView2 API methods will 21067 /// work, however. 21068 /// 21069 /// In windowless mode, the event handler is called asynchronously. Further 21070 /// input will not reach the browser until the event handler returns or 21071 /// Handled() is called, but the browser process itself will not be blocked, 21072 /// and outgoing COM calls will work normally. 21073 /// 21074 /// It is recommended to call Handled(TRUE) as early as you can know that you want 21075 /// to handle the accelerator key. 21076 /// 21077 /// \snippet ControlComponent.cpp AcceleratorKeyPressed 21078 HRESULT add_AcceleratorKeyPressed( 21079 /+[in]+/ ICoreWebView2AcceleratorKeyPressedEventHandler eventHandler, 21080 /+[out]+/ EventRegistrationToken* token); 21081 /// Remove an event handler previously added with add_AcceleratorKeyPressed. 21082 HRESULT remove_AcceleratorKeyPressed( 21083 in EventRegistrationToken token); 21084 21085 /// The parent window provided by the app that this WebView is using to 21086 /// render content. This API initially returns the window passed into 21087 /// CreateCoreWebView2Controller. 21088 /+[ propget]+/ 21089 HRESULT get_ParentWindow(/+[out, retval]+/ HWND* parentWindow); 21090 21091 /// Set the parent window for the WebView. This will cause the WebView to 21092 /// reparent its window to the newly provided window. 21093 /+[ propput]+/ 21094 HRESULT put_ParentWindow(in HWND parentWindow); 21095 21096 /// This is a notification separate from Bounds that tells WebView its 21097 /// parent (or any ancestor) HWND moved. This is needed for accessibility and 21098 /// certain dialogs in WebView to work correctly. 21099 /// \snippet ViewComponent.cpp NotifyParentWindowPositionChanged 21100 HRESULT NotifyParentWindowPositionChanged(); 21101 21102 /// Closes the WebView and cleans up the underlying browser instance. 21103 /// Cleaning up the browser instance will release the resources powering the WebView. 21104 /// The browser instance will be shut down if there are no other WebViews using it. 21105 /// 21106 /// After calling Close, all method calls will fail and event handlers 21107 /// will stop firing. Specifically, the WebView will release its references 21108 /// to its event handlers when Close is called. 21109 /// 21110 /// Close is implicitly called when the CoreWebView2Controller loses its final 21111 /// reference and is destructed. But it is best practice to explicitly call 21112 /// Close to avoid any accidental cycle of references between the WebView 21113 /// and the app code. Specifically, if you capture a reference to the WebView 21114 /// in an event handler you will create a reference cycle between the WebView 21115 /// and the event handler. Calling Close will break this cycle by releasing 21116 /// all event handlers. But to avoid this situation it is best practice both 21117 /// to explicitly call Close on the WebView and to not capture a reference to 21118 /// the WebView to ensure the WebView can be cleaned up correctly. 21119 /// 21120 /// \snippet AppWindow.cpp Close 21121 HRESULT Close(); 21122 21123 /// Gets the CoreWebView2 associated with this CoreWebView2Controller. 21124 /+[ propget]+/ 21125 HRESULT get_CoreWebView2(/+[out, retval]+/ ICoreWebView2 * coreWebView2); 21126 } 21127 21128 /// This interface is used to complete deferrals on event args that 21129 /// support getting deferrals via their GetDeferral method. 21130 const GUID IID_ICoreWebView2Deferral = ICoreWebView2Deferral.iid; 21131 21132 interface ICoreWebView2Deferral : IUnknown 21133 { 21134 static const GUID iid = { 0xc10e7f7b,0xb585,0x46f0,[ 0xa6,0x23,0x8b,0xef,0xbf,0x3e,0x4e,0xe0 ] }; 21135 extern(Windows): 21136 /// Completes the associated deferred event. Complete should only be 21137 /// called once for each deferral taken. 21138 HRESULT Complete(); 21139 } 21140 21141 /// Defines properties that enable, disable, or modify WebView 21142 /// features. Setting changes made after NavigationStarting event will not 21143 /// apply until the next top level navigation. 21144 const GUID IID_ICoreWebView2Settings = ICoreWebView2Settings.iid; 21145 21146 interface ICoreWebView2Settings : IUnknown 21147 { 21148 static const GUID iid = { 0xe562e4f0,0xd7fa,0x43ac,[ 0x8d,0x71,0xc0,0x51,0x50,0x49,0x9f,0x00 ] }; 21149 extern(Windows): 21150 /// Controls if JavaScript execution is enabled in all future 21151 /// navigations in the WebView. This only affects scripts in the document; 21152 /// scripts injected with ExecuteScript will run even if script is disabled. 21153 /// It is true by default. 21154 /// 21155 /// \snippet SettingsComponent.cpp IsScriptEnabled 21156 /+[ propget]+/ 21157 HRESULT get_IsScriptEnabled( 21158 /+[out, retval]+/ BOOL* isScriptEnabled); 21159 /// Set the IsScriptEnabled property. 21160 /+[ propput]+/ 21161 HRESULT put_IsScriptEnabled(in BOOL isScriptEnabled); 21162 21163 /// The IsWebMessageEnabled property is used when loading a new 21164 /// HTML document. If set to true, communication from the host to the 21165 /// WebView's top level HTML document is allowed via PostWebMessageAsJson, 21166 /// PostWebMessageAsString, and window.chrome.webview's message event 21167 /// (see PostWebMessageAsJson documentation for details). 21168 /// Communication from the WebView's top level HTML document to the host is 21169 /// allowed via window.chrome.webview's postMessage function and 21170 /// add_WebMessageReceived method (see add_WebMessageReceived documentation 21171 /// for details). 21172 /// If set to false, then communication is disallowed. 21173 /// PostWebMessageAsJson and PostWebMessageAsString will 21174 /// fail with E_ACCESSDENIED and window.chrome.webview.postMessage will fail 21175 /// by throwing an instance of an Error object. 21176 /// It is true by default. 21177 /// 21178 /// \snippet ScenarioWebMessage.cpp IsWebMessageEnabled 21179 /+[ propget]+/ 21180 HRESULT get_IsWebMessageEnabled( 21181 /+[out, retval]+/ BOOL* isWebMessageEnabled); 21182 /// Set the IsWebMessageEnabled property. 21183 /+[ propput]+/ 21184 HRESULT put_IsWebMessageEnabled(in BOOL isWebMessageEnabled); 21185 21186 /// AreDefaultScriptDialogsEnabled is used when loading a new HTML document. 21187 /// If set to false, then WebView won't render the default JavaScript dialog 21188 /// box (Specifically those shown by the JavaScript alert, confirm, prompt 21189 /// functions and beforeunload event). Instead, if an event handler is set via 21190 /// add_ScriptDialogOpening, WebView will send an event that will contain all 21191 /// of the information for the dialog and allow the host app to show its own 21192 /// custom UI. It is true by default. 21193 /+[ propget]+/ 21194 HRESULT get_AreDefaultScriptDialogsEnabled( 21195 /+[out, retval]+/ BOOL* areDefaultScriptDialogsEnabled); 21196 /// Set the AreDefaultScriptDialogsEnabled property. 21197 /+[ propput]+/ 21198 HRESULT put_AreDefaultScriptDialogsEnabled( 21199 in BOOL areDefaultScriptDialogsEnabled); 21200 21201 /// IsStatusBarEnabled controls whether the status bar will be displayed. The 21202 /// status bar is usually displayed in the lower left of the WebView and shows 21203 /// things such as the URI of a link when the user hovers over it and other 21204 /// information. It is true by default. 21205 /+[ propget]+/ 21206 HRESULT get_IsStatusBarEnabled(/+[out, retval]+/ BOOL* isStatusBarEnabled); 21207 /// Set the IsStatusBarEnabled property. 21208 /+[ propput]+/ 21209 HRESULT put_IsStatusBarEnabled(in BOOL isStatusBarEnabled); 21210 21211 /// AreDevToolsEnabled controls whether the user is able to use the context 21212 /// menu or keyboard shortcuts to open the DevTools window. 21213 /// It is true by default. 21214 /+[ propget]+/ 21215 HRESULT get_AreDevToolsEnabled(/+[out, retval]+/ BOOL* areDevToolsEnabled); 21216 /// Set the AreDevToolsEnabled property. 21217 /+[ propput]+/ 21218 HRESULT put_AreDevToolsEnabled(in BOOL areDevToolsEnabled); 21219 21220 /// The AreDefaultContextMenusEnabled property is used to prevent 21221 /// default context menus from being shown to user in WebView. 21222 /// It is true by default. 21223 /// 21224 /// \snippet SettingsComponent.cpp DisableContextMenu 21225 /+[ propget]+/ 21226 HRESULT get_AreDefaultContextMenusEnabled(/+[out, retval]+/ BOOL* enabled); 21227 /// Set the AreDefaultContextMenusEnabled property. 21228 /+[ propput]+/ 21229 HRESULT put_AreDefaultContextMenusEnabled(in BOOL enabled); 21230 21231 /// The AreHostObjectsAllowed property is used to control whether 21232 /// host objects are accessible from the page in WebView. 21233 /// It is true by default. 21234 /// 21235 /// \snippet SettingsComponent.cpp HostObjectsAccess 21236 /+[ propget]+/ 21237 HRESULT get_AreHostObjectsAllowed(/+[out, retval]+/ BOOL* allowed); 21238 /// Set the AreHostObjectsAllowed property. 21239 /+[ propput]+/ 21240 HRESULT put_AreHostObjectsAllowed(in BOOL allowed); 21241 21242 /// The IsZoomControlEnabled property is used to prevent the user from 21243 /// impacting the zoom of the WebView. It is true by default. 21244 /// When disabled, user will not be able to zoom using ctrl+/- or 21245 /// ctrl+mouse wheel, but the zoom can be set via ZoomFactor API. 21246 /// 21247 /// \snippet SettingsComponent.cpp DisableZoomControl 21248 /+[ propget]+/ 21249 HRESULT get_IsZoomControlEnabled(/+[out, retval]+/ BOOL* enabled); 21250 /// Set the IsZoomControlEnabled property. 21251 /+[ propput]+/ 21252 HRESULT put_IsZoomControlEnabled(in BOOL enabled); 21253 21254 /// The IsBuiltInErrorPageEnabled property is used to disable built in error 21255 /// page for navigation failure and render process failure. It is true by 21256 /// default. 21257 /// When disabled, blank page will be shown when related error happens. 21258 /// 21259 /// \snippet SettingsComponent.cpp BuiltInErrorPageEnabled 21260 /+[ propget]+/ 21261 HRESULT get_IsBuiltInErrorPageEnabled(/+[out, retval]+/ BOOL* enabled); 21262 /// Set the IsBuiltInErrorPageEnabled property. 21263 /+[ propput]+/ 21264 HRESULT put_IsBuiltInErrorPageEnabled(in BOOL enabled); 21265 } 21266 21267 /// Event args for the ProcessFailed event. 21268 const GUID IID_ICoreWebView2ProcessFailedEventArgs = ICoreWebView2ProcessFailedEventArgs.iid; 21269 21270 interface ICoreWebView2ProcessFailedEventArgs : IUnknown 21271 { 21272 static const GUID iid = { 0x8155a9a4,0x1474,0x4a86,[ 0x8c,0xae,0x15,0x1b,0x0f,0xa6,0xb8,0xca ] }; 21273 extern(Windows): 21274 /// The kind of process failure that has occurred. 21275 /+[ propget]+/ 21276 HRESULT get_ProcessFailedKind( 21277 /+[out, retval]+/ COREWEBVIEW2_PROCESS_FAILED_KIND* processFailedKind); 21278 } 21279 21280 /// The caller implements this interface to receive ProcessFailed events. 21281 const GUID IID_ICoreWebView2ProcessFailedEventHandler = ICoreWebView2ProcessFailedEventHandler.iid; 21282 21283 interface ICoreWebView2ProcessFailedEventHandler : IUnknown 21284 { 21285 static const GUID iid = { 0x79e0aea4,0x990b,0x42d9,[ 0xaa,0x1d,0x0f,0xcc,0x2e,0x5b,0xc7,0xf1 ] }; 21286 extern(Windows): 21287 /// Called to provide the implementer with the event args for the 21288 /// corresponding event. 21289 HRESULT Invoke( 21290 /+[in]+/ ICoreWebView2 sender, 21291 /+[in]+/ ICoreWebView2ProcessFailedEventArgs args); 21292 } 21293 21294 /// The caller implements this interface to receive ZoomFactorChanged 21295 /// events. Use the ICoreWebView2Controller.ZoomFactor property to get the 21296 /// modified zoom factor. 21297 const GUID IID_ICoreWebView2ZoomFactorChangedEventHandler = ICoreWebView2ZoomFactorChangedEventHandler.iid; 21298 21299 interface ICoreWebView2ZoomFactorChangedEventHandler : IUnknown 21300 { 21301 static const GUID iid = { 0xb52d71d6,0xc4df,0x4543,[ 0xa9,0x0c,0x64,0xa3,0xe6,0x0f,0x38,0xcb ] }; 21302 extern(Windows): 21303 /// Called to provide the implementer with the event args for the 21304 /// corresponding event. There are no event args and the args 21305 /// parameter will be null. 21306 HRESULT Invoke(/+[in]+/ ICoreWebView2Controller sender, /+[in]+/ IUnknown args); 21307 } 21308 21309 /// Iterator for a collection of HTTP headers. See ICoreWebView2HttpRequestHeaders 21310 /// and ICoreWebView2HttpResponseHeaders. 21311 /// 21312 /// \snippet ScenarioWebViewEventMonitor.cpp HttpRequestHeaderIterator 21313 const GUID IID_ICoreWebView2HttpHeadersCollectionIterator = ICoreWebView2HttpHeadersCollectionIterator.iid; 21314 21315 interface ICoreWebView2HttpHeadersCollectionIterator : IUnknown 21316 { 21317 static const GUID iid = { 0x0702fc30,0xf43b,0x47bb,[ 0xab,0x52,0xa4,0x2c,0xb5,0x52,0xad,0x9f ] }; 21318 extern(Windows): 21319 /// Get the name and value of the current HTTP header of the iterator. This 21320 /// method will fail if the last call to MoveNext set hasNext to FALSE. 21321 HRESULT GetCurrentHeader(/+[out]+/ LPWSTR* name, 21322 /+[out]+/ LPWSTR* value); 21323 21324 /// True when the iterator hasn't run out of headers. If the collection over 21325 /// which the iterator is iterating is empty or if the iterator has gone past 21326 /// the end of the collection then this is false. 21327 /+[ propget]+/ 21328 HRESULT get_HasCurrentHeader(/+[out, retval]+/ BOOL* hasCurrent); 21329 21330 /// Move the iterator to the next HTTP header in the collection. The hasNext 21331 /// parameter will be set to FALSE if there are no more HTTP headers. After 21332 /// this occurs the GetCurrentHeader method will fail if called. 21333 HRESULT MoveNext(/+[out, retval]+/ BOOL* hasNext); 21334 } 21335 21336 /// HTTP request headers. Used to inspect the HTTP request on 21337 /// WebResourceRequested event and NavigationStarting event. 21338 /// Note, you can modify the HTTP request headers from a WebResourceRequested event, 21339 /// but not from a NavigationStarting event. 21340 const GUID IID_ICoreWebView2HttpRequestHeaders = ICoreWebView2HttpRequestHeaders.iid; 21341 21342 interface ICoreWebView2HttpRequestHeaders : IUnknown 21343 { 21344 static const GUID iid = { 0xe86cac0e,0x5523,0x465c,[ 0xb5,0x36,0x8f,0xb9,0xfc,0x8c,0x8c,0x60 ] }; 21345 extern(Windows): 21346 /// Gets the header value matching the name. 21347 HRESULT GetHeader(in LPCWSTR name, 21348 /+[out, retval]+/ LPWSTR* value); 21349 /// Gets the header value matching the name via an iterator. 21350 HRESULT GetHeaders(in LPCWSTR name, 21351 /+[out, retval]+/ ICoreWebView2HttpHeadersCollectionIterator * iterator); 21352 /// Checks whether the headers contain an entry matching the header name. 21353 HRESULT Contains(in LPCWSTR name, 21354 /+[out, retval]+/ BOOL* contains); 21355 /// Adds or updates header that matches the name. 21356 HRESULT SetHeader(in LPCWSTR name, in LPCWSTR value); 21357 /// Removes header that matches the name. 21358 HRESULT RemoveHeader(in LPCWSTR name); 21359 /// Gets an iterator over the collection of request headers. 21360 HRESULT GetIterator( 21361 /+[out, retval]+/ ICoreWebView2HttpHeadersCollectionIterator * iterator); 21362 } 21363 21364 /// HTTP response headers. Used to construct a WebResourceResponse for the 21365 /// WebResourceRequested event. 21366 const GUID IID_ICoreWebView2HttpResponseHeaders = ICoreWebView2HttpResponseHeaders.iid; 21367 21368 interface ICoreWebView2HttpResponseHeaders : IUnknown 21369 { 21370 static const GUID iid = { 0x03c5ff5a,0x9b45,0x4a88,[ 0x88,0x1c,0x89,0xa9,0xf3,0x28,0x61,0x9c ] }; 21371 extern(Windows): 21372 /// Appends header line with name and value. 21373 HRESULT AppendHeader(in LPCWSTR name, in LPCWSTR value); 21374 /// Checks whether the headers contain entries matching the header name. 21375 HRESULT Contains(in LPCWSTR name, 21376 /+[out, retval]+/ BOOL* contains); 21377 /// Gets the first header value in the collection matching the name. 21378 HRESULT GetHeader(in LPCWSTR name, 21379 /+[out, retval]+/ LPWSTR* value); 21380 /// Gets the header values matching the name. 21381 HRESULT GetHeaders(in LPCWSTR name, 21382 /+[out, retval]+/ ICoreWebView2HttpHeadersCollectionIterator * iterator); 21383 /// Gets an iterator over the collection of entire response headers. 21384 HRESULT GetIterator( 21385 /+[out, retval]+/ ICoreWebView2HttpHeadersCollectionIterator * iterator); 21386 } 21387 21388 /// An HTTP request used with the WebResourceRequested event. 21389 const GUID IID_ICoreWebView2WebResourceRequest = ICoreWebView2WebResourceRequest.iid; 21390 21391 interface ICoreWebView2WebResourceRequest : IUnknown 21392 { 21393 static const GUID iid = { 0x97055cd4,0x512c,0x4264,[ 0x8b,0x5f,0xe3,0xf4,0x46,0xce,0xa6,0xa5 ] }; 21394 extern(Windows): 21395 /// The request URI. 21396 /+[ propget]+/ 21397 HRESULT get_Uri(/+[out, retval]+/ LPWSTR* uri); 21398 /// Set the Uri property. 21399 /+[ propput]+/ 21400 HRESULT put_Uri(in LPCWSTR uri); 21401 21402 /// The HTTP request method. 21403 /+[ propget]+/ 21404 HRESULT get_Method(/+[out, retval]+/ LPWSTR* method); 21405 /// Set the Method property. 21406 /+[ propput]+/ 21407 HRESULT put_Method(in LPCWSTR method); 21408 21409 /// The HTTP request message body as stream. POST data would be here. 21410 /// If a stream is set, which will override the message body, the stream must 21411 /// have all the content data available by the time this 21412 /// response's WebResourceRequested event deferral is completed. Stream 21413 /// should be agile or be created from a background STA to prevent performance 21414 /// impact to the UI thread. Null means no content data. IStream semantics 21415 /// apply (return S_OK to Read calls until all data is exhausted). 21416 /+[ propget]+/ 21417 HRESULT get_Content(/+[out, retval]+/ IStream** content); 21418 /// Set the Content property. 21419 /+[ propput]+/ 21420 HRESULT put_Content(in IStream* content); 21421 21422 /// The mutable HTTP request headers 21423 /+[ propget]+/ 21424 HRESULT get_Headers(/+[out, retval]+/ ICoreWebView2HttpRequestHeaders * headers); 21425 } 21426 21427 /// An HTTP response used with the WebResourceRequested event. 21428 const GUID IID_ICoreWebView2WebResourceResponse = ICoreWebView2WebResourceResponse.iid; 21429 21430 interface ICoreWebView2WebResourceResponse : IUnknown 21431 { 21432 static const GUID iid = { 0xaafcc94f,0xfa27,0x48fd,[ 0x97,0xdf,0x83,0x0e,0xf7,0x5a,0xae,0xc9 ] }; 21433 extern(Windows): 21434 /// HTTP response content as stream. Stream must have all the 21435 /// content data available by the time this response's WebResourceRequested 21436 /// event deferral is completed. Stream should be agile or be created from 21437 /// a background thread to prevent performance impact to the UI thread. 21438 /// Null means no content data. IStream semantics 21439 /// apply (return S_OK to Read calls until all data is exhausted). 21440 /+[ propget]+/ 21441 HRESULT get_Content(/+[out, retval]+/ IStream** content); 21442 /// Set the Content property. 21443 /+[ propput]+/ 21444 HRESULT put_Content(in IStream* content); 21445 21446 /// Overridden HTTP response headers. 21447 /+[ propget]+/ 21448 HRESULT get_Headers(/+[out, retval]+/ ICoreWebView2HttpResponseHeaders * headers); 21449 21450 /// The HTTP response status code. 21451 /+[ propget]+/ 21452 HRESULT get_StatusCode(/+[out, retval]+/ int* statusCode); 21453 /// Set the StatusCode property. 21454 /+[ propput]+/ 21455 HRESULT put_StatusCode(in int statusCode); 21456 21457 /// The HTTP response reason phrase. 21458 /+[ propget]+/ 21459 HRESULT get_ReasonPhrase(/+[out, retval]+/ LPWSTR* reasonPhrase); 21460 /// Set the ReasonPhrase property. 21461 /+[ propput]+/ 21462 HRESULT put_ReasonPhrase(in LPCWSTR reasonPhrase); 21463 } 21464 21465 /// Event args for the NavigationStarting event. 21466 const GUID IID_ICoreWebView2NavigationStartingEventArgs = ICoreWebView2NavigationStartingEventArgs.iid; 21467 21468 interface ICoreWebView2NavigationStartingEventArgs : IUnknown 21469 { 21470 static const GUID iid = { 0x5b495469,0xe119,0x438a,[ 0x9b,0x18,0x76,0x04,0xf2,0x5f,0x2e,0x49 ] }; 21471 extern(Windows): 21472 /// The uri of the requested navigation. 21473 /+[ propget]+/ 21474 HRESULT get_Uri(/+[out, retval]+/ LPWSTR* uri); 21475 21476 /// True when the navigation was initiated through a user gesture as opposed 21477 /// to programmatic navigation. 21478 /+[ propget]+/ 21479 HRESULT get_IsUserInitiated(/+[out, retval]+/ BOOL* isUserInitiated); 21480 21481 /// True when the navigation is redirected. 21482 /+[ propget]+/ 21483 HRESULT get_IsRedirected(/+[out, retval]+/ BOOL* isRedirected); 21484 21485 /// The HTTP request headers for the navigation. 21486 /// Note, you cannot modify the HTTP request headers in a NavigationStarting event. 21487 /+[ propget]+/ 21488 HRESULT get_RequestHeaders(/+[out, retval]+/ ICoreWebView2HttpRequestHeaders * requestHeaders); 21489 21490 /// The host may set this flag to cancel the navigation. 21491 /// If set, it will be as if the navigation never happened and the current 21492 /// page's content will be intact. For performance reasons, GET HTTP requests 21493 /// may happen, while the host is responding. This means cookies can be set 21494 /// and used part of a request for the navigation. 21495 /// Cancellation for navigation to about:blank or frame navigation to srcdoc 21496 /// is not supported. Such attempts will be ignored. 21497 /+[ propget]+/ 21498 HRESULT get_Cancel(/+[out, retval]+/ BOOL* cancel); 21499 /// Set the Cancel property. 21500 /+[ propput]+/ 21501 HRESULT put_Cancel(in BOOL cancel); 21502 21503 /// The ID of the navigation. 21504 /+[ propget]+/ 21505 HRESULT get_NavigationId(/+[out, retval]+/ UINT64* navigationId); 21506 } 21507 21508 /// The caller implements this interface to receive the NavigationStarting 21509 /// event. 21510 const GUID IID_ICoreWebView2NavigationStartingEventHandler = ICoreWebView2NavigationStartingEventHandler.iid; 21511 21512 interface ICoreWebView2NavigationStartingEventHandler : IUnknown 21513 { 21514 static const GUID iid = { 0x9adbe429,0xf36d,0x432b,[ 0x9d,0xdc,0xf8,0x88,0x1f,0xbd,0x76,0xe3 ] }; 21515 extern(Windows): 21516 /// Called to provide the implementer with the event args for the 21517 /// corresponding event. 21518 HRESULT Invoke( 21519 /+[in]+/ ICoreWebView2 sender, 21520 /+[in]+/ ICoreWebView2NavigationStartingEventArgs args); 21521 } 21522 21523 /// Event args for the ContentLoading event. 21524 const GUID IID_ICoreWebView2ContentLoadingEventArgs = ICoreWebView2ContentLoadingEventArgs.iid; 21525 21526 interface ICoreWebView2ContentLoadingEventArgs : IUnknown 21527 { 21528 static const GUID iid = { 0x0c8a1275,0x9b6b,0x4901,[ 0x87,0xad,0x70,0xdf,0x25,0xba,0xfa,0x6e ] }; 21529 extern(Windows): 21530 /// True if the loaded content is an error page. 21531 /+[ propget]+/ 21532 HRESULT get_IsErrorPage(/+[out, retval]+/ BOOL* isErrorPage); 21533 21534 /// The ID of the navigation. 21535 /+[ propget]+/ 21536 HRESULT get_NavigationId(/+[out, retval]+/ UINT64* navigationId); 21537 } 21538 21539 /// The caller implements this interface to receive the ContentLoading event. 21540 const GUID IID_ICoreWebView2ContentLoadingEventHandler = ICoreWebView2ContentLoadingEventHandler.iid; 21541 21542 interface ICoreWebView2ContentLoadingEventHandler : IUnknown 21543 { 21544 static const GUID iid = { 0x364471e7,0xf2be,0x4910,[ 0xbd,0xba,0xd7,0x20,0x77,0xd5,0x1c,0x4b ] }; 21545 extern(Windows): 21546 /// Called to provide the implementer with the event args for the 21547 /// corresponding event. 21548 HRESULT Invoke(/+[in]+/ ICoreWebView2 sender, /+[in]+/ ICoreWebView2ContentLoadingEventArgs args); 21549 } 21550 21551 /// Event args for the SourceChanged event. 21552 const GUID IID_ICoreWebView2SourceChangedEventArgs = ICoreWebView2SourceChangedEventArgs.iid; 21553 21554 interface ICoreWebView2SourceChangedEventArgs : IUnknown 21555 { 21556 static const GUID iid = { 0x31e0e545,0x1dba,0x4266,[ 0x89,0x14,0xf6,0x38,0x48,0xa1,0xf7,0xd7 ] }; 21557 extern(Windows): 21558 /// True if the page being navigated to is a new document. 21559 /+[ propget]+/ 21560 HRESULT get_IsNewDocument(/+[out, retval]+/ BOOL* isNewDocument); 21561 } 21562 21563 /// The caller implements this interface to receive the SourceChanged event. 21564 const GUID IID_ICoreWebView2SourceChangedEventHandler = ICoreWebView2SourceChangedEventHandler.iid; 21565 21566 interface ICoreWebView2SourceChangedEventHandler : IUnknown 21567 { 21568 static const GUID iid = { 0x3c067f9f,0x5388,0x4772,[ 0x8b,0x48,0x79,0xf7,0xef,0x1a,0xb3,0x7c ] }; 21569 extern(Windows): 21570 /// Called to provide the implementer with the event args for the 21571 /// corresponding event. 21572 HRESULT Invoke(/+[in]+/ ICoreWebView2 sender, /+[in]+/ ICoreWebView2SourceChangedEventArgs args); 21573 } 21574 21575 /// The caller implements this interface to receive the HistoryChanged event. 21576 const GUID IID_ICoreWebView2HistoryChangedEventHandler = ICoreWebView2HistoryChangedEventHandler.iid; 21577 21578 interface ICoreWebView2HistoryChangedEventHandler : IUnknown 21579 { 21580 static const GUID iid = { 0xc79a420c,0xefd9,0x4058,[ 0x92,0x95,0x3e,0x8b,0x4b,0xca,0xb6,0x45 ] }; 21581 extern(Windows): 21582 /// There are no event args and the args parameter will be null. 21583 HRESULT Invoke(/+[in]+/ ICoreWebView2 sender, /+[in]+/ IUnknown args); 21584 } 21585 21586 /// Event args for the ScriptDialogOpening event. 21587 const GUID IID_ICoreWebView2ScriptDialogOpeningEventArgs = ICoreWebView2ScriptDialogOpeningEventArgs.iid; 21588 21589 interface ICoreWebView2ScriptDialogOpeningEventArgs : IUnknown 21590 { 21591 static const GUID iid = { 0x7390bb70,0xabe0,0x4843,[ 0x95,0x29,0xf1,0x43,0xb3,0x1b,0x03,0xd6 ] }; 21592 extern(Windows): 21593 /// The URI of the page that requested the dialog box. 21594 /+[ propget]+/ 21595 HRESULT get_Uri(/+[out, retval]+/ LPWSTR* uri); 21596 21597 /// The kind of JavaScript dialog box. Accept, confirm, prompt, or 21598 /// beforeunload. 21599 /+[ propget]+/ 21600 HRESULT get_Kind(/+[out, retval]+/ COREWEBVIEW2_SCRIPT_DIALOG_KIND* kind); 21601 21602 /// The message of the dialog box. From JavaScript this is the first parameter 21603 /// passed to alert, confirm, and prompt and is empty for beforeunload. 21604 /+[ propget]+/ 21605 HRESULT get_Message(/+[out, retval]+/ LPWSTR* message); 21606 21607 /// The host may call this to respond with OK to confirm, prompt, and 21608 /// beforeunload dialogs or not call this method to indicate cancel. From 21609 /// JavaScript, this means that the confirm and beforeunload function returns 21610 /// true if Accept is called. And for the prompt function it returns the value 21611 /// of ResultText if Accept is called and returns false otherwise. 21612 HRESULT Accept(); 21613 21614 /// The second parameter passed to the JavaScript prompt dialog. This is the 21615 /// default value to use for the result of the prompt JavaScript function. 21616 /+[ propget]+/ 21617 HRESULT get_DefaultText(/+[out, retval]+/ LPWSTR* defaultText); 21618 21619 /// The return value from the JavaScript prompt function if Accept is called. 21620 /// This is ignored for dialog kinds other than prompt. If Accept is not 21621 /// called this value is ignored and false is returned from prompt. 21622 /+[ propget]+/ 21623 HRESULT get_ResultText(/+[out, retval]+/ LPWSTR* resultText); 21624 /// Set the ResultText property. 21625 /+[ propput]+/ 21626 HRESULT put_ResultText(in LPCWSTR resultText); 21627 21628 /// GetDeferral can be called to return an ICoreWebView2Deferral object. 21629 /// You can use this to complete the event at a later time. 21630 HRESULT GetDeferral(/+[out, retval]+/ ICoreWebView2Deferral * deferral); 21631 } 21632 21633 /// The caller implements this interface to receive the ScriptDialogOpening 21634 /// event. 21635 const GUID IID_ICoreWebView2ScriptDialogOpeningEventHandler = ICoreWebView2ScriptDialogOpeningEventHandler.iid; 21636 21637 interface ICoreWebView2ScriptDialogOpeningEventHandler : IUnknown 21638 { 21639 static const GUID iid = { 0xef381bf9,0xafa8,0x4e37,[ 0x91,0xc4,0x8a,0xc4,0x85,0x24,0xbd,0xfb ] }; 21640 extern(Windows): 21641 /// Called to provide the implementer with the event args for the 21642 /// corresponding event. 21643 HRESULT Invoke( 21644 /+[in]+/ ICoreWebView2 sender, 21645 /+[in]+/ ICoreWebView2ScriptDialogOpeningEventArgs args); 21646 } 21647 21648 /// Event args for the NavigationCompleted event. 21649 const GUID IID_ICoreWebView2NavigationCompletedEventArgs = ICoreWebView2NavigationCompletedEventArgs.iid; 21650 21651 interface ICoreWebView2NavigationCompletedEventArgs : IUnknown 21652 { 21653 static const GUID iid = { 0x30d68b7d,0x20d9,0x4752,[ 0xa9,0xca,0xec,0x84,0x48,0xfb,0xb5,0xc1 ] }; 21654 extern(Windows): 21655 /// True when the navigation is successful. This 21656 /// is false for a navigation that ended up in an error page (failures due to 21657 /// no network, DNS lookup failure, HTTP server responds with 4xx), but could 21658 /// also be false for additional scenarios such as window.stop() called on 21659 /// navigated page. 21660 /+[ propget]+/ 21661 HRESULT get_IsSuccess(/+[out, retval]+/ BOOL* isSuccess); 21662 21663 /// The error code if the navigation failed. 21664 /+[ propget]+/ 21665 HRESULT get_WebErrorStatus(/+[out, retval]+/ COREWEBVIEW2_WEB_ERROR_STATUS* 21666 webErrorStatus); 21667 21668 /// The ID of the navigation. 21669 /+[ propget]+/ 21670 HRESULT get_NavigationId(/+[out, retval]+/ UINT64* navigationId); 21671 } 21672 21673 /// The caller implements this interface to receive the NavigationCompleted 21674 /// event. 21675 const GUID IID_ICoreWebView2NavigationCompletedEventHandler = ICoreWebView2NavigationCompletedEventHandler.iid; 21676 21677 interface ICoreWebView2NavigationCompletedEventHandler : IUnknown 21678 { 21679 static const GUID iid = { 0xd33a35bf,0x1c49,0x4f98,[ 0x93,0xab,0x00,0x6e,0x05,0x33,0xfe,0x1c ] }; 21680 extern(Windows): 21681 /// Called to provide the implementer with the event args for the 21682 /// corresponding event. 21683 HRESULT Invoke( 21684 /+[in]+/ ICoreWebView2 sender, 21685 /+[in]+/ ICoreWebView2NavigationCompletedEventArgs args); 21686 } 21687 21688 /// Event args for the PermissionRequested event. 21689 const GUID IID_ICoreWebView2PermissionRequestedEventArgs = ICoreWebView2PermissionRequestedEventArgs.iid; 21690 21691 interface ICoreWebView2PermissionRequestedEventArgs : IUnknown 21692 { 21693 static const GUID iid = { 0x973ae2ef,0xff18,0x4894,[ 0x8f,0xb2,0x3c,0x75,0x8f,0x04,0x68,0x10 ] }; 21694 extern(Windows): 21695 /// The origin of the web content that requests the permission. 21696 /+[ propget]+/ 21697 HRESULT get_Uri(/+[out, retval]+/ LPWSTR* uri); 21698 21699 /// The type of the permission that is requested. 21700 /+[ propget]+/ 21701 HRESULT get_PermissionKind(/+[out, retval]+/ COREWEBVIEW2_PERMISSION_KIND* permissionKind); 21702 21703 /// True when the permission request was initiated through a user gesture. 21704 /// Note that being initiated through a user gesture doesn't mean that user 21705 /// intended to access the associated resource. 21706 /+[ propget]+/ 21707 HRESULT get_IsUserInitiated(/+[out, retval]+/ BOOL* isUserInitiated); 21708 21709 /// The status of a permission request, i.e. whether the request is granted. 21710 /// Default value is COREWEBVIEW2_PERMISSION_STATE_DEFAULT. 21711 /+[ propget]+/ 21712 HRESULT get_State(/+[out, retval]+/ COREWEBVIEW2_PERMISSION_STATE* state); 21713 /// Set the State property. 21714 /+[ propput]+/ 21715 HRESULT put_State(in COREWEBVIEW2_PERMISSION_STATE state); 21716 21717 /// GetDeferral can be called to return an ICoreWebView2Deferral object. 21718 /// Developer can use the deferral object to make the permission decision 21719 /// at a later time. 21720 HRESULT GetDeferral(/+[out, retval]+/ ICoreWebView2Deferral * deferral); 21721 } 21722 21723 /// The caller implements this interface to receive the PermissionRequested 21724 /// event. 21725 const GUID IID_ICoreWebView2PermissionRequestedEventHandler = ICoreWebView2PermissionRequestedEventHandler.iid; 21726 21727 interface ICoreWebView2PermissionRequestedEventHandler : IUnknown 21728 { 21729 static const GUID iid = { 0x15e1c6a3,0xc72a,0x4df3,[ 0x91,0xd7,0xd0,0x97,0xfb,0xec,0x6b,0xfd ] }; 21730 extern(Windows): 21731 /// Called to provide the implementer with the event args for the 21732 /// corresponding event. 21733 HRESULT Invoke( 21734 /+[in]+/ ICoreWebView2 sender, 21735 /+[in]+/ ICoreWebView2PermissionRequestedEventArgs args); 21736 } 21737 21738 /// The caller implements this interface to receive the result of the 21739 /// AddScriptToExecuteOnDocumentCreated method. 21740 const GUID IID_ICoreWebView2AddScriptToExecuteOnDocumentCreatedCompletedHandler = ICoreWebView2AddScriptToExecuteOnDocumentCreatedCompletedHandler.iid; 21741 21742 interface ICoreWebView2AddScriptToExecuteOnDocumentCreatedCompletedHandler : IUnknown 21743 { 21744 static const GUID iid = { 0xb99369f3,0x9b11,0x47b5,[ 0xbc,0x6f,0x8e,0x78,0x95,0xfc,0xea,0x17 ] }; 21745 extern(Windows): 21746 /// Called to provide the implementer with the completion status and result 21747 /// of the corresponding asynchronous method call. 21748 HRESULT Invoke(in HRESULT errorCode, in LPCWSTR id); 21749 } 21750 21751 /// The caller implements this interface to receive the result of the 21752 /// ExecuteScript method. 21753 const GUID IID_ICoreWebView2ExecuteScriptCompletedHandler = ICoreWebView2ExecuteScriptCompletedHandler.iid; 21754 21755 interface ICoreWebView2ExecuteScriptCompletedHandler : IUnknown 21756 { 21757 static const GUID iid = { 0x49511172,0xcc67,0x4bca,[ 0x99,0x23,0x13,0x71,0x12,0xf4,0xc4,0xcc ] }; 21758 extern(Windows): 21759 /// Called to provide the implementer with the completion status and result 21760 /// of the corresponding asynchronous method call. 21761 HRESULT Invoke(in HRESULT errorCode, in LPCWSTR resultObjectAsJson); 21762 } 21763 21764 /// Event args for the WebResourceRequested event. 21765 const GUID IID_ICoreWebView2WebResourceRequestedEventArgs = ICoreWebView2WebResourceRequestedEventArgs.iid; 21766 21767 interface ICoreWebView2WebResourceRequestedEventArgs : IUnknown 21768 { 21769 static const GUID iid = { 0x453e667f,0x12c7,0x49d4,[ 0xbe,0x6d,0xdd,0xbe,0x79,0x56,0xf5,0x7a ] }; 21770 extern(Windows): 21771 /// The Web resource request. The request object may be missing some headers 21772 /// that are added by network stack later on. 21773 /+[ propget]+/ 21774 HRESULT get_Request(/+[out, retval]+/ ICoreWebView2WebResourceRequest * request); 21775 21776 /// A placeholder for the web resource response object. If this object is set, the 21777 /// web resource request will be completed with this response. 21778 /+[ propget]+/ 21779 HRESULT get_Response(/+[out, retval]+/ ICoreWebView2WebResourceResponse * response); 21780 /// Set the Response property. An empty Web resource response object can be 21781 /// created with CreateWebResourceResponse and then modified to construct the response. 21782 /+[ propput]+/ 21783 HRESULT put_Response(/+[in]+/ ICoreWebView2WebResourceResponse response); 21784 21785 /// Obtain an ICoreWebView2Deferral object and put the event into a deferred state. 21786 /// You can use the ICoreWebView2Deferral object to complete the request at a 21787 /// later time. 21788 HRESULT GetDeferral(/+[out, retval]+/ ICoreWebView2Deferral * deferral); 21789 21790 /// The web resource request context. 21791 /+[ propget]+/ 21792 HRESULT get_ResourceContext(/+[out, retval]+/ COREWEBVIEW2_WEB_RESOURCE_CONTEXT* context); 21793 } 21794 21795 /// Fires when a URL request (through network, file etc.) is made in the webview 21796 /// for a Web resource matching resource context filter and URL specified in 21797 /// AddWebResourceRequestedFilter. 21798 /// The host can view and modify the request or provide a response in a similar 21799 /// pattern to HTTP, in which case the request immediately completed. 21800 /// This may not contain any request headers that are added by the network 21801 /// stack, such as Authorization headers. 21802 const GUID IID_ICoreWebView2WebResourceRequestedEventHandler = ICoreWebView2WebResourceRequestedEventHandler.iid; 21803 21804 interface ICoreWebView2WebResourceRequestedEventHandler : IUnknown 21805 { 21806 static const GUID iid = { 0xab00b74c,0x15f1,0x4646,[ 0x80,0xe8,0xe7,0x63,0x41,0xd2,0x5d,0x71 ] }; 21807 extern(Windows): 21808 /// Called to provide the implementer with the event args for the 21809 /// corresponding event. 21810 HRESULT Invoke( 21811 /+[in]+/ ICoreWebView2 sender, 21812 /+[in]+/ ICoreWebView2WebResourceRequestedEventArgs args); 21813 } 21814 21815 /// The caller implements this method to receive the result of the 21816 /// CapturePreview method. The result is written to the stream provided in 21817 /// the CapturePreview method call. 21818 const GUID IID_ICoreWebView2CapturePreviewCompletedHandler = ICoreWebView2CapturePreviewCompletedHandler.iid; 21819 21820 interface ICoreWebView2CapturePreviewCompletedHandler : IUnknown 21821 { 21822 static const GUID iid = { 0x697e05e9,0x3d8f,0x45fa,[ 0x96,0xf4,0x8f,0xfe,0x1e,0xde,0xda,0xf5 ] }; 21823 extern(Windows): 21824 /// Called to provide the implementer with the completion status 21825 /// of the corresponding asynchronous method call. 21826 HRESULT Invoke(in HRESULT errorCode); 21827 } 21828 21829 /// The caller implements this method to receive the GotFocus and LostFocus 21830 /// events. There are no event args for this event. 21831 const GUID IID_ICoreWebView2FocusChangedEventHandler = ICoreWebView2FocusChangedEventHandler.iid; 21832 21833 interface ICoreWebView2FocusChangedEventHandler : IUnknown 21834 { 21835 static const GUID iid = { 0x05ea24bd,0x6452,0x4926,[ 0x90,0x14,0x4b,0x82,0xb4,0x98,0x13,0x5d ] }; 21836 extern(Windows): 21837 /// Called to provide the implementer with the event args for the 21838 /// corresponding event. There are no event args and the args 21839 /// parameter will be null. 21840 HRESULT Invoke( 21841 /+[in]+/ ICoreWebView2Controller sender, 21842 /+[in]+/ IUnknown args); 21843 } 21844 21845 /// Event args for the MoveFocusRequested event. 21846 const GUID IID_ICoreWebView2MoveFocusRequestedEventArgs = ICoreWebView2MoveFocusRequestedEventArgs.iid; 21847 21848 interface ICoreWebView2MoveFocusRequestedEventArgs : IUnknown 21849 { 21850 static const GUID iid = { 0x2d6aa13b,0x3839,0x4a15,[ 0x92,0xfc,0xd8,0x8b,0x3c,0x0d,0x9c,0x9d ] }; 21851 extern(Windows): 21852 /// The reason for WebView to fire the MoveFocus Requested event. 21853 /+[ propget]+/ 21854 HRESULT get_Reason(/+[out, retval]+/ COREWEBVIEW2_MOVE_FOCUS_REASON* reason); 21855 21856 /// Indicate whether the event has been handled by the app. 21857 /// If the app has moved the focus to its desired location, it should set 21858 /// Handled property to TRUE. 21859 /// When Handled property is false after the event handler returns, default 21860 /// action will be taken. The default action is to try to find the next tab 21861 /// stop child window in the app and try to move focus to that window. If 21862 /// there is no other such window to move focus to, focus will be cycled 21863 /// within the WebView's web content. 21864 /+[ propget]+/ 21865 HRESULT get_Handled(/+[out, retval]+/ BOOL* value); 21866 /// Set the Handled property. 21867 /+[ propput]+/ 21868 HRESULT put_Handled(in BOOL value); 21869 } 21870 21871 /// The caller implements this method to receive the MoveFocusRequested event. 21872 const GUID IID_ICoreWebView2MoveFocusRequestedEventHandler = ICoreWebView2MoveFocusRequestedEventHandler.iid; 21873 21874 interface ICoreWebView2MoveFocusRequestedEventHandler : IUnknown 21875 { 21876 static const GUID iid = { 0x69035451,0x6dc7,0x4cb8,[ 0x9b,0xce,0xb2,0xbd,0x70,0xad,0x28,0x9f ] }; 21877 extern(Windows): 21878 /// Called to provide the implementer with the event args for the 21879 /// corresponding event. 21880 HRESULT Invoke( 21881 /+[in]+/ ICoreWebView2Controller sender, 21882 /+[in]+/ ICoreWebView2MoveFocusRequestedEventArgs args); 21883 } 21884 21885 /// Event args for the WebMessageReceived event. 21886 const GUID IID_ICoreWebView2WebMessageReceivedEventArgs = ICoreWebView2WebMessageReceivedEventArgs.iid; 21887 21888 interface ICoreWebView2WebMessageReceivedEventArgs : IUnknown 21889 { 21890 static const GUID iid = { 0x0f99a40c,0xe962,0x4207,[ 0x9e,0x92,0xe3,0xd5,0x42,0xef,0xf8,0x49 ] }; 21891 extern(Windows): 21892 /// The URI of the document that sent this web message. 21893 /+[ propget]+/ 21894 HRESULT get_Source(/+[out, retval]+/ LPWSTR* source); 21895 21896 /// The message posted from the WebView content to the host converted to a 21897 /// JSON string. Use this to communicate via JavaScript objects. 21898 /// 21899 /// For example the following postMessage calls result in the 21900 /// following WebMessageAsJson values: 21901 /// 21902 /// ``` 21903 /// postMessage({'a': 'b'}) L"{\"a\": \"b\"}" 21904 /// postMessage(1.2) L"1.2" 21905 /// postMessage('example') L"\"example\"" 21906 /// ``` 21907 /+[ propget]+/ 21908 HRESULT get_WebMessageAsJson(/+[out, retval]+/ LPWSTR* webMessageAsJson); 21909 21910 /// If the message posted from the WebView content to the host is a 21911 /// string type, this method will return the value of that string. If the 21912 /// message posted is some other kind of JavaScript type this method will fail 21913 /// with E_INVALIDARG. Use this to communicate via simple strings. 21914 /// 21915 /// For example the following postMessage calls result in the 21916 /// following WebMessageAsString values: 21917 /// 21918 /// ``` 21919 /// postMessage({'a': 'b'}) E_INVALIDARG 21920 /// postMessage(1.2) E_INVALIDARG 21921 /// postMessage('example') L"example" 21922 /// ``` 21923 HRESULT TryGetWebMessageAsString(/+[out, retval]+/ LPWSTR* webMessageAsString); 21924 } 21925 21926 /// The caller implements this interface to receive the WebMessageReceived 21927 /// event. 21928 const GUID IID_ICoreWebView2WebMessageReceivedEventHandler = ICoreWebView2WebMessageReceivedEventHandler.iid; 21929 21930 interface ICoreWebView2WebMessageReceivedEventHandler : IUnknown 21931 { 21932 static const GUID iid = { 0x57213f19,0x00e6,0x49fa,[ 0x8e,0x07,0x89,0x8e,0xa0,0x1e,0xcb,0xd2 ] }; 21933 extern(Windows): 21934 /// Called to provide the implementer with the event args for the 21935 /// corresponding event. 21936 HRESULT Invoke( 21937 /+[in]+/ ICoreWebView2 sender, 21938 /+[in]+/ ICoreWebView2WebMessageReceivedEventArgs args); 21939 } 21940 21941 /// Event args for the DevToolsProtocolEventReceived event. 21942 const GUID IID_ICoreWebView2DevToolsProtocolEventReceivedEventArgs = ICoreWebView2DevToolsProtocolEventReceivedEventArgs.iid; 21943 21944 interface ICoreWebView2DevToolsProtocolEventReceivedEventArgs : IUnknown 21945 { 21946 static const GUID iid = { 0x653c2959,0xbb3a,0x4377,[ 0x86,0x32,0xb5,0x8a,0xda,0x4e,0x66,0xc4 ] }; 21947 extern(Windows): 21948 /// The parameter object of the corresponding DevToolsProtocol event 21949 /// represented as a JSON string. 21950 /+[ propget]+/ 21951 HRESULT get_ParameterObjectAsJson(/+[out, retval]+/ LPWSTR* 21952 parameterObjectAsJson); 21953 } 21954 21955 /// The caller implements this interface to receive 21956 /// DevToolsProtocolEventReceived events from the WebView. 21957 const GUID IID_ICoreWebView2DevToolsProtocolEventReceivedEventHandler = ICoreWebView2DevToolsProtocolEventReceivedEventHandler.iid; 21958 21959 interface ICoreWebView2DevToolsProtocolEventReceivedEventHandler : IUnknown 21960 { 21961 static const GUID iid = { 0xe2fda4be,0x5456,0x406c,[ 0xa2,0x61,0x3d,0x45,0x21,0x38,0x36,0x2c ] }; 21962 extern(Windows): 21963 /// Called to provide the implementer with the event args for the 21964 /// corresponding event. 21965 HRESULT Invoke( 21966 /+[in]+/ ICoreWebView2 sender, 21967 /+[in]+/ ICoreWebView2DevToolsProtocolEventReceivedEventArgs args); 21968 } 21969 21970 /// The caller implements this interface to receive CallDevToolsProtocolMethod 21971 /// completion results. 21972 const GUID IID_ICoreWebView2CallDevToolsProtocolMethodCompletedHandler = ICoreWebView2CallDevToolsProtocolMethodCompletedHandler.iid; 21973 21974 interface ICoreWebView2CallDevToolsProtocolMethodCompletedHandler : IUnknown 21975 { 21976 static const GUID iid = { 0x5c4889f0,0x5ef6,0x4c5a,[ 0x95,0x2c,0xd8,0xf1,0xb9,0x2d,0x05,0x74 ] }; 21977 extern(Windows): 21978 /// Called to provide the implementer with the completion status and result 21979 /// of the corresponding asynchronous method call. 21980 HRESULT Invoke(in HRESULT errorCode, in LPCWSTR returnObjectAsJson); 21981 } 21982 21983 /// The caller implements this interface to receive the CoreWebView2Controller created 21984 /// via CreateCoreWebView2Controller. 21985 const GUID IID_ICoreWebView2CreateCoreWebView2ControllerCompletedHandler = ICoreWebView2CreateCoreWebView2ControllerCompletedHandler.iid; 21986 21987 interface ICoreWebView2CreateCoreWebView2ControllerCompletedHandler : IUnknown 21988 { 21989 static const GUID iid = { 0x6c4819f3,0xc9b7,0x4260,[ 0x81,0x27,0xc9,0xf5,0xbd,0xe7,0xf6,0x8c ] }; 21990 extern(Windows): 21991 /// Called to provide the implementer with the completion status and result 21992 /// of the corresponding asynchronous method call. 21993 HRESULT Invoke(HRESULT errorCode, ICoreWebView2Controller createdController); 21994 } 21995 21996 /// Event args for the NewWindowRequested event. The event is fired when content 21997 /// inside webview requested to a open a new window (through window.open() and so on.) 21998 const GUID IID_ICoreWebView2NewWindowRequestedEventArgs = ICoreWebView2NewWindowRequestedEventArgs.iid; 21999 22000 interface ICoreWebView2NewWindowRequestedEventArgs : IUnknown 22001 { 22002 static const GUID iid = { 0x34acb11c,0xfc37,0x4418,[ 0x91,0x32,0xf9,0xc2,0x1d,0x1e,0xaf,0xb9 ] }; 22003 extern(Windows): 22004 /// The target uri of the NewWindowRequest. 22005 /+[ propget]+/ 22006 HRESULT get_Uri(/+[out, retval]+/ LPWSTR* uri); 22007 22008 /// Sets a WebView as a result of the NewWindowRequest. The target 22009 /// WebView should not be navigated. If the NewWindow is set, its top level 22010 /// window will return as the opened WindowProxy. 22011 /+[ propput]+/ 22012 HRESULT put_NewWindow(/+[in]+/ ICoreWebView2 newWindow); 22013 /// Gets the new window. 22014 /+[ propget]+/ 22015 HRESULT get_NewWindow(/+[out, retval]+/ ICoreWebView2 * newWindow); 22016 22017 /// Sets whether the NewWindowRequestedEvent is handled by host. If this is false 22018 /// and no NewWindow is set, the WebView will open a popup 22019 /// window and it will be returned as opened WindowProxy. 22020 /// If set to true and no NewWindow is set for a window.open call, the opened 22021 /// WindowProxy will be for an dummy window object and no window will load. 22022 /// Default is false. 22023 /+[ propput]+/ 22024 HRESULT put_Handled(in BOOL handled); 22025 /// Gets whether the NewWindowRequestedEvent is handled by host. 22026 /+[ propget]+/ 22027 HRESULT get_Handled(/+[out, retval]+/ BOOL* handled); 22028 22029 /// IsUserInitiated is true when the new window request was initiated through 22030 /// a user gesture such as clicking an anchor tag with target. The Edge 22031 /// popup blocker is disabled for WebView so the app can use this flag to 22032 /// block non-user initiated popups. 22033 /+[ propget]+/ 22034 HRESULT get_IsUserInitiated(/+[out, retval]+/ BOOL* isUserInitiated); 22035 22036 /// Obtain an ICoreWebView2Deferral object and put the event into a deferred state. 22037 /// You can use the ICoreWebView2Deferral object to complete the window open 22038 /// request at a later time. 22039 /// While this event is deferred the opener window will be returned a WindowProxy 22040 /// to an unnavigated window, which will navigate when the deferral is complete. 22041 HRESULT GetDeferral(/+[out, retval]+/ ICoreWebView2Deferral * deferral); 22042 22043 /// Window features specified by the window.open call. 22044 /// These features can be considered for positioning and sizing of 22045 /// new webview windows. 22046 /+[ propget]+/ 22047 HRESULT get_WindowFeatures(/+[out, retval]+/ ICoreWebView2WindowFeatures * value); 22048 } 22049 22050 /// Window features for a WebView popup window. These fields match the 22051 /// 'windowFeatures' passed to window.open as specified in 22052 /// https://developer.mozilla.org/en-US/docs/Web/API/Window/open#Window_features 22053 /// There is no requirement for you to respect these values. If your app doesn't 22054 /// have corresponding UI features, for example no toolbar, or if all webviews 22055 /// are opened in tabs and so cannot have distinct size or positions, then your 22056 /// app cannot respect these values. You may want to respect values but perhaps 22057 /// only some can apply to your app's UI. Accordingly, it is fine to respect 22058 /// all, some, or none of these properties as appropriate based on your app. 22059 /// For all numeric properties, if the value when passed to window.open is 22060 /// outside the range of an unsigned 32bit int, the value will be mod of the max 22061 /// of unsigned 32bit integer. If the value cannot be parsed as an integer it 22062 /// will be considered 0. If the value is a floating point value, it will be 22063 /// rounded down to an integer. 22064 const GUID IID_ICoreWebView2WindowFeatures = ICoreWebView2WindowFeatures.iid; 22065 22066 interface ICoreWebView2WindowFeatures : IUnknown 22067 { 22068 static const GUID iid = { 0x5eaf559f,0xb46e,0x4397,[ 0x88,0x60,0xe4,0x22,0xf2,0x87,0xff,0x1e ] }; 22069 extern(Windows): 22070 /// True if the Left and Top properties were specified. False if at least one 22071 /// was not specified. 22072 /+[ propget]+/ 22073 HRESULT get_HasPosition(/+[out, retval]+/ BOOL* value); 22074 /// True if the Width and Height properties were specified. False if at least 22075 /// one was not specified. 22076 /+[ propget]+/ 22077 HRESULT get_HasSize(/+[out, retval]+/ BOOL* value); 22078 /// The left position of the window. This will fail if HasPosition is false. 22079 /+[ propget]+/ 22080 HRESULT get_Left(/+[out, retval]+/ UINT32* value); 22081 /// The top position of the window. This will fail if HasPosition is false. 22082 /+[ propget]+/ 22083 HRESULT get_Top(/+[out, retval]+/ UINT32* value); 22084 /// The height of the window. This will fail if HasSize is false. 22085 /+[ propget]+/ 22086 HRESULT get_Height(/+[out, retval]+/ UINT32* value); 22087 /// The width of the window. This will fail if HasSize is false. 22088 /+[ propget]+/ 22089 HRESULT get_Width(/+[out, retval]+/ UINT32* value); 22090 /// Whether or not to display the menu bar. 22091 /+[ propget]+/ 22092 HRESULT get_ShouldDisplayMenuBar(/+[out, retval]+/ BOOL* value); 22093 /// Whether or not to display a status bar. 22094 /+[ propget]+/ 22095 HRESULT get_ShouldDisplayStatus(/+[out, retval]+/ BOOL* value); 22096 /// Whether or not to display a toolbar. 22097 /+[ propget]+/ 22098 HRESULT get_ShouldDisplayToolbar(/+[out, retval]+/ BOOL* value); 22099 /// Whether or not to display scroll bars. 22100 /+[ propget]+/ 22101 HRESULT get_ShouldDisplayScrollBars(/+[out, retval]+/ BOOL* value); 22102 } 22103 22104 /// The caller implements this interface to receive NewWindowRequested 22105 /// events. 22106 const GUID IID_ICoreWebView2NewWindowRequestedEventHandler = ICoreWebView2NewWindowRequestedEventHandler.iid; 22107 22108 interface ICoreWebView2NewWindowRequestedEventHandler : IUnknown 22109 { 22110 static const GUID iid = { 0xd4c185fe,0xc81c,0x4989,[ 0x97,0xaf,0x2d,0x3f,0xa7,0xab,0x56,0x51 ] }; 22111 extern(Windows): 22112 /// Called to provide the implementer with the event args for the 22113 /// corresponding event. 22114 HRESULT Invoke( 22115 /+[in]+/ ICoreWebView2 sender, 22116 /+[in]+/ ICoreWebView2NewWindowRequestedEventArgs args); 22117 } 22118 22119 /// The caller implements this interface to receive DocumentTitleChanged 22120 /// events. Use the DocumentTitle property to get the modified 22121 /// title. 22122 const GUID IID_ICoreWebView2DocumentTitleChangedEventHandler = ICoreWebView2DocumentTitleChangedEventHandler.iid; 22123 22124 interface ICoreWebView2DocumentTitleChangedEventHandler : IUnknown 22125 { 22126 static const GUID iid = { 0xf5f2b923,0x953e,0x4042,[ 0x9f,0x95,0xf3,0xa1,0x18,0xe1,0xaf,0xd4 ] }; 22127 extern(Windows): 22128 /// Called to provide the implementer with the event args for the 22129 /// corresponding event. There are no event args and the args 22130 /// parameter will be null. 22131 HRESULT Invoke(/+[in]+/ ICoreWebView2 sender, /+[in]+/ IUnknown args); 22132 } 22133 22134 /// Event args for the AcceleratorKeyPressed event. 22135 const GUID IID_ICoreWebView2AcceleratorKeyPressedEventArgs = ICoreWebView2AcceleratorKeyPressedEventArgs.iid; 22136 22137 interface ICoreWebView2AcceleratorKeyPressedEventArgs : IUnknown 22138 { 22139 static const GUID iid = { 0x9f760f8a,0xfb79,0x42be,[ 0x99,0x90,0x7b,0x56,0x90,0x0f,0xa9,0xc7 ] }; 22140 extern(Windows): 22141 /// The key event type that caused the event to be fired. 22142 /+[ propget]+/ 22143 HRESULT get_KeyEventKind(/+[out, retval]+/ COREWEBVIEW2_KEY_EVENT_KIND* keyEventKind); 22144 /// The Win32 virtual key code of the key that was pressed or released. 22145 /// This will be one of the Win32 virtual key constants such as VK_RETURN or 22146 /// an (uppercase) ASCII value such as 'A'. You can check whether Ctrl or Alt 22147 /// are pressed by calling GetKeyState(VK_CONTROL) or GetKeyState(VK_MENU). 22148 /+[ propget]+/ 22149 HRESULT get_VirtualKey(/+[out, retval]+/ UINT* virtualKey); 22150 /// The LPARAM value that accompanied the window message. See the 22151 /// documentation for the WM_KEYDOWN and WM_KEYUP messages. 22152 /+[ propget]+/ 22153 HRESULT get_KeyEventLParam(/+[out, retval]+/ INT* lParam); 22154 /// A structure representing the information passed in the LPARAM of the 22155 /// window message. 22156 /+[ propget]+/ 22157 HRESULT get_PhysicalKeyStatus( 22158 /+[out, retval]+/ COREWEBVIEW2_PHYSICAL_KEY_STATUS* physicalKeyStatus); 22159 /// During AcceleratorKeyPressedEvent handler invocation the WebView is blocked 22160 /// waiting for the decision of if the accelerator will be handled by the host 22161 /// or not. If the Handled property is set to TRUE then this will 22162 /// prevent the WebView from performing the default action for this 22163 /// accelerator key. Otherwise the WebView will perform the default action for 22164 /// the accelerator key. 22165 /+[ propget]+/ 22166 HRESULT get_Handled(/+[out, retval]+/ BOOL* handled); 22167 /// Sets the Handled property. 22168 /+[ propput]+/ 22169 HRESULT put_Handled(in BOOL handled); 22170 } 22171 22172 /// The caller implements this interface to receive the AcceleratorKeyPressed 22173 /// event. 22174 const GUID IID_ICoreWebView2AcceleratorKeyPressedEventHandler = ICoreWebView2AcceleratorKeyPressedEventHandler.iid; 22175 22176 interface ICoreWebView2AcceleratorKeyPressedEventHandler : IUnknown 22177 { 22178 static const GUID iid = { 0xb29c7e28,0xfa79,0x41a8,[ 0x8e,0x44,0x65,0x81,0x1c,0x76,0xdc,0xb2 ] }; 22179 extern(Windows): 22180 /// Called to provide the implementer with the event args for the 22181 /// corresponding event. 22182 HRESULT Invoke( 22183 /+[in]+/ ICoreWebView2Controller sender, 22184 /+[in]+/ ICoreWebView2AcceleratorKeyPressedEventArgs args); 22185 } 22186 22187 /// The caller implements this interface to receive NewBrowserVersionAvailable events. 22188 const GUID IID_ICoreWebView2NewBrowserVersionAvailableEventHandler = ICoreWebView2NewBrowserVersionAvailableEventHandler.iid; 22189 22190 interface ICoreWebView2NewBrowserVersionAvailableEventHandler : IUnknown 22191 { 22192 static const GUID iid = { 0xf9a2976e,0xd34e,0x44fc,[ 0xad,0xee,0x81,0xb6,0xb5,0x7c,0xa9,0x14 ] }; 22193 extern(Windows): 22194 /// Called to provide the implementer with the event args for the 22195 /// corresponding event. 22196 HRESULT Invoke(/+[in]+/ ICoreWebView2Environment webviewEnvironment, 22197 /+[in]+/ IUnknown args); 22198 } 22199 22200 /// The caller implements this method to receive the 22201 /// ContainsFullScreenElementChanged events. There are no event args for this 22202 /// event. 22203 const GUID IID_ICoreWebView2ContainsFullScreenElementChangedEventHandler = ICoreWebView2ContainsFullScreenElementChangedEventHandler.iid; 22204 22205 interface ICoreWebView2ContainsFullScreenElementChangedEventHandler : IUnknown 22206 { 22207 static const GUID iid = { 0xe45d98b1,0xafef,0x45be,[ 0x8b,0xaf,0x6c,0x77,0x28,0x86,0x7f,0x73 ] }; 22208 extern(Windows): 22209 /// Called to provide the implementer with the event args for the 22210 /// corresponding event. There are no event args and the args 22211 /// parameter will be null. 22212 HRESULT Invoke(/+[in]+/ ICoreWebView2 sender, /+[in]+/ IUnknown args); 22213 } 22214 22215 /// The caller implements this interface to receive NewWindowRequested 22216 /// events. 22217 const GUID IID_ICoreWebView2WindowCloseRequestedEventHandler = ICoreWebView2WindowCloseRequestedEventHandler.iid; 22218 22219 interface ICoreWebView2WindowCloseRequestedEventHandler : IUnknown 22220 { 22221 static const GUID iid = { 0x5c19e9e0,0x092f,0x486b,[ 0xaf,0xfa,0xca,0x82,0x31,0x91,0x30,0x39 ] }; 22222 extern(Windows): 22223 /// Called to provide the implementer with the event args for the 22224 /// corresponding event. There are no event args and the args 22225 /// parameter will be null. 22226 HRESULT Invoke(/+[in]+/ ICoreWebView2 sender, /+[in]+/ IUnknown args); 22227 } 22228 22229 /// This represents the WebView2 Environment. WebViews created from an 22230 /// environment run on the browser process specified with environment parameters 22231 /// and objects created from an environment should be used in the same environment. 22232 /// Using it in different environments are not guaranteed to be compatible and may fail. 22233 const GUID IID_ICoreWebView2Environment = ICoreWebView2Environment.iid; 22234 22235 interface ICoreWebView2Environment : IUnknown 22236 { 22237 static const GUID iid = { 0xb96d755e,0x0319,0x4e92,[ 0xa2,0x96,0x23,0x43,0x6f,0x46,0xa1,0xfc ] }; 22238 extern(Windows): 22239 /// Asynchronously create a new WebView. 22240 /// 22241 /// parentWindow is the HWND in which the WebView should be displayed and 22242 /// from which receive input. The WebView will add a child window to the 22243 /// provided window during WebView creation. Z-order and other things impacted 22244 /// by sibling window order will be affected accordingly. 22245 /// 22246 /// It is recommended that the application set Application User Model ID for 22247 /// the process or the application window. If none is set, during WebView 22248 /// creation a generated Application User Model ID is set to root window of 22249 /// parentWindow. 22250 /// \snippet AppWindow.cpp CreateCoreWebView2Controller 22251 /// 22252 /// It is recommended that the application handles restart manager messages 22253 /// so that it can be restarted gracefully in the case when the app is using 22254 /// Edge for WebView from a certain installation and that installation is being 22255 /// uninstalled. For example, if a user installs Edge from Dev channel and 22256 /// opts to use Edge from that channel for testing the app, and then uninstalls 22257 /// Edge from that channel without closing the app, the app will be restarted 22258 /// to allow uninstallation of the dev channel to succeed. 22259 /// \snippet AppWindow.cpp RestartManager 22260 /// 22261 /// When the application retries CreateCoreWebView2Controller upon failure, it is 22262 /// recommended that the application restarts from creating a new WebView2 22263 /// Environment. If an Edge update happens, the version associated with a WebView2 22264 /// Environment could have been removed and causing the object to no longer work. 22265 /// Creating a new WebView2 Environment will work as it uses the latest version. 22266 /// 22267 /// WebView creation will fail if there is already a running instance using the same 22268 /// user data folder, and the Environment objects have different EnvironmentOptions. 22269 /// For example, if there is already a WebView created with one language, trying to 22270 /// create a WebView with a different language using the same user data folder will 22271 /// fail. 22272 HRESULT CreateCoreWebView2Controller( 22273 HWND parentWindow, 22274 ICoreWebView2CreateCoreWebView2ControllerCompletedHandler handler); 22275 22276 /// Create a new web resource response object. The headers is the 22277 /// raw response header string delimited by newline. It's also possible to 22278 /// create this object with null headers string and then use the 22279 /// ICoreWebView2HttpResponseHeaders to construct the headers line by line. 22280 /// For information on other parameters see ICoreWebView2WebResourceResponse. 22281 /// 22282 /// \snippet SettingsComponent.cpp WebResourceRequested 22283 HRESULT CreateWebResourceResponse( 22284 in IStream* content, 22285 in int statusCode, 22286 in LPCWSTR reasonPhrase, 22287 in LPCWSTR headers, 22288 /+[out, retval]+/ ICoreWebView2WebResourceResponse * response); 22289 22290 /// The browser version info of the current ICoreWebView2Environment, 22291 /// including channel name if it is not the stable channel. 22292 /// This matches the format of the 22293 /// GetAvailableCoreWebView2BrowserVersionString API. 22294 /// Channel names are 'beta', 'dev', and 'canary'. 22295 /// 22296 /// \snippet AppWindow.cpp GetBrowserVersionString 22297 /+[ propget]+/ 22298 HRESULT get_BrowserVersionString(/+[out, retval]+/ LPWSTR* versionInfo); 22299 22300 /// Add an event handler for the NewBrowserVersionAvailable event. 22301 /// NewBrowserVersionAvailable fires when a newer version of the 22302 /// Edge browser is installed and available for use via WebView2. 22303 /// To use the newer version of the browser you must create a new 22304 /// environment and WebView. 22305 /// This event will only be fired for new version from the same Edge channel 22306 /// that the code is running from. When not running with installed Edge, 22307 /// no event will be fired. 22308 /// 22309 /// Because a user data folder can only be used by one browser process at 22310 /// a time, if you want to use the same user data folder in the WebViews 22311 /// using the new version of the browser, 22312 /// you must close the environment and WebViews that are using the older 22313 /// version of the browser first. Or simply prompt the user to restart the 22314 /// app. 22315 /// 22316 /// \snippet AppWindow.cpp NewBrowserVersionAvailable 22317 /// 22318 HRESULT add_NewBrowserVersionAvailable( 22319 /+[in]+/ ICoreWebView2NewBrowserVersionAvailableEventHandler eventHandler, 22320 /+[out]+/ EventRegistrationToken* token); 22321 22322 /// Remove an event handler previously added with add_NewBrowserVersionAvailable. 22323 HRESULT remove_NewBrowserVersionAvailable( 22324 in EventRegistrationToken token); 22325 } 22326 22327 /// Options used to create WebView2 Environment. 22328 /// 22329 /// \snippet AppWindow.cpp CreateCoreWebView2EnvironmentWithOptions 22330 /// 22331 const GUID IID_ICoreWebView2EnvironmentOptions = ICoreWebView2EnvironmentOptions.iid; 22332 22333 interface ICoreWebView2EnvironmentOptions : IUnknown 22334 { 22335 static const GUID iid = { 0x2fde08a8,0x1e9a,0x4766,[ 0x8c,0x05,0x95,0xa9,0xce,0xb9,0xd1,0xc5 ] }; 22336 extern(Windows): 22337 /// AdditionalBrowserArguments can be specified to change the behavior of the 22338 /// WebView. These will be passed to the browser process as part of 22339 /// the command line. See 22340 /// [Run Chromium with Flags](https://aka.ms/RunChromiumWithFlags) 22341 /// for more information about command line switches to browser 22342 /// process. If the app is launched with a command line switch 22343 /// `--edge-webview-switches=xxx` the value of that switch (xxx in 22344 /// the above example) will also be appended to the browser 22345 /// process command line. Certain switches like `--user-data-dir` are 22346 /// internal and important to WebView. Those switches will be 22347 /// ignored even if specified. If the same switches are specified 22348 /// multiple times, the last one wins. There is no attempt to 22349 /// merge the different values of the same switch, except for disabled 22350 /// and enabled features. The features specified by `--enable-features` 22351 /// and `--disable-features` will be merged with simple logic: the features 22352 /// will be the union of the specified features and built-in features, and if 22353 /// a feature is disabled, it will be removed from the enabled features list. 22354 /// App process's command line `--edge-webview-switches` value are processed 22355 /// after the additionalBrowserArguments parameter is processed. Certain 22356 /// features are disabled internally and can't be enabled. 22357 /// If parsing failed for the specified switches, they will be 22358 /// ignored. Default is to run browser process with no extra flags. 22359 /+[ propget]+/ 22360 HRESULT get_AdditionalBrowserArguments(/+[out, retval]+/ LPWSTR* value); 22361 /// Set the AdditionalBrowserArguments property. 22362 /+[ propput]+/ 22363 HRESULT put_AdditionalBrowserArguments(in LPCWSTR value); 22364 22365 /// The default language that WebView will run with. It applies to browser UIs 22366 /// like context menu and dialogs. It also applies to the accept-languages 22367 /// HTTP header that WebView sends to web sites. 22368 /// It is in the format of `language[-country]` where `language` is the 2 letter 22369 /// code from ISO 639 and `country` is the 2 letter code from ISO 3166. 22370 /+[ propget]+/ 22371 HRESULT get_Language(/+[out, retval]+/ LPWSTR* value); 22372 /// Set the Language property. 22373 /+[ propput]+/ 22374 HRESULT put_Language(in LPCWSTR value); 22375 22376 /// The version of the Edge WebView2 Runtime binaries required to be 22377 /// compatible with the calling application. This defaults to the Edge 22378 /// WebView2 Runtime version 22379 /// that corresponds with the version of the SDK the application is using. 22380 /// The format of this value is the same as the format of the 22381 /// BrowserVersionString property and other BrowserVersion values. 22382 /// Only the version part of the BrowserVersion value is respected. The 22383 /// channel suffix, if it exists, is ignored. 22384 /// The version of the Edge WebView2 Runtime binaries actually used may be 22385 /// different from the specified TargetCompatibleBrowserVersion. They are only 22386 /// guaranteed to be compatible. You can check the actual version on the 22387 /// BrowserVersionString property on the ICoreWebView2Environment. 22388 /+[ propget]+/ 22389 HRESULT get_TargetCompatibleBrowserVersion(/+[out, retval]+/ LPWSTR* value); 22390 /// Set the TargetCompatibleBrowserVersion property. 22391 /+[ propput]+/ 22392 HRESULT put_TargetCompatibleBrowserVersion(in LPCWSTR value); 22393 22394 /// The AllowSingleSignOnUsingOSPrimaryAccount property is used to enable 22395 /// single sign on with Azure Active Directory (AAD) resources inside WebView 22396 /// using the logged in Windows account and single sign on with web sites using 22397 /// Microsoft account associated with the login in Windows account. 22398 /// Default is disabled. 22399 /// Universal Windows Platform apps must also declare enterpriseCloudSSO 22400 /// [restricted capability](https://docs.microsoft.com/windows/uwp/packaging/app-capability-declarations#restricted-capabilities) 22401 /// for the single sign on to work. 22402 /+[ propget]+/ 22403 HRESULT get_AllowSingleSignOnUsingOSPrimaryAccount(/+[out, retval]+/ BOOL* allow); 22404 /// Set the AllowSingleSignOnUsingOSPrimaryAccount property. 22405 /+[ propput]+/ 22406 HRESULT put_AllowSingleSignOnUsingOSPrimaryAccount(in BOOL allow); 22407 } 22408 22409 /// The caller implements this interface to receive the WebView2Environment created 22410 /// via CreateCoreWebView2Environment. 22411 const GUID IID_ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler = ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler.iid; 22412 22413 interface ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler : IUnknown 22414 { 22415 static const GUID iid = { 0x4e8a3389,0xc9d8,0x4bd2,[ 0xb6,0xb5,0x12,0x4f,0xee,0x6c,0xc1,0x4d ] }; 22416 extern(Windows): 22417 /// Called to provide the implementer with the completion status and result 22418 /// of the corresponding asynchronous method call. 22419 HRESULT Invoke(HRESULT errorCode, ICoreWebView2Environment createdEnvironment); 22420 } 22421 22422 /// A Receiver is created for a particular DevTools Protocol event and allows 22423 /// you to subscribe and unsubscribe from that event. 22424 /// Obtained from the WebView object via GetDevToolsProtocolEventReceiver. 22425 const GUID IID_ICoreWebView2DevToolsProtocolEventReceiver = ICoreWebView2DevToolsProtocolEventReceiver.iid; 22426 22427 interface ICoreWebView2DevToolsProtocolEventReceiver : IUnknown 22428 { 22429 static const GUID iid = { 0xb32ca51a,0x8371,0x45e9,[ 0x93,0x17,0xaf,0x02,0x1d,0x08,0x03,0x67 ] }; 22430 extern(Windows): 22431 /// Subscribe to a DevToolsProtocol event. 22432 /// The handler's Invoke method will be called whenever the corresponding 22433 /// DevToolsProtocol event fires. Invoke will be called with 22434 /// an event args object containing the DevTools Protocol event's parameter 22435 /// object as a JSON string. 22436 /// 22437 /// \snippet ScriptComponent.cpp DevToolsProtocolEventReceived 22438 HRESULT add_DevToolsProtocolEventReceived( 22439 /+[in]+/ ICoreWebView2DevToolsProtocolEventReceivedEventHandler handler, 22440 /+[out]+/ EventRegistrationToken* token); 22441 /// Remove an event handler previously added with 22442 /// add_DevToolsProtocolEventReceived. 22443 HRESULT remove_DevToolsProtocolEventReceived( 22444 in EventRegistrationToken token); 22445 } 22446 22447 /// DLL export to create a WebView2 environment with a custom version of Edge, 22448 /// user data directory and/or additional options. 22449 /// 22450 /// The WebView2 environment and all other WebView2 objects are single threaded 22451 /// and have dependencies on Windows components that require COM to be 22452 /// initialized for a single-threaded apartment. The application is expected to 22453 /// call CoInitializeEx before calling CreateCoreWebView2EnvironmentWithOptions. 22454 /// 22455 /// ``` 22456 /// CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); 22457 /// ``` 22458 /// 22459 /// If CoInitializeEx was not called or has been previously called with 22460 /// COINIT_MULTITHREADED, CreateCoreWebView2EnvironmentWithOptions will fail 22461 /// with one of the following errors. 22462 /// 22463 /// ``` 22464 /// CO_E_NOTINITIALIZED (if CoInitializeEx was not called) 22465 /// RPC_E_CHANGED_MODE (if CoInitializeEx was previously called with 22466 /// COINIT_MULTITHREADED) 22467 /// ``` 22468 /// 22469 /// Use `browserExecutableFolder` to specify whether WebView2 controls use a 22470 /// fixed or installed version of the WebView2 Runtime that exists on a client 22471 /// machine. To use a fixed version of the WebView2 Runtime, pass the relative 22472 /// path of the folder that contains the fixed version of the WebView2 Runtime 22473 /// to `browserExecutableFolder`. To create WebView2 controls that use the 22474 /// installed version of the WebView2 Runtime that exists on client machines, 22475 /// pass a null or empty string to `browserExecutableFolder`. In this scenario, 22476 /// the API tries to find a compatible version of the WebView2 Runtime that is 22477 /// installed on the client machine (first at the machine level, and then per 22478 /// user) using the selected channel preference. The path of fixed version of 22479 /// the WebView2 Runtime should not contain `\Edge\Application\`. When such a 22480 /// path is used, the API will fail with ERROR_NOT_SUPPORTED. 22481 /// 22482 /// The default channel search order is the WebView2 Runtime, Beta, Dev, and 22483 /// Canary. 22484 /// When there is an override WEBVIEW2_RELEASE_CHANNEL_PREFERENCE environment 22485 /// variable or applicable releaseChannelPreference registry value 22486 /// with the value of 1, the channel search order is reversed. 22487 /// 22488 /// userDataFolder can be 22489 /// specified to change the default user data folder location for 22490 /// WebView2. The path can be an absolute file path or a relative file path 22491 /// that is interpreted as relative to the current process's executable. 22492 /// Otherwise, for UWP apps, the default user data folder will be 22493 /// the app data folder for the package; for non-UWP apps, 22494 /// the default user data folder `{Executable File Name}.WebView2` 22495 /// will be created in the same directory next to the app executable. 22496 /// WebView2 creation can fail if the executable is running in a directory 22497 /// that the process doesn't have permission to create a new folder in. 22498 /// The app is responsible to clean up its user data folder 22499 /// when it is done. 22500 /// 22501 /// Note that as a browser process might be shared among WebViews, 22502 /// WebView creation will fail with HRESULT_FROM_WIN32(ERROR_INVALID_STATE) if 22503 /// the specified options does not match the options of the WebViews that are 22504 /// currently running in the shared browser process. 22505 /// 22506 /// environmentCreatedHandler is the handler result to the async operation 22507 /// which will contain the WebView2Environment that got created. 22508 /// 22509 /// The browserExecutableFolder, userDataFolder and additionalBrowserArguments 22510 /// of the environmentOptions may be overridden by 22511 /// values either specified in environment variables or in the registry. 22512 /// 22513 /// When creating a WebView2Environment the following environment variables 22514 /// are checked: 22515 /// 22516 /// ``` 22517 /// WEBVIEW2_BROWSER_EXECUTABLE_FOLDER 22518 /// WEBVIEW2_USER_DATA_FOLDER 22519 /// WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS 22520 /// WEBVIEW2_RELEASE_CHANNEL_PREFERENCE 22521 /// ``` 22522 /// 22523 /// If an override environment variable is found then we use the 22524 /// browserExecutableFolder and userDataFolder values as replacements for the 22525 /// corresponding values in CreateCoreWebView2EnvironmentWithOptions parameters. 22526 /// If additionalBrowserArguments specified in environment variable or in the 22527 /// registry, it will be appended to the correspinding values in 22528 /// CreateCoreWebView2EnvironmentWithOptions parameters. 22529 /// 22530 /// While not strictly overrides, there exists additional environment variables 22531 /// that can be set: 22532 /// 22533 /// ``` 22534 /// WEBVIEW2_WAIT_FOR_SCRIPT_DEBUGGER 22535 /// ``` 22536 /// 22537 /// When found with a non-empty value, this indicates that the WebView is being 22538 /// launched under a script debugger. In this case, the WebView will issue a 22539 /// `Page.waitForDebugger` CDP command that will cause script execution inside the 22540 /// WebView to pause on launch, until a debugger issues a corresponding 22541 /// `Runtime.runIfWaitingForDebugger` CDP command to resume execution. 22542 /// Note: There is no registry key equivalent of this environment variable. 22543 /// 22544 /// ``` 22545 /// WEBVIEW2_PIPE_FOR_SCRIPT_DEBUGGER 22546 /// ``` 22547 /// 22548 /// When found with a non-empty value, this indicates that the WebView is being 22549 /// launched under a script debugger that also supports host applications that 22550 /// use multiple WebViews. The value is used as the identifier for a named pipe 22551 /// that will be opened and written to when a new WebView is created by the host 22552 /// application. The payload will match that of the remote-debugging-port JSON 22553 /// target and can be used by the external debugger to attach to a specific 22554 /// WebView instance. 22555 /// The format of the pipe created by the debugger should be: 22556 /// `\\.\pipe\WebView2\Debugger\{app_name}\{pipe_name}` 22557 /// where: 22558 /// 22559 /// - `{app_name}` is the host application exe filename, e.g. WebView2Example.exe 22560 /// - `{pipe_name}` is the value set for WEBVIEW2_PIPE_FOR_SCRIPT_DEBUGGER. 22561 /// 22562 /// To enable debugging of the targets identified by the JSON you will also need 22563 /// to set the WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS environment variable to 22564 /// send `--remote-debugging-port={port_num}` 22565 /// where: 22566 /// 22567 /// - `{port_num}` is the port on which the CDP server will bind. 22568 /// 22569 /// Be aware that setting both the WEBVIEW2_PIPE_FOR_SCRIPT_DEBUGGER and 22570 /// WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS environment variables will cause the 22571 /// WebViews hosted in your application and their contents to be exposed to 22572 /// 3rd party applications such as debuggers. 22573 /// 22574 /// Note: There is no registry key equivalent of this environment variable. 22575 /// 22576 /// If none of those environment variables exist, then the registry is examined next. 22577 /// The following registry values are checked: 22578 /// 22579 /// ``` 22580 /// [{Root}]\Software\Policies\Microsoft\Edge\WebView2\BrowserExecutableFolder 22581 /// "{AppId}"="" 22582 /// 22583 /// [{Root}]\Software\Policies\Microsoft\Edge\WebView2\ReleaseChannelPreference 22584 /// "{AppId}"="" 22585 /// 22586 /// [{Root}]\Software\Policies\Microsoft\Edge\WebView2\AdditionalBrowserArguments 22587 /// "{AppId}"="" 22588 /// 22589 /// [{Root}]\Software\Policies\Microsoft\Edge\WebView2\UserDataFolder 22590 /// "{AppId}"="" 22591 /// ``` 22592 /// 22593 /// browserExecutableFolder and releaseChannelPreference can be configured using 22594 /// group policy under Administrative Templates > Microsoft Edge WebView2. 22595 /// The old registry location will be deprecated soon: 22596 /// 22597 /// ``` 22598 /// [{Root}\Software\Policies\Microsoft\EmbeddedBrowserWebView\LoaderOverride\{AppId}] 22599 /// "ReleaseChannelPreference"=dword:00000000 22600 /// "BrowserExecutableFolder"="" 22601 /// "UserDataFolder"="" 22602 /// "AdditionalBrowserArguments"="" 22603 /// ``` 22604 /// 22605 /// In the unlikely scenario where some instances of WebView are open during 22606 /// a browser update we could end up blocking the deletion of old Edge browsers. 22607 /// To avoid running out of disk space a new WebView creation will fail 22608 /// with the next error if it detects that there are many old versions present. 22609 /// 22610 /// ``` 22611 /// ERROR_DISK_FULL 22612 /// ``` 22613 /// 22614 /// The default maximum number of Edge versions allowed is 20. 22615 /// 22616 /// The maximum number of old Edge versions allowed can be overwritten with the value 22617 /// of the following environment variable. 22618 /// 22619 /// ``` 22620 /// WEBVIEW2_MAX_INSTANCES 22621 /// ``` 22622 /// 22623 /// If the Webview depends on an installed Edge and it is uninstalled 22624 /// any subsequent creation will fail with the next error 22625 /// 22626 /// ``` 22627 /// ERROR_PRODUCT_UNINSTALLED 22628 /// ``` 22629 /// 22630 /// First we check with Root as HKLM and then HKCU. 22631 /// AppId is first set to the Application User Model ID of the caller's process, 22632 /// then if there's no corresponding registry key the AppId is set to the 22633 /// executable name of the caller's process, or if that isn't a registry key 22634 /// then '*'. If an override registry key is found, then we use the 22635 /// browserExecutableFolder and userDataFolder registry values as replacements 22636 /// and append additionalBrowserArguments registry values for the corresponding 22637 /// values in CreateCoreWebView2EnvironmentWithOptions parameters. 22638 extern(Windows) HRESULT CreateCoreWebView2EnvironmentWithOptions(PCWSTR browserExecutableFolder, PCWSTR userDataFolder, ICoreWebView2EnvironmentOptions environmentOptions, ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler environmentCreatedHandler); 22639 22640 /// Creates an evergreen WebView2 Environment using the installed Edge version. 22641 /// This is equivalent to calling CreateCoreWebView2EnvironmentWithOptions with 22642 /// nullptr for browserExecutableFolder, userDataFolder, 22643 /// additionalBrowserArguments. See CreateCoreWebView2EnvironmentWithOptions for 22644 /// more details. 22645 extern(Windows) HRESULT CreateCoreWebView2Environment(ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler environmentCreatedHandler); 22646 22647 /// Get the browser version info including channel name if it is not the stable channel 22648 /// or the Embedded Edge. 22649 /// Channel names are beta, dev, and canary. 22650 /// If an override exists for the browserExecutableFolder or the channel preference, 22651 /// the override will be used. 22652 /// If there isn't an override, then the parameter passed to 22653 /// GetAvailableCoreWebView2BrowserVersionString is used. 22654 extern(Windows) HRESULT GetAvailableCoreWebView2BrowserVersionString(PCWSTR browserExecutableFolder, LPWSTR* versionInfo); 22655 22656 /// This method is for anyone want to compare version correctly to determine 22657 /// which version is newer, older or same. It can be used to determine whether 22658 /// to use webview2 or certain feature base on version. 22659 /// Sets the value of result to -1, 0 or 1 if version1 is less than, equal or 22660 /// greater than version2 respectively. 22661 /// Returns E_INVALIDARG if it fails to parse any of the version strings or any 22662 /// input parameter is null. 22663 /// Input can directly use the versionInfo obtained from 22664 /// GetAvailableCoreWebView2BrowserVersionString, channel info will be ignored. 22665 extern(Windows) HRESULT CompareBrowserVersions(PCWSTR version1, PCWSTR version2, int* result); 22666 22667 }