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 cef_binary_107.1.9+g1f0a21a+chromium-107.0.5304.110_linux64_minimal.tar.bz2 14 15 Note my ceftranslate.d for instructions to start the update process. 16 17 Then to install the cef put in the Resources in the Release directory (*.pak and *.dat 18 out of Resources, failure to do this will cause an abort on ICU file descriptor things) 19 and copy the locales to /opt/cef/Resources/Locales 20 21 You can download compatible builds from https://cef-builds.spotifycdn.com/index.html 22 just make sure to put in the version filter and check "all builds" to match it. 23 24 You do NOT actually need the cef to build the application, but it must be 25 on the user's machine to run it. It looks in /opt/cef/ on Linux. 26 27 Work in progress. DO NOT USE YET as I am prolly gonna break everything too. 28 29 On Windows, you need to distribute the WebView2Loader.dll with your exe. That 30 is found in the web view 2 sdk. Furthermore, users will have to install the runtime. 31 32 Please note; the Microsoft terms and conditions say they may be able to collect 33 information about your users if you use this on Windows. 34 see: https://developer.microsoft.com/en-us/microsoft-edge/webview2/ 35 36 37 +/ 38 module arsd.webview; 39 40 enum WebviewEngine { 41 none, 42 cef, 43 wv2, 44 webkit_gtk 45 } 46 // see activeEngine which is an enum you can static if on 47 48 49 // I might recover this gtk thing but i don't like gtk 50 // dmdi webview -version=linux_gtk -version=Demo 51 52 // the setup link for Microsoft: 53 // https://go.microsoft.com/fwlink/p/?LinkId=2124703 54 55 56 version(Windows) { 57 import arsd.simpledisplay; 58 import arsd.com; 59 import core.atomic; 60 61 //import std.stdio; 62 63 T callback(T)(typeof(&T.init.Invoke) dg) { 64 return new class T { 65 extern(Windows): 66 67 static if(is(typeof(T.init.Invoke) R == return)) 68 static if(is(typeof(T.init.Invoke) P == __parameters)) 69 override R Invoke(P _args_) { 70 return dg(_args_); 71 } 72 73 override HRESULT QueryInterface(const (IID)*riid, LPVOID *ppv) { 74 if (IID_IUnknown == *riid) { 75 *ppv = cast(void*) cast(IUnknown) this; 76 } 77 else if (T.iid == *riid) { 78 *ppv = cast(void*) cast(T) this; 79 } 80 else { 81 *ppv = null; 82 return E_NOINTERFACE; 83 } 84 85 AddRef(); 86 return NOERROR; 87 } 88 89 shared LONG count = 0; 90 ULONG AddRef() { 91 return atomicOp!"+="(count, 1); 92 } 93 ULONG Release() { 94 return atomicOp!"-="(count, 1); 95 } 96 }; 97 } 98 99 enum activeEngine = WebviewEngine.wv2; 100 101 struct RC(T) { 102 private T object; 103 this(T t) { 104 object = t; 105 object.AddRef(); 106 } 107 this(this) { 108 if(object is null) return; 109 object.AddRef(); 110 } 111 ~this() { 112 if(object is null) return; 113 object.Release(); 114 object = null; 115 } 116 117 bool opCast(T:bool)() nothrow { 118 return inner !is null; 119 } 120 121 void opAssign(T obj) { 122 obj.AddRef(); 123 if(object) 124 object.Release(); 125 this.object = obj; 126 } 127 128 T raw() { return object; } 129 130 T returnable() { 131 if(object is null) return null; 132 return object; 133 } 134 135 T passable() { 136 if(object is null) return null; 137 object.AddRef(); 138 return object; 139 } 140 141 static foreach(memberName; __traits(derivedMembers, T)) { 142 mixin ForwardMethod!(memberName); 143 } 144 } 145 146 extern(Windows) 147 alias StringMethod = int delegate(wchar**); 148 149 string toGC(scope StringMethod dg) { 150 wchar* t; 151 auto res = dg(&t); 152 if(res != S_OK) 153 throw new ComException(res); 154 155 auto ot = t; 156 157 string s; 158 159 // FIXME: encode properly in UTF-8 160 while(*t) { 161 s ~= *t; 162 t++; 163 } 164 165 auto ret = s; 166 167 CoTaskMemFree(ot); 168 169 return ret; 170 } 171 172 class ComException : Exception { 173 HRESULT errorCode; 174 this(HRESULT errorCode) { 175 import std.format; 176 super(format("HRESULT: 0x%08x", errorCode)); 177 // FIXME: call FormatMessage 178 } 179 } 180 181 mixin template ForwardMethod(string methodName) { 182 static if(methodName.length > 4 && methodName[0 .. 4] == "put_") { 183 static if(is(typeof(__traits(getMember, T, memberName)) Params == function)) 184 private alias Type = Params[0]; 185 mixin(q{ @property void } ~ memberName[4 .. $] ~ q{(Type v) { 186 auto errorCode = __traits(getMember, object, memberName)(v); 187 if(errorCode) 188 throw new ComException(errorCode); 189 } 190 }); 191 } else 192 static if(methodName.length > 4 && methodName[0 .. 4] == "get_") { 193 static if(is(typeof(__traits(getMember, T, memberName)) Params == function)) 194 private alias Type = typeof(*(Params[0].init)); 195 mixin(q{ @property Type } ~ memberName[4 .. $] ~ q{() { 196 Type response; 197 auto errorCode = __traits(getMember, object, memberName)(&response); 198 if(errorCode) 199 throw new ComException(errorCode); 200 return response; 201 } 202 }); 203 } else 204 static if(methodName.length > 4 && methodName[0 .. 4] == "add_") { 205 static if(is(typeof(__traits(getMember, T, memberName)) Params == function)) 206 alias Handler = Params[0]; 207 alias HandlerDg = typeof(&Handler.init.Invoke); 208 mixin(q{ EventRegistrationToken } ~ memberName ~ q{ (HandlerDg handler) { 209 EventRegistrationToken token; 210 __traits(getMember, object, memberName)(callback!Handler(handler), &token); 211 return token; 212 }}); 213 } else 214 static if(methodName.length > 7 && methodName[0 .. 4] == "remove_") { 215 mixin(q{ void } ~ memberName ~ q{ (EventRegistrationToken token) { 216 __traits(getMember, object, memberName)(token); 217 }}); 218 } else { 219 // I could do the return value things by looking for these comments: 220 // /+[out]+/ but be warned it is possible or a thing to have multiple out params (only one such function in here though i think) 221 // /+[out, retval]+/ 222 // a find/replace could make them a UDA or something. 223 224 static if(is(typeof(__traits(getMember, T, memberName)) Params == function)) 225 static if(is(typeof(__traits(getMember, T, memberName)) Return == return)) 226 227 mixin(q{ Return } ~ memberName ~ q{ (Params p) { 228 // FIXME: check the return value and throw 229 return __traits(getMember, object, memberName)(p); 230 } 231 }); 232 233 } 234 } 235 236 struct Wv2App { 237 static bool active = false; 238 239 static HRESULT code; 240 static bool initialized = false; 241 static RC!ICoreWebView2Environment webview_env; 242 243 @disable this(this); 244 245 static void delegate(RC!ICoreWebView2Environment)[] pending; 246 this(void delegate(RC!ICoreWebView2Environment) withEnvironment) { 247 if(withEnvironment) 248 pending ~= withEnvironment; 249 250 import core.sys.windows.com; 251 CoInitializeEx(null, COINIT_APARTMENTTHREADED); 252 253 active = true; 254 255 auto lib = LoadLibraryW("WebView2Loader.dll"w.ptr); 256 typeof(&CreateCoreWebView2EnvironmentWithOptions) func; 257 258 if(lib is null) 259 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."); 260 func = cast(typeof(func)) GetProcAddress(lib, CreateCoreWebView2EnvironmentWithOptions.mangleof); 261 if(func is null) 262 throw new Exception("CreateCoreWebView2EnvironmentWithOptions failed from WebView2Loader..."); 263 264 auto result = func(null, null, null, 265 callback!(ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler)( 266 delegate(error, env) { 267 initialized = true; 268 code = error; 269 270 if(error) 271 return error; 272 273 webview_env = env; 274 275 auto len = pending.length; 276 foreach(item; pending) { 277 item(webview_env); 278 } 279 280 pending = pending[len .. $]; 281 282 return S_OK; 283 } 284 ) 285 ); 286 287 if(result != S_OK) { 288 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) { 289 import std.process; 290 browse("https://go.microsoft.com/fwlink/p/?LinkId=2124703"); 291 } 292 throw new ComException(result); 293 } 294 } 295 296 @disable this(); 297 298 ~this() { 299 active = false; 300 } 301 302 static void useEnvironment(void delegate(RC!ICoreWebView2Environment) withEnvironment) { 303 assert(active); 304 assert(withEnvironment !is null); 305 if(initialized) { 306 if(code) 307 throw new ComException(code); 308 withEnvironment(webview_env); 309 } else 310 pending ~= withEnvironment; 311 } 312 } 313 } 314 315 316 317 /+ 318 interface WebView { 319 void refresh(); 320 void back(); 321 void forward(); 322 void stop(); 323 324 void navigate(string url); 325 326 // the url and line are for error reporting purposes 327 void executeJavascript(string code, string url = null, int line = 0); 328 329 void showDevTools(); 330 331 // these are get/set properties that you can subscribe to with some system 332 333 mixin Observable!(string, "title"); 334 mixin Observable!(string, "url"); 335 mixin Observable!(string, "status"); 336 mixin Observable!(int, "loadingProgress"); 337 } 338 +/ 339 340 341 version(linux) { 342 version(linux_gtk) {} else 343 version=cef; 344 } 345 346 347 version(cef) { 348 import arsd.simpledisplay; 349 350 //pragma(lib, "cef"); 351 352 class BrowserProcessHandler : CEF!cef_browser_process_handler_t { 353 override void on_context_initialized() { } 354 355 override void on_before_child_process_launch(RC!cef_command_line_t) { } 356 override void on_schedule_message_pump_work(long delayMs) { } 357 override cef_client_t* get_default_client() { return null; } 358 } 359 360 361 int cefProcessHelper() { 362 import core.runtime; 363 import core.stdc.stdlib; 364 365 cef_main_args_t main_args; 366 version(linux) { 367 main_args.argc = Runtime.cArgs.argc; 368 main_args.argv = Runtime.cArgs.argv; 369 } else version(Windows) { 370 main_args.instance = GetModuleHandle(null); 371 } 372 373 if(libcef.loadDynamicLibrary()) { 374 int code = libcef.execute_process(&main_args, null, null); 375 if(code >= 0) 376 exit(code); 377 return code; 378 } 379 return -1; 380 } 381 382 shared static this() { 383 cefProcessHelper(); 384 } 385 386 public struct CefApp { 387 static bool active() { 388 return count > 0; 389 } 390 391 private __gshared int count = 0; 392 393 @disable this(this); 394 @disable new(); 395 this(void delegate(cef_settings_t* settings) setSettings) { 396 397 if(!libcef.loadDynamicLibrary()) 398 throw new Exception("failed to load cef dll"); 399 400 count++; 401 402 import core.runtime; 403 import core.stdc.stdlib; 404 405 cef_main_args_t main_args; 406 version(linux) { 407 main_args.argc = Runtime.cArgs.argc; 408 main_args.argv = Runtime.cArgs.argv; 409 } else version(Windows) { 410 main_args.instance = GetModuleHandle(null); 411 } 412 413 cef_settings_t settings; 414 settings.size = cef_settings_t.sizeof; 415 //settings.log_severity = cef_log_severity_t.LOGSEVERITY_DISABLE; // Show only warnings/errors 416 settings.log_severity = cef_log_severity_t.LOGSEVERITY_INFO; // Show only warnings/errors 417 settings.multi_threaded_message_loop = 1; 418 settings.no_sandbox = 1; 419 420 version(linux) 421 settings.locales_dir_path = cef_string_t("/opt/cef/Resources/locales"); 422 423 if(setSettings !is null) 424 setSettings(&settings); 425 426 427 auto app = new class CEF!cef_app_t { 428 BrowserProcessHandler bph; 429 this() { 430 bph = new BrowserProcessHandler(); 431 } 432 override void on_before_command_line_processing(const(cef_string_t)*, RC!cef_command_line_t) {} 433 434 override cef_resource_bundle_handler_t* get_resource_bundle_handler() { 435 return null; 436 } 437 override cef_browser_process_handler_t* get_browser_process_handler() { 438 return bph.returnable; 439 } 440 override cef_render_process_handler_t* get_render_process_handler() { 441 return null; 442 } 443 override void on_register_custom_schemes(cef_scheme_registrar_t*) { 444 445 } 446 }; 447 448 if(!libcef.initialize(&main_args, &settings, app.passable, null)) { 449 throw new Exception("cef_initialize failed"); 450 } 451 } 452 453 ~this() { 454 count--; 455 // this call hangs and idk why. 456 // FIXME 457 //libcef.shutdown(); 458 } 459 } 460 461 462 version(Demo) 463 void main() { 464 auto app = CefApp(null); 465 466 auto window = new SimpleWindow(640, 480, "D Browser", Resizability.allowResizing); 467 flushGui; 468 469 cef_window_info_t window_info; 470 /* 471 window_info.x = 100; 472 window_info.y = 100; 473 window_info.width = 300; 474 window_info.height = 300; 475 */ 476 //window_info.parent_window = window.nativeWindowHandle; 477 478 cef_string_t cef_url = cef_string_t("http://dpldocs.info/");//"http://youtube.com/"w); 479 480 //string url = "http://arsdnet.net/"; 481 //cef_string_utf8_to_utf16(url.ptr, url.length, &cef_url); 482 483 cef_browser_settings_t browser_settings; 484 browser_settings.size = cef_browser_settings_t.sizeof; 485 486 auto client = new MyCefClient(); 487 488 auto got = libcef.browser_host_create_browser(&window_info, client.passable, &cef_url, &browser_settings, null, null); // or _sync 489 490 window.eventLoop(0); 491 } 492 493 494 /++ 495 This gives access to the CEF functions. If you get a linker error for using an undefined function, 496 it is probably because you did NOT go through this when dynamically loading. 497 498 (...similarly, if you get a segfault, it is probably because you DID go through this when static binding.) 499 +/ 500 struct libcef { 501 static __gshared: 502 503 bool isLoaded; 504 bool loadAttempted; 505 void* libHandle; 506 507 /// Make sure you call this only from one thread, probably at process startup. It caches internally and returns true if the load was successful. 508 bool loadDynamicLibrary() { 509 if(loadAttempted) 510 return isLoaded; 511 512 loadAttempted = true; 513 514 version(linux) { 515 import core.sys.posix.dlfcn; 516 libHandle = dlopen("libcef.so", RTLD_NOW); 517 518 static void* loadsym(const char* name) { 519 return dlsym(libHandle, name); 520 } 521 } else version(Windows) { 522 import core.sys.windows.windows; 523 libHandle = LoadLibrary("libcef.dll"); 524 525 static void* loadsym(const char* name) { 526 return GetProcAddress(libHandle, name); 527 } 528 } 529 530 //import std.stdio; 531 if(libHandle is null) { 532 //writeln("libhandlenull"); 533 return false; 534 } 535 foreach(memberName; __traits(allMembers, libcef)[4 .. $]) { // cutting off everything until the actual static foreach below; this trims off isLoaded to loadDynamicLibrary 536 alias mem = __traits(getMember, libcef, memberName); 537 mem = cast(typeof(mem)) loadsym("cef_" ~ memberName); 538 if(mem is null) { 539 // import std.stdio; writeln(memberName); 540 // throw new Exception("cef_" ~ memberName ~ " failed to load"); 541 return false; 542 } 543 } 544 545 import core.stdc.string; 546 if(strcmp(libcef.api_hash(1), CEF_API_HASH_UNIVERSAL) != 0) 547 throw new Exception("libcef versions not matching bindings"); 548 549 isLoaded = true; 550 return true; 551 } 552 553 static foreach(memberName; __traits(allMembers, arsd.webview)) 554 static if(is(typeof(__traits(getMember, arsd.webview, memberName)) == function)) 555 static if(memberName.length > 4 && memberName[0 .. 4] == "cef_") { 556 mixin(q{ typeof(&__traits(getMember, arsd.webview, memberName)) } ~ memberName[4 .. $] ~ ";"); // = &" ~ memberName ~ ";"); 557 } 558 } 559 560 } 561 562 version(linux_gtk) 563 version(Demo) 564 void main() { 565 auto wv = new WebView(true, null); 566 wv.navigate("http://dpldocs.info/"); 567 wv.setTitle("omg a D webview"); 568 wv.setSize(500, 500, true); 569 wv.eval("console.log('just testing');"); 570 wv.run(); 571 } 572 573 version(linux_gtk) 574 enum activeEngine = WebviewEngine.webkit_gtk; 575 576 /++ 577 578 +/ 579 version(linux_gtk) 580 class WebView : browser_engine { 581 582 /++ 583 Creates a new webview instance. If dbg is non-zero - developer tools will 584 be enabled (if the platform supports them). Window parameter can be a 585 pointer to the native window handle. If it's non-null - then child WebView 586 is embedded into the given parent window. Otherwise a new window is created. 587 Depending on the platform, a GtkWindow, NSWindow or HWND pointer can be 588 passed here. 589 +/ 590 this(bool dbg, void* window) { 591 super(&on_message, dbg, window); 592 } 593 594 extern(C) 595 static void on_message(const char*) {} 596 597 /// Destroys a webview and closes the native window. 598 void destroy() { 599 600 } 601 602 /// Runs the main loop until it's terminated. After this function exits - you 603 /// must destroy the webview. 604 override void run() { super.run(); } 605 606 /// Stops the main loop. It is safe to call this function from another other 607 /// background thread. 608 override void terminate() { super.terminate(); } 609 610 /+ 611 /// Posts a function to be executed on the main thread. You normally do not need 612 /// to call this function, unless you want to tweak the native window. 613 void dispatch(void function(WebView w, void *arg) fn, void *arg) {} 614 +/ 615 616 /// Returns a native window handle pointer. When using GTK backend the pointer 617 /// is GtkWindow pointer, when using Cocoa backend the pointer is NSWindow 618 /// pointer, when using Win32 backend the pointer is HWND pointer. 619 void* getWindow() { return m_window; } 620 621 /// Updates the title of the native window. Must be called from the UI thread. 622 override void setTitle(const char *title) { super.setTitle(title); } 623 624 /// Navigates webview to the given URL. URL may be a data URI. 625 override void navigate(const char *url) { super.navigate(url); } 626 627 /// Injects JavaScript code at the initialization of the new page. Every time 628 /// the webview will open a the new page - this initialization code will be 629 /// executed. It is guaranteed that code is executed before window.onload. 630 override void init(const char *js) { super.init(js); } 631 632 /// Evaluates arbitrary JavaScript code. Evaluation happens asynchronously, also 633 /// the result of the expression is ignored. Use RPC bindings if you want to 634 /// receive notifications about the results of the evaluation. 635 override void eval(const char *js) { super.eval(js); } 636 637 /// Binds a native C callback so that it will appear under the given name as a 638 /// global JavaScript function. Internally it uses webview_init(). Callback 639 /// receives a request string and a user-provided argument pointer. Request 640 /// string is a JSON array of all the arguments passed to the JavaScript 641 /// function. 642 void bind(const char *name, void function(const char *, void *) fn, void *arg) {} 643 644 /// Allows to return a value from the native binding. Original request pointer 645 /// must be provided to help internal RPC engine match requests with responses. 646 /// If status is zero - result is expected to be a valid JSON result value. 647 /// If status is not zero - result is an error JSON object. 648 void webview_return(const char *req, int status, const char *result) {} 649 650 /* 651 void on_message(const char *msg) { 652 auto seq = json_parse(msg, "seq", 0); 653 auto name = json_parse(msg, "name", 0); 654 auto args = json_parse(msg, "args", 0); 655 auto fn = bindings[name]; 656 if (fn == null) { 657 return; 658 } 659 std::async(std::launch::async, [=]() { 660 auto result = (*fn)(args); 661 dispatch([=]() { 662 eval(("var b = window['" + name + "'];b['callbacks'][" + seq + "](" + 663 result + ");b['callbacks'][" + seq + 664 "] = undefined;b['errors'][" + seq + "] = undefined;") 665 .c_str()); 666 }); 667 }); 668 } 669 std::map<std::string, binding_t *> bindings; 670 671 alias binding_t = std::function<std::string(std::string)>; 672 673 void bind(const char *name, binding_t f) { 674 auto js = "(function() { var name = '" + std::string(name) + "';" + R"( 675 window[name] = function() { 676 var me = window[name]; 677 var errors = me['errors']; 678 var callbacks = me['callbacks']; 679 if (!callbacks) { 680 callbacks = {}; 681 me['callbacks'] = callbacks; 682 } 683 if (!errors) { 684 errors = {}; 685 me['errors'] = errors; 686 } 687 var seq = (me['lastSeq'] || 0) + 1; 688 me['lastSeq'] = seq; 689 var promise = new Promise(function(resolve, reject) { 690 callbacks[seq] = resolve; 691 errors[seq] = reject; 692 }); 693 window.external.invoke(JSON.stringify({ 694 name: name, 695 seq:seq, 696 args: Array.prototype.slice.call(arguments), 697 })); 698 return promise; 699 } 700 })())"; 701 init(js.c_str()); 702 bindings[name] = new binding_t(f); 703 } 704 705 */ 706 } 707 708 private extern(C) { 709 alias dispatch_fn_t = void function(); 710 alias msg_cb_t = void function(const char *msg); 711 } 712 713 version(linux_gtk) { 714 715 716 /* Original https://github.com/zserge/webview notice below: 717 * MIT License 718 * 719 * Copyright (c) 2017 Serge Zaitsev 720 * 721 * Permission is hereby granted, free of charge, to any person obtaining a copy 722 * of this software and associated documentation files (the "Software"), to deal 723 * in the Software without restriction, including without limitation the rights 724 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 725 * copies of the Software, and to permit persons to whom the Software is 726 * furnished to do so, subject to the following conditions: 727 * 728 * The above copyright notice and this permission notice shall be included in 729 * all copies or substantial portions of the Software. 730 * 731 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 732 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 733 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 734 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 735 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 736 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 737 * SOFTWARE. 738 */ 739 740 /* 741 Port to D by Adam D. Ruppe, November 30, 2019 742 */ 743 744 745 pragma(lib, "gtk-3"); 746 pragma(lib, "glib-2.0"); 747 pragma(lib, "gobject-2.0"); 748 pragma(lib, "webkit2gtk-4.0"); 749 pragma(lib, "javascriptcoregtk-4.0"); 750 751 private extern(C) { 752 import core.stdc.config; 753 alias GtkWidget = void; 754 enum GtkWindowType { 755 GTK_WINDOW_TOPLEVEL = 0 756 } 757 bool gtk_init_check(int*, char***); 758 GtkWidget* gtk_window_new(GtkWindowType); 759 c_ulong g_signal_connect_data(void*, const char*, void* /* function pointer!!! */, void*, void*, int); 760 GtkWidget* webkit_web_view_new(); 761 alias WebKitUserContentManager = void; 762 WebKitUserContentManager* webkit_web_view_get_user_content_manager(GtkWidget*); 763 764 void gtk_container_add(GtkWidget*, GtkWidget*); 765 void gtk_widget_grab_focus(GtkWidget*); 766 void gtk_widget_show_all(GtkWidget*); 767 void gtk_main(); 768 void gtk_main_quit(); 769 void webkit_web_view_load_uri(GtkWidget*, const char*); 770 alias WebKitSettings = void; 771 WebKitSettings* webkit_web_view_get_settings(GtkWidget*); 772 void webkit_settings_set_enable_write_console_messages_to_stdout(WebKitSettings*, bool); 773 void webkit_settings_set_enable_developer_extras(WebKitSettings*, bool); 774 void webkit_user_content_manager_register_script_message_handler(WebKitUserContentManager*, const char*); 775 alias JSCValue = void; 776 alias WebKitJavascriptResult = void; 777 JSCValue* webkit_javascript_result_get_js_value(WebKitJavascriptResult*); 778 char* jsc_value_to_string(JSCValue*); 779 void g_free(void*); 780 void webkit_web_view_run_javascript(GtkWidget*, const char*, void*, void*, void*); 781 alias WebKitUserScript = void; 782 void webkit_user_content_manager_add_script(WebKitUserContentManager*, WebKitUserScript*); 783 WebKitUserScript* webkit_user_script_new(const char*, WebKitUserContentInjectedFrames, WebKitUserScriptInjectionTime, const char*, const char*); 784 enum WebKitUserContentInjectedFrames { 785 WEBKIT_USER_CONTENT_INJECT_ALL_FRAMES, 786 WEBKIT_USER_CONTENT_INJECT_TOP_FRAME 787 } 788 enum WebKitUserScriptInjectionTime { 789 WEBKIT_USER_SCRIPT_INJECT_AT_DOCUMENT_START, 790 WEBKIT_USER_SCRIPT_INJECT_AT_DOCUMENT_END 791 } 792 void gtk_window_set_title(GtkWidget*, const char*); 793 794 void gtk_window_set_resizable(GtkWidget*, bool); 795 void gtk_window_set_default_size(GtkWidget*, int, int); 796 void gtk_widget_set_size_request(GtkWidget*, int, int); 797 } 798 799 private class browser_engine { 800 801 static extern(C) 802 void ondestroy (GtkWidget *w, void* arg) { 803 (cast(browser_engine) arg).terminate(); 804 } 805 806 static extern(C) 807 void smr(WebKitUserContentManager* m, WebKitJavascriptResult* r, void* arg) { 808 auto w = cast(browser_engine) arg; 809 JSCValue *value = webkit_javascript_result_get_js_value(r); 810 auto s = jsc_value_to_string(value); 811 w.m_cb(s); 812 g_free(s); 813 } 814 815 this(msg_cb_t cb, bool dbg, void* window) { 816 m_cb = cb; 817 818 gtk_init_check(null, null); 819 m_window = cast(GtkWidget*) window; 820 if (m_window == null) 821 m_window = gtk_window_new(GtkWindowType.GTK_WINDOW_TOPLEVEL); 822 823 g_signal_connect_data(m_window, "destroy", &ondestroy, cast(void*) this, null, 0); 824 825 m_webview = webkit_web_view_new(); 826 WebKitUserContentManager* manager = webkit_web_view_get_user_content_manager(m_webview); 827 828 g_signal_connect_data(manager, "script-message-received::external", &smr, cast(void*) this, null, 0); 829 webkit_user_content_manager_register_script_message_handler(manager, "external"); 830 init("window.external={invoke:function(s){window.webkit.messageHandlers.external.postMessage(s);}}"); 831 832 gtk_container_add(m_window, m_webview); 833 gtk_widget_grab_focus(m_webview); 834 835 if (dbg) { 836 WebKitSettings *settings = webkit_web_view_get_settings(m_webview); 837 webkit_settings_set_enable_write_console_messages_to_stdout(settings, true); 838 webkit_settings_set_enable_developer_extras(settings, true); 839 } 840 841 gtk_widget_show_all(m_window); 842 } 843 void run() { gtk_main(); } 844 void terminate() { gtk_main_quit(); } 845 846 void navigate(const char *url) { 847 webkit_web_view_load_uri(m_webview, url); 848 } 849 850 void setTitle(const char* title) { 851 gtk_window_set_title(m_window, title); 852 } 853 854 /+ 855 void dispatch(std::function<void()> f) { 856 g_idle_add_full(G_PRIORITY_HIGH_IDLE, (GSourceFunc)([](void *f) -> int { 857 (*static_cast<dispatch_fn_t *>(f))(); 858 return G_SOURCE_REMOVE; 859 }), 860 new std::function<void()>(f), 861 [](void *f) { delete static_cast<dispatch_fn_t *>(f); }); 862 } 863 +/ 864 865 void setSize(int width, int height, bool resizable) { 866 gtk_window_set_resizable(m_window, resizable); 867 if (resizable) { 868 gtk_window_set_default_size(m_window, width, height); 869 } 870 gtk_widget_set_size_request(m_window, width, height); 871 } 872 873 void init(const char *js) { 874 WebKitUserContentManager *manager = webkit_web_view_get_user_content_manager(m_webview); 875 webkit_user_content_manager_add_script( 876 manager, webkit_user_script_new( 877 js, WebKitUserContentInjectedFrames.WEBKIT_USER_CONTENT_INJECT_TOP_FRAME, 878 WebKitUserScriptInjectionTime.WEBKIT_USER_SCRIPT_INJECT_AT_DOCUMENT_START, null, null)); 879 } 880 881 void eval(const char *js) { 882 webkit_web_view_run_javascript(m_webview, js, null, null, null); 883 } 884 885 protected: 886 GtkWidget* m_window; 887 GtkWidget* m_webview; 888 msg_cb_t m_cb; 889 } 890 } else version(WEBVIEW_COCOA) { 891 /+ 892 893 // 894 // ==================================================================== 895 // 896 // This implementation uses Cocoa WKWebView backend on macOS. It is 897 // written using ObjC runtime and uses WKWebView class as a browser runtime. 898 // You should pass "-framework Webkit" flag to the compiler. 899 // 900 // ==================================================================== 901 // 902 903 #define OBJC_OLD_DISPATCH_PROTOTYPES 1 904 #include <CoreGraphics/CoreGraphics.h> 905 #include <objc/objc-runtime.h> 906 907 #define NSBackingStoreBuffered 2 908 909 #define NSWindowStyleMaskResizable 8 910 #define NSWindowStyleMaskMiniaturizable 4 911 #define NSWindowStyleMaskTitled 1 912 #define NSWindowStyleMaskClosable 2 913 914 #define NSApplicationActivationPolicyRegular 0 915 916 #define WKUserScriptInjectionTimeAtDocumentStart 0 917 918 id operator"" _cls(const char *s, std::size_t sz) { 919 return (id)objc_getClass(s); 920 } 921 SEL operator"" _sel(const char *s, std::size_t sz) { 922 return sel_registerName(s); 923 } 924 id operator"" _str(const char *s, std::size_t sz) { 925 return objc_msgSend("NSString"_cls, "stringWithUTF8String:"_sel, s); 926 } 927 928 class browser_engine { 929 public: 930 browser_engine(msg_cb_t cb, bool dbg, void *window) : m_cb(cb) { 931 // Application 932 id app = objc_msgSend("NSApplication"_cls, "sharedApplication"_sel); 933 objc_msgSend(app, "setActivationPolicy:"_sel, 934 NSApplicationActivationPolicyRegular); 935 936 // Delegate 937 auto cls = objc_allocateClassPair((Class) "NSObject"_cls, "AppDelegate", 0); 938 class_addProtocol(cls, objc_getProtocol("NSApplicationDelegate")); 939 class_addProtocol(cls, objc_getProtocol("WKScriptMessageHandler")); 940 class_addMethod( 941 cls, "applicationShouldTerminateAfterLastWindowClosed:"_sel, 942 (IMP)(+[](id self, SEL cmd, id notification) -> BOOL { return 1; }), 943 "c@:@"); 944 class_addMethod( 945 cls, "userContentController:didReceiveScriptMessage:"_sel, 946 (IMP)(+[](id self, SEL cmd, id notification, id msg) { 947 auto w = (browser_engine *)objc_getAssociatedObject(self, "webview"); 948 w->m_cb((const char *)objc_msgSend(objc_msgSend(msg, "body"_sel), 949 "UTF8String"_sel)); 950 }), 951 "v@:@@"); 952 objc_registerClassPair(cls); 953 954 auto delegate = objc_msgSend((id)cls, "new"_sel); 955 objc_setAssociatedObject(delegate, "webview", (id)this, 956 OBJC_ASSOCIATION_ASSIGN); 957 objc_msgSend(app, sel_registerName("setDelegate:"), delegate); 958 959 // Main window 960 if (window is null) { 961 m_window = objc_msgSend("NSWindow"_cls, "alloc"_sel); 962 m_window = objc_msgSend( 963 m_window, "initWithContentRect:styleMask:backing:defer:"_sel, 964 CGRectMake(0, 0, 0, 0), 0, NSBackingStoreBuffered, 0); 965 setSize(480, 320, true); 966 } else { 967 m_window = (id)window; 968 } 969 970 // Webview 971 auto config = objc_msgSend("WKWebViewConfiguration"_cls, "new"_sel); 972 m_manager = objc_msgSend(config, "userContentController"_sel); 973 m_webview = objc_msgSend("WKWebView"_cls, "alloc"_sel); 974 objc_msgSend(m_webview, "initWithFrame:configuration:"_sel, 975 CGRectMake(0, 0, 0, 0), config); 976 objc_msgSend(m_manager, "addScriptMessageHandler:name:"_sel, delegate, 977 "external"_str); 978 init(R"script( 979 window.external = { 980 invoke: function(s) { 981 window.webkit.messageHandlers.external.postMessage(s); 982 }, 983 }; 984 )script"); 985 if (dbg) { 986 objc_msgSend(objc_msgSend(config, "preferences"_sel), 987 "setValue:forKey:"_sel, 1, "developerExtrasEnabled"_str); 988 } 989 objc_msgSend(m_window, "setContentView:"_sel, m_webview); 990 objc_msgSend(m_window, "makeKeyAndOrderFront:"_sel, null); 991 } 992 ~browser_engine() { close(); } 993 void terminate() { close(); objc_msgSend("NSApp"_cls, "terminate:"_sel, null); } 994 void run() { 995 id app = objc_msgSend("NSApplication"_cls, "sharedApplication"_sel); 996 dispatch([&]() { objc_msgSend(app, "activateIgnoringOtherApps:"_sel, 1); }); 997 objc_msgSend(app, "run"_sel); 998 } 999 void dispatch(std::function<void()> f) { 1000 dispatch_async_f(dispatch_get_main_queue(), new dispatch_fn_t(f), 1001 (dispatch_function_t)([](void *arg) { 1002 auto f = static_cast<dispatch_fn_t *>(arg); 1003 (*f)(); 1004 delete f; 1005 })); 1006 } 1007 void setTitle(const char *title) { 1008 objc_msgSend( 1009 m_window, "setTitle:"_sel, 1010 objc_msgSend("NSString"_cls, "stringWithUTF8String:"_sel, title)); 1011 } 1012 void setSize(int width, int height, bool resizable) { 1013 auto style = NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | 1014 NSWindowStyleMaskMiniaturizable; 1015 if (resizable) { 1016 style = style | NSWindowStyleMaskResizable; 1017 } 1018 objc_msgSend(m_window, "setStyleMask:"_sel, style); 1019 objc_msgSend(m_window, "setFrame:display:animate:"_sel, 1020 CGRectMake(0, 0, width, height), 1, 0); 1021 } 1022 void navigate(const char *url) { 1023 auto nsurl = objc_msgSend( 1024 "NSURL"_cls, "URLWithString:"_sel, 1025 objc_msgSend("NSString"_cls, "stringWithUTF8String:"_sel, url)); 1026 objc_msgSend( 1027 m_webview, "loadRequest:"_sel, 1028 objc_msgSend("NSURLRequest"_cls, "requestWithURL:"_sel, nsurl)); 1029 } 1030 void init(const char *js) { 1031 objc_msgSend( 1032 m_manager, "addUserScript:"_sel, 1033 objc_msgSend( 1034 objc_msgSend("WKUserScript"_cls, "alloc"_sel), 1035 "initWithSource:injectionTime:forMainFrameOnly:"_sel, 1036 objc_msgSend("NSString"_cls, "stringWithUTF8String:"_sel, js), 1037 WKUserScriptInjectionTimeAtDocumentStart, 1)); 1038 } 1039 void eval(const char *js) { 1040 objc_msgSend(m_webview, "evaluateJavaScript:completionHandler:"_sel, 1041 objc_msgSend("NSString"_cls, "stringWithUTF8String:"_sel, js), 1042 null); 1043 } 1044 1045 protected: 1046 void close() { objc_msgSend(m_window, "close"_sel); } 1047 id m_window; 1048 id m_webview; 1049 id m_manager; 1050 msg_cb_t m_cb; 1051 }; 1052 1053 +/ 1054 1055 } 1056 1057 version(cef) { 1058 1059 /++ 1060 This creates a base class for a thing to help you implement the function pointers. 1061 1062 class MyApp : CEF!cef_app_t { 1063 1064 } 1065 +/ 1066 abstract class CEF(Base) { 1067 private struct Inner { 1068 Base c; 1069 CEF d_object; 1070 } 1071 private Inner inner; 1072 1073 this() nothrow { 1074 if(!__ctfe) construct(); 1075 } 1076 1077 // ONLY call this if you did a ctfe construction 1078 void construct() nothrow { 1079 assert(inner.c.base.size == 0); 1080 1081 import core.memory; 1082 GC.addRoot(cast(void*) this); 1083 inner.c.base.size = Inner.sizeof; 1084 inner.c.base.add_ref = &c_add_ref; 1085 inner.c.base.release = &c_release; 1086 inner.c.base.has_one_ref = &c_has_one_ref; 1087 inner.c.base.has_at_least_one_ref = &c_has_at_least_one_ref; 1088 inner.d_object = this; 1089 1090 static foreach(memberName; __traits(allMembers, Base)) { 1091 static if(is(typeof(__traits(getMember, Base, memberName)) == return)) { 1092 __traits(getMember, inner.c, memberName) = mixin("&c_" ~ memberName); 1093 } 1094 } 1095 } 1096 1097 private static nothrow @nogc extern(System) { 1098 void c_add_ref(cef_base_ref_counted_t* self) { 1099 return ((cast(Inner*) self).d_object).add_ref(); 1100 } 1101 int c_release(cef_base_ref_counted_t* self) { 1102 return ((cast(Inner*) self).d_object).release(); 1103 } 1104 int c_has_one_ref(cef_base_ref_counted_t* self) { 1105 return ((cast(Inner*) self).d_object).has_one_ref(); 1106 } 1107 int c_has_at_least_one_ref(cef_base_ref_counted_t* self) { 1108 return ((cast(Inner*) self).d_object).has_at_least_one_ref(); 1109 } 1110 } 1111 1112 private shared(int) refcount = 1; 1113 final void add_ref() { 1114 import core.atomic; 1115 atomicOp!"+="(refcount, 1); 1116 } 1117 final int release() { 1118 import core.atomic; 1119 auto v = atomicOp!"-="(refcount, 1); 1120 if(v == 0) { 1121 import core.memory; 1122 GC.removeRoot(cast(void*) this); 1123 return 1; 1124 } 1125 return 0; 1126 } 1127 final int has_one_ref() { 1128 return (cast() refcount) == 1; 1129 } 1130 final int has_at_least_one_ref() { 1131 return (cast() refcount) >= 1; 1132 } 1133 1134 /// Call this to pass to CEF. It will add ref for you. 1135 final Base* passable() { 1136 assert(inner.c.base.size); 1137 add_ref(); 1138 return returnable(); 1139 } 1140 1141 final Base* returnable() { 1142 assert(inner.c.base.size); 1143 return &inner.c; 1144 } 1145 1146 static foreach(memberName; __traits(allMembers, Base)) { 1147 static if(is(typeof(__traits(getMember, Base, memberName)) == return)) { 1148 mixin AbstractMethod!(memberName); 1149 } else { 1150 mixin(q{final ref @property } ~ memberName ~ q{() { return __traits(getMember, inner.c, memberName); }}); 1151 } 1152 } 1153 } 1154 1155 // you implement this in D... 1156 private mixin template AbstractMethod(string name) { 1157 alias ptr = typeof(__traits(getMember, Base, name)); 1158 static if(is(ptr Return == return)) 1159 static if(is(typeof(*ptr) Params == function)) 1160 { 1161 mixin(q{abstract nothrow Return } ~ name ~ q{(CefToD!(Params[1 .. $]) p);}); 1162 // mixin(q{abstract nothrow Return } ~ name ~ q{(Params[1 .. $] p);}); 1163 1164 mixin(q{ 1165 private static nothrow extern(System) 1166 Return c_}~name~q{(Params p) { 1167 Base* self = p[0]; // a bit of a type check here... 1168 auto dobj = (cast(Inner*) self).d_object; // ...before this cast. 1169 1170 //return __traits(getMember, dobj, name)(p[1 .. $]); 1171 mixin(() { 1172 string code = "return __traits(getMember, dobj, name)("; 1173 1174 static foreach(idx; 1 .. p.length) { 1175 if(idx > 1) 1176 code ~= ", "; 1177 code ~= "cefToD(p[" ~ idx.stringof ~ "])"; 1178 } 1179 code ~= ");"; 1180 return code; 1181 }()); 1182 } 1183 }); 1184 } 1185 else static assert(0, name ~ " params"); 1186 else static assert(0, name ~ " return"); 1187 } 1188 1189 // you call this from D... 1190 private mixin template ForwardMethod(string name) { 1191 alias ptr = typeof(__traits(getMember, Base, name)); 1192 static if(is(ptr Return == return)) 1193 static if(is(typeof(*ptr) Params == function)) 1194 { 1195 mixin(q{nothrow auto } ~ name ~ q{(Params[1 .. $] p) { 1196 Base* self = inner; // a bit of a type check here... 1197 static if(is(Return == void)) 1198 return __traits(getMember, inner, name)(self, p); 1199 else 1200 return cefToD(__traits(getMember, inner, name)(self, p)); 1201 }}); 1202 } 1203 else static assert(0, name ~ " params"); 1204 else static assert(0, name ~ " return"); 1205 } 1206 1207 1208 private alias AliasSeq(T...) = T; 1209 1210 private template CefToD(T...) { 1211 static if(T.length == 0) { 1212 alias CefToD = T; 1213 } else static if(T.length == 1) { 1214 static if(is(typeof(T[0].base) == cef_base_ref_counted_t)) { 1215 alias CefToD = RC!(typeof(*T[0])); 1216 /+ 1217 static if(is(T[0] == I*, I)) { 1218 alias CefToD = CEF!(I); 1219 } else static assert(0, T[0]); 1220 +/ 1221 } else 1222 alias CefToD = T[0]; 1223 } else { 1224 alias CefToD = AliasSeq!(CefToD!(T[0]), CefToD!(T[1..$])); 1225 1226 } 1227 } 1228 1229 enum activeEngine = WebviewEngine.cef; 1230 1231 struct RC(Base) { 1232 private Base* inner; 1233 1234 this(Base* t) nothrow { 1235 inner = t; 1236 // assuming the refcount is already set here 1237 } 1238 this(this) nothrow { 1239 if(inner is null) return; 1240 inner.base.add_ref(&inner.base); 1241 } 1242 ~this() nothrow { 1243 if(inner is null) return; 1244 inner.base.release(&inner.base); 1245 inner = null; 1246 //sdpyPrintDebugString("omg release"); 1247 } 1248 bool opCast(T:bool)() nothrow { 1249 return inner !is null; 1250 } 1251 1252 Base* getRawPointer() nothrow { 1253 return inner; 1254 } 1255 1256 Base* passable() nothrow { 1257 if(inner is null) 1258 return inner; 1259 1260 inner.base.add_ref(&inner.base); 1261 return inner; 1262 } 1263 1264 static foreach(memberName; __traits(allMembers, Base)) { 1265 static if(is(typeof(__traits(getMember, Base, memberName)) == return)) { 1266 mixin ForwardMethod!(memberName); 1267 } else { 1268 mixin(q{final ref @property } ~ memberName ~ q{() { return __traits(getMember, inner, memberName); }}); 1269 } 1270 } 1271 } 1272 1273 auto cefToD(T)(T t) { 1274 static if(is(typeof(T.base) == cef_base_ref_counted_t)) { 1275 return RC!(typeof(*T))(t); 1276 } else { 1277 return t; 1278 } 1279 } 1280 1281 1282 string toGC(const cef_string_utf16_t str) nothrow { 1283 if(str.str is null) 1284 return null; 1285 1286 string s; 1287 s.reserve(str.length); 1288 1289 try 1290 foreach(char ch; str.str[0 .. str.length]) 1291 s ~= ch; 1292 catch(Exception e) {} 1293 return s; 1294 } 1295 1296 string toGC(const cef_string_utf16_t* str) nothrow { 1297 if(str is null) 1298 return null; 1299 return toGC(*str); 1300 } 1301 1302 string toGCAndFree(const cef_string_userfree_t str) nothrow { 1303 if(str is null) 1304 return null; 1305 1306 string s = toGC(str); 1307 libcef.string_userfree_utf16_free(str); 1308 //str = null; 1309 return s; 1310 } 1311 1312 // bindings follow, first some hand-written ones for Linux, then some machine translated things. More comments about the machine translation when it comes. 1313 1314 version(linux) 1315 struct cef_main_args_t { 1316 int argc; 1317 char** argv; 1318 } 1319 version(Windows) 1320 struct cef_main_args_t { 1321 HINSTANCE instance; 1322 } 1323 1324 // 0 - CEF_VERSION_MAJOR 1325 // 1 - CEF_VERSION_MINOR 1326 // 2 - CEF_VERSION_PATCH 1327 // 3 - CEF_COMMIT_NUMBER 1328 // 4 - CHROME_VERSION_MAJOR 1329 // 5 - CHROME_VERSION_MINOR 1330 // 6 - CHROME_VERSION_BUILD 1331 // 7 - CHROME_VERSION_PATCH 1332 1333 extern(C) nothrow 1334 int cef_string_utf8_to_utf16(const char* src, size_t src_len, cef_string_utf16_t* output); 1335 1336 struct cef_string_utf8_t { 1337 char* str; 1338 size_t length; 1339 void* dtor;// void (*dtor)(char* str); 1340 } 1341 1342 struct cef_basetime_t { 1343 long val; 1344 } 1345 1346 1347 struct cef_string_utf16_t { 1348 char16* str; 1349 size_t length; 1350 void* dtor; // voiod (*dtor)(char16* str); 1351 1352 this(wstring s) nothrow { 1353 this.str = cast(char16*) s.ptr; 1354 this.length = s.length; 1355 } 1356 1357 this(string s) nothrow { 1358 libcef.string_utf8_to_utf16(s.ptr, s.length, &this); 1359 } 1360 } 1361 1362 alias cef_string_t = cef_string_utf16_t; 1363 alias cef_window_handle_t = NativeWindowHandle; 1364 version(Windows) 1365 alias cef_cursor_handle_t = HCURSOR; 1366 else 1367 alias cef_cursor_handle_t = XID; 1368 1369 struct cef_time_t { 1370 int year; // Four or five digit year "2007" (1601 to 30827 on 1371 // Windows, 1970 to 2038 on 32-bit POSIX) 1372 int month; // 1-based month (values 1 = January, etc.) 1373 int day_of_week; // 0-based day of week (0 = Sunday, etc.) 1374 int day_of_month; // 1-based day of month (1-31) 1375 int hour; // Hour within the current day (0-23) 1376 int minute; // Minute within the current hour (0-59) 1377 int second; // Second within the current minute (0-59 plus leap 1378 // seconds which may take it up to 60). 1379 int millisecond; // Milliseconds within the current second (0-999) 1380 } 1381 1382 version(linux) 1383 struct cef_window_info_t { 1384 cef_string_t window_name; 1385 1386 uint x; 1387 uint y; 1388 uint width; 1389 uint height; 1390 1391 cef_window_handle_t parent_window; 1392 1393 int windowless_rendering_enabled; 1394 1395 int shared_texture_enabled; 1396 1397 int external_begin_frame_enabled; 1398 1399 cef_window_handle_t window; 1400 } 1401 1402 version(Windows) 1403 struct cef_window_info_t { 1404 DWORD ex_style; 1405 cef_string_t window_name; 1406 DWORD style; 1407 cef_rect_t bounds; 1408 cef_window_handle_t parent_window; 1409 HMENU menu; 1410 int windowless_rendering_enabled; 1411 int shared_texture_enabled; 1412 int external_begin_frame_enabled; 1413 cef_window_handle_t window; 1414 } 1415 1416 1417 1418 import core.stdc.config; 1419 alias int16 = short; 1420 alias uint16 = ushort; 1421 alias int32 = int; 1422 alias uint32 = uint; 1423 alias char16 = wchar; 1424 alias int64 = long; 1425 alias uint64 = ulong; 1426 1427 // these are supposed to just be opaque pointers but i want some type safety. this same abi wise.......... RIGHT? 1428 struct cef_string_list_t { void* r; } 1429 struct cef_string_multimap_t { void* r; } 1430 struct cef_string_map_t { void* r; } 1431 1432 1433 extern(C) nothrow { 1434 cef_string_list_t cef_string_list_alloc(); 1435 size_t cef_string_list_size(cef_string_list_t list); 1436 int cef_string_list_value(cef_string_list_t list, size_t index, cef_string_t* value); 1437 void cef_string_list_append(cef_string_list_t list, const cef_string_t* value); 1438 void cef_string_list_clear(cef_string_list_t list); 1439 void cef_string_list_free(cef_string_list_t list); 1440 cef_string_list_t cef_string_list_copy(cef_string_list_t list); 1441 } 1442 1443 1444 version(linux) { 1445 import core.sys.posix.sys.types; 1446 alias pid_t cef_platform_thread_id_t; 1447 alias OS_EVENT = XEvent; 1448 } else { 1449 import core.sys.windows.windows; 1450 alias HANDLE cef_platform_thread_id_t; 1451 alias OS_EVENT = void; 1452 } 1453 1454 nothrow @nogc extern(C) void cef_string_userfree_utf16_free(const cef_string_userfree_utf16_t str); 1455 struct cef_string_userfree_utf16_t { cef_string_utf16_t* it; alias it this; } 1456 alias cef_string_userfree_t = cef_string_userfree_utf16_t; 1457 1458 // ************** 1459 1460 // cef/include/capi$ for i in *.h; do dstep -I../.. $i; done 1461 // also dstep include/cef_version.h 1462 // update the CEF_VERSION and the CEF_API_HASH_UNIVERSAL out of cef_version.h and cef_api_hash.h 1463 // then concatenate the bodies of them and delete the translated macros and `struct .*;` stuff 1464 // 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 1465 // then select all and global replace s/_cef/cef/g 1466 // 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. 1467 1468 // and make sure version(linux) void cef_register_widevine_cdm ( if it is there. 1469 1470 // and extern (C) is wrong on the callbacks, they should all be extern(System) 1471 // `/function (<ENTER>Oextern(System)<ESC>` 1472 1473 1474 version=embedded_cef_bindings; 1475 1476 // everything inside these brackets are the bindings you can replace if update needed 1477 1478 version(embedded_cef_bindings) { 1479 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 1480 // 1481 // Redistribution and use in source and binary forms, with or without 1482 // modification, are permitted provided that the following conditions are 1483 // met: 1484 // 1485 // * Redistributions of source code must retain the above copyright 1486 // notice, this list of conditions and the following disclaimer. 1487 // * Redistributions in binary form must reproduce the above 1488 // copyright notice, this list of conditions and the following disclaimer 1489 // in the documentation and/or other materials provided with the 1490 // distribution. 1491 // * Neither the name of Google Inc. nor the name Chromium Embedded 1492 // Framework nor the names of its contributors may be used to endorse 1493 // or promote products derived from this software without specific prior 1494 // written permission. 1495 // 1496 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1497 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 1498 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 1499 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 1500 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 1501 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 1502 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 1503 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 1504 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 1505 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 1506 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 1507 // 1508 // --------------------------------------------------------------------------- 1509 // 1510 // This file was generated by the make_version_header.py tool. 1511 // 1512 1513 extern (C): 1514 1515 enum CEF_VERSION = "107.1.9+g1f0a21a+chromium-107.0.5304.110"; 1516 enum CEF_VERSION_MAJOR = 107; 1517 enum CEF_VERSION_MINOR = 1; 1518 enum CEF_VERSION_PATCH = 9; 1519 enum CEF_COMMIT_NUMBER = 2687; 1520 enum CEF_COMMIT_HASH = "1f0a21a25e61786ef3e8b3a20908e7631ad29c71"; 1521 enum COPYRIGHT_YEAR = 2022; 1522 1523 enum CHROME_VERSION_MAJOR = 107; 1524 enum CHROME_VERSION_MINOR = 0; 1525 enum CHROME_VERSION_BUILD = 5304; 1526 enum CHROME_VERSION_PATCH = 110; 1527 1528 1529 1530 // Returns CEF version information for the libcef library. The |entry| 1531 // parameter describes which version component will be returned: 1532 // 0 - CEF_VERSION_MAJOR 1533 // 1 - CEF_VERSION_MINOR 1534 // 2 - CEF_VERSION_PATCH 1535 // 3 - CEF_COMMIT_NUMBER 1536 // 4 - CHROME_VERSION_MAJOR 1537 // 5 - CHROME_VERSION_MINOR 1538 // 6 - CHROME_VERSION_BUILD 1539 // 7 - CHROME_VERSION_PATCH 1540 /// 1541 int cef_version_info (int entry); 1542 1543 // APSTUDIO_HIDDEN_SYMBOLS 1544 1545 // CEF_INCLUDE_CEF_VERSION_H_ 1546 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 1547 // 1548 // Redistribution and use in source and binary forms, with or without 1549 // modification, are permitted provided that the following conditions are 1550 // met: 1551 // 1552 // * Redistributions of source code must retain the above copyright 1553 // notice, this list of conditions and the following disclaimer. 1554 // * Redistributions in binary form must reproduce the above 1555 // copyright notice, this list of conditions and the following disclaimer 1556 // in the documentation and/or other materials provided with the 1557 // distribution. 1558 // * Neither the name of Google Inc. nor the name Chromium Embedded 1559 // Framework nor the names of its contributors may be used to endorse 1560 // or promote products derived from this software without specific prior 1561 // written permission. 1562 // 1563 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1564 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 1565 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 1566 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 1567 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 1568 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 1569 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 1570 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 1571 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 1572 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 1573 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 1574 // 1575 // --------------------------------------------------------------------------- 1576 // 1577 // This file was generated by the make_api_hash_header.py tool. 1578 // 1579 1580 extern (C): 1581 1582 // The API hash is created by analyzing CEF header files for C API type 1583 // definitions. The hash value will change when header files are modified in a 1584 // way that may cause binary incompatibility with other builds. The universal 1585 // hash value will change if any platform is affected whereas the platform hash 1586 // values will change only if that particular platform is affected. 1587 enum CEF_API_HASH_UNIVERSAL = "a63640eaa583092b069ec9895526b3e9e4932f6a"; 1588 1589 enum CEF_API_HASH_PLATFORM = "d9657b0023ae05b5b92787b5e7da70893caf15af"; 1590 1591 /// 1592 // Returns CEF API hashes for the libcef library. The returned string is owned 1593 // by the library and should not be freed. The |entry| parameter describes which 1594 // hash value will be returned: 1595 // 0 - CEF_API_HASH_PLATFORM 1596 // 1 - CEF_API_HASH_UNIVERSAL 1597 // 2 - CEF_COMMIT_HASH (from cef_version.h) 1598 /// 1599 const(char)* cef_api_hash (int entry); 1600 1601 // CEF_INCLUDE_API_HASH_H_ 1602 // Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. 1603 // 1604 // Redistribution and use in source and binary forms, with or without 1605 // modification, are permitted provided that the following conditions are 1606 // met: 1607 // 1608 // * Redistributions of source code must retain the above copyright 1609 // notice, this list of conditions and the following disclaimer. 1610 // * Redistributions in binary form must reproduce the above 1611 // copyright notice, this list of conditions and the following disclaimer 1612 // in the documentation and/or other materials provided with the 1613 // distribution. 1614 // * Neither the name of Google Inc. nor the name Chromium Embedded 1615 // Framework nor the names of its contributors may be used to endorse 1616 // or promote products derived from this software without specific prior 1617 // written permission. 1618 // 1619 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1620 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 1621 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 1622 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 1623 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 1624 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 1625 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 1626 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 1627 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 1628 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 1629 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 1630 1631 extern (C): 1632 1633 /// 1634 /// Structure representing a point. 1635 /// 1636 struct cef_point_t 1637 { 1638 int x; 1639 int y; 1640 } 1641 1642 1643 1644 /// 1645 /// Structure representing a rectangle. 1646 /// 1647 struct cef_rect_t 1648 { 1649 int x; 1650 int y; 1651 int width; 1652 int height; 1653 } 1654 1655 1656 1657 /// 1658 /// Structure representing a size. 1659 /// 1660 struct cef_size_t 1661 { 1662 int width; 1663 int height; 1664 } 1665 1666 1667 1668 /// 1669 /// Structure representing insets. 1670 /// 1671 struct cef_insets_t 1672 { 1673 int top; 1674 int left; 1675 int bottom; 1676 int right; 1677 } 1678 1679 1680 1681 // CEF_INCLUDE_INTERNAL_CEF_TYPES_GEOMETRY_H_ 1682 // Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. 1683 // 1684 // Redistribution and use in source and binary forms, with or without 1685 // modification, are permitted provided that the following conditions are 1686 // met: 1687 // 1688 // * Redistributions of source code must retain the above copyright 1689 // notice, this list of conditions and the following disclaimer. 1690 // * Redistributions in binary form must reproduce the above 1691 // copyright notice, this list of conditions and the following disclaimer 1692 // in the documentation and/or other materials provided with the 1693 // distribution. 1694 // * Neither the name of Google Inc. nor the name Chromium Embedded 1695 // Framework nor the names of its contributors may be used to endorse 1696 // or promote products derived from this software without specific prior 1697 // written permission. 1698 // 1699 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1700 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 1701 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 1702 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 1703 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 1704 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 1705 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 1706 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 1707 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 1708 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 1709 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 1710 1711 import core.stdc.limits; 1712 1713 extern (C): 1714 1715 // Bring in platform-specific definitions. 1716 1717 // 32-bit ARGB color value, not premultiplied. The color components are always 1718 // in a known order. Equivalent to the SkColor type. 1719 alias cef_color_t = uint; 1720 1721 // Return the alpha byte from a cef_color_t value. 1722 1723 1724 // Return the red byte from a cef_color_t value. 1725 1726 1727 // Return the green byte from a cef_color_t value. 1728 1729 1730 // Return the blue byte from a cef_color_t value. 1731 1732 1733 // Return an cef_color_t value with the specified byte component values. 1734 1735 1736 // Return an int64 value with the specified low and high int32 component values. 1737 1738 1739 // Return the low int32 value from an int64 value. 1740 1741 1742 // Return the high int32 value from an int64 value. 1743 1744 1745 /// 1746 /// Log severity levels. 1747 /// 1748 enum cef_log_severity_t 1749 { 1750 /// 1751 /// Default logging (currently INFO logging). 1752 /// 1753 LOGSEVERITY_DEFAULT = 0, 1754 1755 /// 1756 /// Verbose logging. 1757 /// 1758 LOGSEVERITY_VERBOSE = 1, 1759 1760 /// 1761 /// DEBUG logging. 1762 /// 1763 LOGSEVERITY_DEBUG = LOGSEVERITY_VERBOSE, 1764 1765 /// 1766 /// INFO logging. 1767 /// 1768 LOGSEVERITY_INFO = 2, 1769 1770 /// 1771 /// WARNING logging. 1772 /// 1773 LOGSEVERITY_WARNING = 3, 1774 1775 /// 1776 /// ERROR logging. 1777 /// 1778 LOGSEVERITY_ERROR = 4, 1779 1780 /// 1781 /// FATAL logging. 1782 /// 1783 LOGSEVERITY_FATAL = 5, 1784 1785 /// 1786 /// Disable logging to file for all messages, and to stderr for messages with 1787 /// severity less than FATAL. 1788 /// 1789 LOGSEVERITY_DISABLE = 99 1790 } 1791 1792 /// 1793 /// Represents the state of a setting. 1794 /// 1795 enum cef_state_t 1796 { 1797 /// 1798 /// Use the default state for the setting. 1799 /// 1800 STATE_DEFAULT = 0, 1801 1802 /// 1803 /// Enable or allow the setting. 1804 /// 1805 STATE_ENABLED = 1, 1806 1807 /// 1808 /// Disable or disallow the setting. 1809 /// 1810 STATE_DISABLED = 2 1811 } 1812 1813 /// 1814 /// Initialization settings. Specify NULL or 0 to get the recommended default 1815 /// values. Many of these and other settings can also configured using command- 1816 /// line switches. 1817 /// 1818 struct cef_settings_t 1819 { 1820 /// 1821 /// Size of this structure. 1822 /// 1823 size_t size; 1824 1825 /// 1826 /// Set to true (1) to disable the sandbox for sub-processes. See 1827 /// cef_sandbox_win.h for requirements to enable the sandbox on Windows. Also 1828 /// configurable using the "no-sandbox" command-line switch. 1829 /// 1830 int no_sandbox; 1831 1832 /// 1833 /// The path to a separate executable that will be launched for sub-processes. 1834 /// If this value is empty on Windows or Linux then the main process 1835 /// executable will be used. If this value is empty on macOS then a helper 1836 /// executable must exist at "Contents/Frameworks/<app> 1837 /// Helper.app/Contents/MacOS/<app> Helper" in the top-level app bundle. See 1838 /// the comments on CefExecuteProcess() for details. If this value is 1839 /// non-empty then it must be an absolute path. Also configurable using the 1840 /// "browser-subprocess-path" command-line switch. 1841 /// 1842 cef_string_t browser_subprocess_path; 1843 1844 /// 1845 /// The path to the CEF framework directory on macOS. If this value is empty 1846 /// then the framework must exist at "Contents/Frameworks/Chromium Embedded 1847 /// Framework.framework" in the top-level app bundle. If this value is 1848 /// non-empty then it must be an absolute path. Also configurable using the 1849 /// "framework-dir-path" command-line switch. 1850 /// 1851 cef_string_t framework_dir_path; 1852 1853 /// 1854 /// The path to the main bundle on macOS. If this value is empty then it 1855 /// defaults to the top-level app bundle. If this value is non-empty then it 1856 /// must be an absolute path. Also configurable using the "main-bundle-path" 1857 /// command-line switch. 1858 /// 1859 cef_string_t main_bundle_path; 1860 1861 /// 1862 /// Set to true (1) to enable use of the Chrome runtime in CEF. This feature 1863 /// is considered experimental and is not recommended for most users at this 1864 /// time. See issue #2969 for details. 1865 /// 1866 int chrome_runtime; 1867 1868 /// 1869 /// Set to true (1) to have the browser process message loop run in a separate 1870 /// thread. If false (0) then the CefDoMessageLoopWork() function must be 1871 /// called from your application message loop. This option is only supported 1872 /// on Windows and Linux. 1873 /// 1874 int multi_threaded_message_loop; 1875 1876 /// 1877 /// Set to true (1) to control browser process main (UI) thread message pump 1878 /// scheduling via the CefBrowserProcessHandler::OnScheduleMessagePumpWork() 1879 /// callback. This option is recommended for use in combination with the 1880 /// CefDoMessageLoopWork() function in cases where the CEF message loop must 1881 /// be integrated into an existing application message loop (see additional 1882 /// comments and warnings on CefDoMessageLoopWork). Enabling this option is 1883 /// not recommended for most users; leave this option disabled and use either 1884 /// the CefRunMessageLoop() function or multi_threaded_message_loop if 1885 /// possible. 1886 /// 1887 int external_message_pump; 1888 1889 /// 1890 /// Set to true (1) to enable windowless (off-screen) rendering support. Do 1891 /// not enable this value if the application does not use windowless rendering 1892 /// as it may reduce rendering performance on some systems. 1893 /// 1894 int windowless_rendering_enabled; 1895 1896 /// 1897 /// Set to true (1) to disable configuration of browser process features using 1898 /// standard CEF and Chromium command-line arguments. Configuration can still 1899 /// be specified using CEF data structures or via the 1900 /// CefApp::OnBeforeCommandLineProcessing() method. 1901 /// 1902 int command_line_args_disabled; 1903 1904 /// 1905 /// The location where data for the global browser cache will be stored on 1906 /// disk. If this value is non-empty then it must be an absolute path that is 1907 /// either equal to or a child directory of CefSettings.root_cache_path. If 1908 /// this value is empty then browsers will be created in "incognito mode" 1909 /// where in-memory caches are used for storage and no data is persisted to 1910 /// disk. HTML5 databases such as localStorage will only persist across 1911 /// sessions if a cache path is specified. Can be overridden for individual 1912 /// CefRequestContext instances via the CefRequestContextSettings.cache_path 1913 /// value. When using the Chrome runtime the "default" profile will be used if 1914 /// |cache_path| and |root_cache_path| have the same value. 1915 /// 1916 cef_string_t cache_path; 1917 1918 /// 1919 /// The root directory that all CefSettings.cache_path and 1920 /// CefRequestContextSettings.cache_path values must have in common. If this 1921 /// value is empty and CefSettings.cache_path is non-empty then it will 1922 /// default to the CefSettings.cache_path value. If this value is non-empty 1923 /// then it must be an absolute path. Failure to set this value correctly may 1924 /// result in the sandbox blocking read/write access to the cache_path 1925 /// directory. 1926 /// 1927 cef_string_t root_cache_path; 1928 1929 /// 1930 /// The location where user data such as the Widevine CDM module and spell 1931 /// checking dictionary files will be stored on disk. If this value is empty 1932 /// then the default platform-specific user data directory will be used 1933 /// ("~/.config/cef_user_data" directory on Linux, "~/Library/Application 1934 /// Support/CEF/User Data" directory on MacOS, "AppData\Local\CEF\User Data" 1935 /// directory under the user profile directory on Windows). If this value is 1936 /// non-empty then it must be an absolute path. When using the Chrome runtime 1937 /// this value will be ignored in favor of the |root_cache_path| value. 1938 /// 1939 cef_string_t user_data_path; 1940 1941 /// 1942 /// To persist session cookies (cookies without an expiry date or validity 1943 /// interval) by default when using the global cookie manager set this value 1944 /// to true (1). Session cookies are generally intended to be transient and 1945 /// most Web browsers do not persist them. A |cache_path| value must also be 1946 /// specified to enable this feature. Also configurable using the 1947 /// "persist-session-cookies" command-line switch. Can be overridden for 1948 /// individual CefRequestContext instances via the 1949 /// CefRequestContextSettings.persist_session_cookies value. 1950 /// 1951 int persist_session_cookies; 1952 1953 /// 1954 /// To persist user preferences as a JSON file in the cache path directory set 1955 /// this value to true (1). A |cache_path| value must also be specified 1956 /// to enable this feature. Also configurable using the 1957 /// "persist-user-preferences" command-line switch. Can be overridden for 1958 /// individual CefRequestContext instances via the 1959 /// CefRequestContextSettings.persist_user_preferences value. 1960 /// 1961 int persist_user_preferences; 1962 1963 /// 1964 /// Value that will be returned as the User-Agent HTTP header. If empty the 1965 /// default User-Agent string will be used. Also configurable using the 1966 /// "user-agent" command-line switch. 1967 /// 1968 cef_string_t user_agent; 1969 1970 /// 1971 /// Value that will be inserted as the product portion of the default 1972 /// User-Agent string. If empty the Chromium product version will be used. If 1973 /// |userAgent| is specified this value will be ignored. Also configurable 1974 /// using the "user-agent-product" command-line switch. 1975 /// 1976 cef_string_t user_agent_product; 1977 1978 /// 1979 /// The locale string that will be passed to WebKit. If empty the default 1980 /// locale of "en-US" will be used. This value is ignored on Linux where 1981 /// locale is determined using environment variable parsing with the 1982 /// precedence order: LANGUAGE, LC_ALL, LC_MESSAGES and LANG. Also 1983 /// configurable using the "lang" command-line switch. 1984 /// 1985 cef_string_t locale; 1986 1987 /// 1988 /// The directory and file name to use for the debug log. If empty a default 1989 /// log file name and location will be used. On Windows and Linux a 1990 /// "debug.log" file will be written in the main executable directory. On 1991 /// MacOS a "~/Library/Logs/[app name]_debug.log" file will be written where 1992 /// [app name] is the name of the main app executable. Also configurable using 1993 /// the "log-file" command-line switch. 1994 /// 1995 cef_string_t log_file; 1996 1997 /// 1998 /// The log severity. Only messages of this severity level or higher will be 1999 /// logged. When set to DISABLE no messages will be written to the log file, 2000 /// but FATAL messages will still be output to stderr. Also configurable using 2001 /// the "log-severity" command-line switch with a value of "verbose", "info", 2002 /// "warning", "error", "fatal" or "disable". 2003 /// 2004 cef_log_severity_t log_severity; 2005 2006 /// 2007 /// Custom flags that will be used when initializing the V8 JavaScript engine. 2008 /// The consequences of using custom flags may not be well tested. Also 2009 /// configurable using the "js-flags" command-line switch. 2010 /// 2011 cef_string_t javascript_flags; 2012 2013 /// 2014 /// The fully qualified path for the resources directory. If this value is 2015 /// empty the *.pak files must be located in the module directory on 2016 /// Windows/Linux or the app bundle Resources directory on MacOS. If this 2017 /// value is non-empty then it must be an absolute path. Also configurable 2018 /// using the "resources-dir-path" command-line switch. 2019 /// 2020 cef_string_t resources_dir_path; 2021 2022 /// 2023 /// The fully qualified path for the locales directory. If this value is empty 2024 /// the locales directory must be located in the module directory. If this 2025 /// value is non-empty then it must be an absolute path. This value is ignored 2026 /// on MacOS where pack files are always loaded from the app bundle Resources 2027 /// directory. Also configurable using the "locales-dir-path" command-line 2028 /// switch. 2029 /// 2030 cef_string_t locales_dir_path; 2031 2032 /// 2033 /// Set to true (1) to disable loading of pack files for resources and 2034 /// locales. A resource bundle handler must be provided for the browser and 2035 /// render processes via CefApp::GetResourceBundleHandler() if loading of pack 2036 /// files is disabled. Also configurable using the "disable-pack-loading" 2037 /// command- line switch. 2038 /// 2039 int pack_loading_disabled; 2040 2041 /// 2042 /// Set to a value between 1024 and 65535 to enable remote debugging on the 2043 /// specified port. Also configurable using the "remote-debugging-port" 2044 /// command-line switch. Remote debugging can be accessed by loading the 2045 /// chrome://inspect page in Google Chrome. Port numbers 9222 and 9229 are 2046 /// discoverable by default. Other port numbers may need to be configured via 2047 /// "Discover network targets" on the Devices tab. 2048 /// 2049 int remote_debugging_port; 2050 2051 /// 2052 /// The number of stack trace frames to capture for uncaught exceptions. 2053 /// Specify a positive value to enable the 2054 /// CefRenderProcessHandler::OnUncaughtException() callback. Specify 0 2055 /// (default value) and OnUncaughtException() will not be called. Also 2056 /// configurable using the "uncaught-exception-stack-size" command-line 2057 /// switch. 2058 /// 2059 int uncaught_exception_stack_size; 2060 2061 /// 2062 /// Background color used for the browser before a document is loaded and when 2063 /// no document color is specified. The alpha component must be either fully 2064 /// opaque (0xFF) or fully transparent (0x00). If the alpha component is fully 2065 /// opaque then the RGB components will be used as the background color. If 2066 /// the alpha component is fully transparent for a windowed browser then the 2067 /// default value of opaque white be used. If the alpha component is fully 2068 /// transparent for a windowless (off-screen) browser then transparent 2069 /// painting will be enabled. 2070 /// 2071 cef_color_t background_color; 2072 2073 /// 2074 /// Comma delimited ordered list of language codes without any whitespace that 2075 /// will be used in the "Accept-Language" HTTP header. May be overridden on a 2076 /// per-browser basis using the CefBrowserSettings.accept_language_list value. 2077 /// If both values are empty then "en-US,en" will be used. Can be overridden 2078 /// for individual CefRequestContext instances via the 2079 /// CefRequestContextSettings.accept_language_list value. 2080 /// 2081 cef_string_t accept_language_list; 2082 2083 /// 2084 /// Comma delimited list of schemes supported by the associated 2085 /// CefCookieManager. If |cookieable_schemes_exclude_defaults| is false (0) 2086 /// the default schemes ("http", "https", "ws" and "wss") will also be 2087 /// supported. Specifying a |cookieable_schemes_list| value and setting 2088 /// |cookieable_schemes_exclude_defaults| to true (1) will disable all loading 2089 /// and saving of cookies for this manager. Can be overridden 2090 /// for individual CefRequestContext instances via the 2091 /// CefRequestContextSettings.cookieable_schemes_list and 2092 /// CefRequestContextSettings.cookieable_schemes_exclude_defaults values. 2093 /// 2094 cef_string_t cookieable_schemes_list; 2095 int cookieable_schemes_exclude_defaults; 2096 } 2097 2098 2099 2100 /// 2101 /// Request context initialization settings. Specify NULL or 0 to get the 2102 /// recommended default values. 2103 /// 2104 struct cef_request_context_settings_t 2105 { 2106 /// 2107 /// Size of this structure. 2108 /// 2109 size_t size; 2110 2111 /// 2112 /// The location where cache data for this request context will be stored on 2113 /// disk. If this value is non-empty then it must be an absolute path that is 2114 /// either equal to or a child directory of CefSettings.root_cache_path. If 2115 /// this value is empty then browsers will be created in "incognito mode" 2116 /// where in-memory caches are used for storage and no data is persisted to 2117 /// disk. HTML5 databases such as localStorage will only persist across 2118 /// sessions if a cache path is specified. To share the global browser cache 2119 /// and related configuration set this value to match the 2120 /// CefSettings.cache_path value. 2121 /// 2122 cef_string_t cache_path; 2123 2124 /// 2125 /// To persist session cookies (cookies without an expiry date or validity 2126 /// interval) by default when using the global cookie manager set this value 2127 /// to true (1). Session cookies are generally intended to be transient and 2128 /// most Web browsers do not persist them. Can be set globally using the 2129 /// CefSettings.persist_session_cookies value. This value will be ignored if 2130 /// |cache_path| is empty or if it matches the CefSettings.cache_path value. 2131 /// 2132 int persist_session_cookies; 2133 2134 /// 2135 /// To persist user preferences as a JSON file in the cache path directory set 2136 /// this value to true (1). Can be set globally using the 2137 /// CefSettings.persist_user_preferences value. This value will be ignored if 2138 /// |cache_path| is empty or if it matches the CefSettings.cache_path value. 2139 /// 2140 int persist_user_preferences; 2141 2142 /// 2143 /// Comma delimited ordered list of language codes without any whitespace that 2144 /// will be used in the "Accept-Language" HTTP header. Can be set globally 2145 /// using the CefSettings.accept_language_list value or overridden on a per- 2146 /// browser basis using the CefBrowserSettings.accept_language_list value. If 2147 /// all values are empty then "en-US,en" will be used. This value will be 2148 /// ignored if |cache_path| matches the CefSettings.cache_path value. 2149 /// 2150 cef_string_t accept_language_list; 2151 2152 /// 2153 /// Comma delimited list of schemes supported by the associated 2154 /// CefCookieManager. If |cookieable_schemes_exclude_defaults| is false (0) 2155 /// the default schemes ("http", "https", "ws" and "wss") will also be 2156 /// supported. Specifying a |cookieable_schemes_list| value and setting 2157 /// |cookieable_schemes_exclude_defaults| to true (1) will disable all loading 2158 /// and saving of cookies for this manager. These values will be ignored if 2159 /// |cache_path| matches the CefSettings.cache_path value. 2160 /// 2161 cef_string_t cookieable_schemes_list; 2162 int cookieable_schemes_exclude_defaults; 2163 } 2164 2165 2166 2167 /// 2168 /// Browser initialization settings. Specify NULL or 0 to get the recommended 2169 /// default values. The consequences of using custom values may not be well 2170 /// tested. Many of these and other settings can also configured using command- 2171 /// line switches. 2172 /// 2173 struct cef_browser_settings_t 2174 { 2175 /// 2176 /// Size of this structure. 2177 /// 2178 size_t size; 2179 2180 /// 2181 /// The maximum rate in frames per second (fps) that CefRenderHandler::OnPaint 2182 /// will be called for a windowless browser. The actual fps may be lower if 2183 /// the browser cannot generate frames at the requested rate. The minimum 2184 /// value is 1 and the maximum value is 60 (default 30). This value can also 2185 /// be changed dynamically via CefBrowserHost::SetWindowlessFrameRate. 2186 /// 2187 int windowless_frame_rate; 2188 2189 /// BEGIN values that map to WebPreferences settings. 2190 2191 /// 2192 /// Font settings. 2193 /// 2194 cef_string_t standard_font_family; 2195 cef_string_t fixed_font_family; 2196 cef_string_t serif_font_family; 2197 cef_string_t sans_serif_font_family; 2198 cef_string_t cursive_font_family; 2199 cef_string_t fantasy_font_family; 2200 int default_font_size; 2201 int default_fixed_font_size; 2202 int minimum_font_size; 2203 int minimum_logical_font_size; 2204 2205 /// 2206 /// Default encoding for Web content. If empty "ISO-8859-1" will be used. Also 2207 /// configurable using the "default-encoding" command-line switch. 2208 /// 2209 cef_string_t default_encoding; 2210 2211 /// 2212 /// Controls the loading of fonts from remote sources. Also configurable using 2213 /// the "disable-remote-fonts" command-line switch. 2214 /// 2215 cef_state_t remote_fonts; 2216 2217 /// 2218 /// Controls whether JavaScript can be executed. Also configurable using the 2219 /// "disable-javascript" command-line switch. 2220 /// 2221 cef_state_t javascript; 2222 2223 /// 2224 /// Controls whether JavaScript can be used to close windows that were not 2225 /// opened via JavaScript. JavaScript can still be used to close windows that 2226 /// were opened via JavaScript or that have no back/forward history. Also 2227 /// configurable using the "disable-javascript-close-windows" command-line 2228 /// switch. 2229 /// 2230 cef_state_t javascript_close_windows; 2231 2232 /// 2233 /// Controls whether JavaScript can access the clipboard. Also configurable 2234 /// using the "disable-javascript-access-clipboard" command-line switch. 2235 /// 2236 cef_state_t javascript_access_clipboard; 2237 2238 /// 2239 /// Controls whether DOM pasting is supported in the editor via 2240 /// execCommand("paste"). The |javascript_access_clipboard| setting must also 2241 /// be enabled. Also configurable using the "disable-javascript-dom-paste" 2242 /// command-line switch. 2243 /// 2244 cef_state_t javascript_dom_paste; 2245 2246 /// 2247 /// Controls whether image URLs will be loaded from the network. A cached 2248 /// image will still be rendered if requested. Also configurable using the 2249 /// "disable-image-loading" command-line switch. 2250 /// 2251 cef_state_t image_loading; 2252 2253 /// 2254 /// Controls whether standalone images will be shrunk to fit the page. Also 2255 /// configurable using the "image-shrink-standalone-to-fit" command-line 2256 /// switch. 2257 /// 2258 cef_state_t image_shrink_standalone_to_fit; 2259 2260 /// 2261 /// Controls whether text areas can be resized. Also configurable using the 2262 /// "disable-text-area-resize" command-line switch. 2263 /// 2264 cef_state_t text_area_resize; 2265 2266 /// 2267 /// Controls whether the tab key can advance focus to links. Also configurable 2268 /// using the "disable-tab-to-links" command-line switch. 2269 /// 2270 cef_state_t tab_to_links; 2271 2272 /// 2273 /// Controls whether local storage can be used. Also configurable using the 2274 /// "disable-local-storage" command-line switch. 2275 /// 2276 cef_state_t local_storage; 2277 2278 /// 2279 /// Controls whether databases can be used. Also configurable using the 2280 /// "disable-databases" command-line switch. 2281 /// 2282 cef_state_t databases; 2283 2284 /// 2285 /// Controls whether WebGL can be used. Note that WebGL requires hardware 2286 /// support and may not work on all systems even when enabled. Also 2287 /// configurable using the "disable-webgl" command-line switch. 2288 /// 2289 cef_state_t webgl; 2290 2291 /// END values that map to WebPreferences settings. 2292 2293 /// 2294 /// Background color used for the browser before a document is loaded and when 2295 /// no document color is specified. The alpha component must be either fully 2296 /// opaque (0xFF) or fully transparent (0x00). If the alpha component is fully 2297 /// opaque then the RGB components will be used as the background color. If 2298 /// the alpha component is fully transparent for a windowed browser then the 2299 /// CefSettings.background_color value will be used. If the alpha component is 2300 /// fully transparent for a windowless (off-screen) browser then transparent 2301 /// painting will be enabled. 2302 /// 2303 cef_color_t background_color; 2304 2305 /// 2306 /// Comma delimited ordered list of language codes without any whitespace that 2307 /// will be used in the "Accept-Language" HTTP header. May be set globally 2308 /// using the CefSettings.accept_language_list value. If both values are 2309 /// empty then "en-US,en" will be used. 2310 /// 2311 cef_string_t accept_language_list; 2312 2313 /// 2314 /// Controls whether the Chrome status bubble will be used. Only supported 2315 /// with the Chrome runtime. For details about the status bubble see 2316 /// https://www.chromium.org/user-experience/status-bubble/ 2317 /// 2318 cef_state_t chrome_status_bubble; 2319 } 2320 2321 2322 2323 /// 2324 /// Return value types. 2325 /// 2326 enum cef_return_value_t 2327 { 2328 /// 2329 /// Cancel immediately. 2330 /// 2331 RV_CANCEL = 0, 2332 2333 /// 2334 /// Continue immediately. 2335 /// 2336 RV_CONTINUE = 1, 2337 2338 /// 2339 /// Continue asynchronously (usually via a callback). 2340 /// 2341 RV_CONTINUE_ASYNC = 2 2342 } 2343 2344 /// 2345 /// URL component parts. 2346 /// 2347 struct cef_urlparts_t 2348 { 2349 /// 2350 /// The complete URL specification. 2351 /// 2352 cef_string_t spec; 2353 2354 /// 2355 /// Scheme component not including the colon (e.g., "http"). 2356 /// 2357 cef_string_t scheme; 2358 2359 /// 2360 /// User name component. 2361 /// 2362 cef_string_t username; 2363 2364 /// 2365 /// Password component. 2366 /// 2367 cef_string_t password; 2368 2369 /// 2370 /// Host component. This may be a hostname, an IPv4 address or an IPv6 literal 2371 /// surrounded by square brackets (e.g., "[2001:db8::1]"). 2372 /// 2373 cef_string_t host; 2374 2375 /// 2376 /// Port number component. 2377 /// 2378 cef_string_t port; 2379 2380 /// 2381 /// Origin contains just the scheme, host, and port from a URL. Equivalent to 2382 /// clearing any username and password, replacing the path with a slash, and 2383 /// clearing everything after that. This value will be empty for non-standard 2384 /// URLs. 2385 /// 2386 cef_string_t origin; 2387 2388 /// 2389 /// Path component including the first slash following the host. 2390 /// 2391 cef_string_t path; 2392 2393 /// 2394 /// Query string component (i.e., everything following the '?'). 2395 /// 2396 cef_string_t query; 2397 2398 /// 2399 /// Fragment (hash) identifier component (i.e., the string following the '#'). 2400 /// 2401 cef_string_t fragment; 2402 } 2403 2404 2405 2406 /// 2407 /// Cookie priority values. 2408 /// 2409 enum cef_cookie_priority_t 2410 { 2411 CEF_COOKIE_PRIORITY_LOW = -1, 2412 CEF_COOKIE_PRIORITY_MEDIUM = 0, 2413 CEF_COOKIE_PRIORITY_HIGH = 1 2414 } 2415 2416 /// 2417 /// Cookie same site values. 2418 /// 2419 enum cef_cookie_same_site_t 2420 { 2421 CEF_COOKIE_SAME_SITE_UNSPECIFIED = 0, 2422 CEF_COOKIE_SAME_SITE_NO_RESTRICTION = 1, 2423 CEF_COOKIE_SAME_SITE_LAX_MODE = 2, 2424 CEF_COOKIE_SAME_SITE_STRICT_MODE = 3 2425 } 2426 2427 /// 2428 /// Cookie information. 2429 /// 2430 struct cef_cookie_t 2431 { 2432 /// 2433 /// The cookie name. 2434 /// 2435 cef_string_t name; 2436 2437 /// 2438 /// The cookie value. 2439 /// 2440 cef_string_t value; 2441 2442 /// 2443 /// If |domain| is empty a host cookie will be created instead of a domain 2444 /// cookie. Domain cookies are stored with a leading "." and are visible to 2445 /// sub-domains whereas host cookies are not. 2446 /// 2447 cef_string_t domain; 2448 2449 /// 2450 /// If |path| is non-empty only URLs at or below the path will get the cookie 2451 /// value. 2452 /// 2453 cef_string_t path; 2454 2455 /// 2456 /// If |secure| is true the cookie will only be sent for HTTPS requests. 2457 /// 2458 int secure; 2459 2460 /// 2461 /// If |httponly| is true the cookie will only be sent for HTTP requests. 2462 /// 2463 int httponly; 2464 2465 /// 2466 /// The cookie creation date. This is automatically populated by the system on 2467 /// cookie creation. 2468 /// 2469 cef_basetime_t creation; 2470 2471 /// 2472 /// The cookie last access date. This is automatically populated by the system 2473 /// on access. 2474 /// 2475 cef_basetime_t last_access; 2476 2477 /// 2478 /// The cookie expiration date is only valid if |has_expires| is true. 2479 /// 2480 int has_expires; 2481 cef_basetime_t expires; 2482 2483 /// 2484 /// Same site. 2485 /// 2486 cef_cookie_same_site_t same_site; 2487 2488 /// 2489 /// Priority. 2490 /// 2491 cef_cookie_priority_t priority; 2492 } 2493 2494 2495 2496 /// 2497 /// Process termination status values. 2498 /// 2499 enum cef_termination_status_t 2500 { 2501 /// 2502 /// Non-zero exit status. 2503 /// 2504 TS_ABNORMAL_TERMINATION = 0, 2505 2506 /// 2507 /// SIGKILL or task manager kill. 2508 /// 2509 TS_PROCESS_WAS_KILLED = 1, 2510 2511 /// 2512 /// Segmentation fault. 2513 /// 2514 TS_PROCESS_CRASHED = 2, 2515 2516 /// 2517 /// Out of memory. Some platforms may use TS_PROCESS_CRASHED instead. 2518 /// 2519 TS_PROCESS_OOM = 3 2520 } 2521 2522 /// 2523 /// Path key values. 2524 /// 2525 enum cef_path_key_t 2526 { 2527 /// 2528 /// Current directory. 2529 /// 2530 PK_DIR_CURRENT = 0, 2531 2532 /// 2533 /// Directory containing PK_FILE_EXE. 2534 /// 2535 PK_DIR_EXE = 1, 2536 2537 /// 2538 /// Directory containing PK_FILE_MODULE. 2539 /// 2540 PK_DIR_MODULE = 2, 2541 2542 /// 2543 /// Temporary directory. 2544 /// 2545 PK_DIR_TEMP = 3, 2546 2547 /// 2548 /// Path and filename of the current executable. 2549 /// 2550 PK_FILE_EXE = 4, 2551 2552 /// 2553 /// Path and filename of the module containing the CEF code (usually the 2554 /// libcef module). 2555 /// 2556 PK_FILE_MODULE = 5, 2557 2558 /// 2559 /// "Local Settings\Application Data" directory under the user profile 2560 /// directory on Windows. 2561 /// 2562 PK_LOCAL_APP_DATA = 6, 2563 2564 /// 2565 /// "Application Data" directory under the user profile directory on Windows 2566 /// and "~/Library/Application Support" directory on MacOS. 2567 /// 2568 PK_USER_DATA = 7, 2569 2570 /// 2571 /// Directory containing application resources. Can be configured via 2572 /// CefSettings.resources_dir_path. 2573 /// 2574 PK_DIR_RESOURCES = 8 2575 } 2576 2577 /// 2578 /// Storage types. 2579 /// 2580 enum cef_storage_type_t 2581 { 2582 ST_LOCALSTORAGE = 0, 2583 ST_SESSIONSTORAGE = 1 2584 } 2585 2586 /// 2587 /// Supported error code values. For the complete list of error values see 2588 /// "include/base/internal/cef_net_error_list.h". 2589 /// 2590 enum cef_errorcode_t 2591 { 2592 // No error. 2593 ERR_NONE = 0, 2594 ERR_IO_PENDING = -1, 2595 ERR_FAILED = -2, 2596 ERR_ABORTED = -3, 2597 ERR_INVALID_ARGUMENT = -4, 2598 ERR_INVALID_HANDLE = -5, 2599 ERR_FILE_NOT_FOUND = -6, 2600 ERR_TIMED_OUT = -7, 2601 ERR_FILE_TOO_BIG = -8, 2602 ERR_UNEXPECTED = -9, 2603 ERR_ACCESS_DENIED = -10, 2604 ERR_NOT_IMPLEMENTED = -11, 2605 ERR_INSUFFICIENT_RESOURCES = -12, 2606 ERR_OUT_OF_MEMORY = -13, 2607 ERR_UPLOAD_FILE_CHANGED = -14, 2608 ERR_SOCKET_NOT_CONNECTED = -15, 2609 ERR_FILE_EXISTS = -16, 2610 ERR_FILE_PATH_TOO_LONG = -17, 2611 ERR_FILE_NO_SPACE = -18, 2612 ERR_FILE_VIRUS_INFECTED = -19, 2613 ERR_BLOCKED_BY_CLIENT = -20, 2614 ERR_NETWORK_CHANGED = -21, 2615 ERR_BLOCKED_BY_ADMINISTRATOR = -22, 2616 ERR_SOCKET_IS_CONNECTED = -23, 2617 ERR_BLOCKED_ENROLLMENT_CHECK_PENDING = -24, 2618 ERR_UPLOAD_STREAM_REWIND_NOT_SUPPORTED = -25, 2619 ERR_CONTEXT_SHUT_DOWN = -26, 2620 ERR_BLOCKED_BY_RESPONSE = -27, 2621 ERR_CLEARTEXT_NOT_PERMITTED = -29, 2622 ERR_BLOCKED_BY_CSP = -30, 2623 ERR_H2_OR_QUIC_REQUIRED = -31, 2624 ERR_CONNECTION_CLOSED = -100, 2625 ERR_CONNECTION_RESET = -101, 2626 ERR_CONNECTION_REFUSED = -102, 2627 ERR_CONNECTION_ABORTED = -103, 2628 ERR_CONNECTION_FAILED = -104, 2629 ERR_NAME_NOT_RESOLVED = -105, 2630 ERR_INTERNET_DISCONNECTED = -106, 2631 ERR_SSL_PROTOCOL_ERROR = -107, 2632 ERR_ADDRESS_INVALID = -108, 2633 ERR_ADDRESS_UNREACHABLE = -109, 2634 ERR_SSL_CLIENT_AUTH_CERT_NEEDED = -110, 2635 ERR_TUNNEL_CONNECTION_FAILED = -111, 2636 ERR_NO_SSL_VERSIONS_ENABLED = -112, 2637 ERR_SSL_VERSION_OR_CIPHER_MISMATCH = -113, 2638 ERR_SSL_RENEGOTIATION_REQUESTED = -114, 2639 ERR_PROXY_AUTH_UNSUPPORTED = -115, 2640 ERR_BAD_SSL_CLIENT_AUTH_CERT = -117, 2641 ERR_CONNECTION_TIMED_OUT = -118, 2642 ERR_HOST_RESOLVER_QUEUE_TOO_LARGE = -119, 2643 ERR_SOCKS_CONNECTION_FAILED = -120, 2644 ERR_SOCKS_CONNECTION_HOST_UNREACHABLE = -121, 2645 ERR_ALPN_NEGOTIATION_FAILED = -122, 2646 ERR_SSL_NO_RENEGOTIATION = -123, 2647 ERR_WINSOCK_UNEXPECTED_WRITTEN_BYTES = -124, 2648 ERR_SSL_DECOMPRESSION_FAILURE_ALERT = -125, 2649 ERR_SSL_BAD_RECORD_MAC_ALERT = -126, 2650 ERR_PROXY_AUTH_REQUESTED = -127, 2651 ERR_PROXY_CONNECTION_FAILED = -130, 2652 ERR_MANDATORY_PROXY_CONFIGURATION_FAILED = -131, 2653 ERR_PRECONNECT_MAX_SOCKET_LIMIT = -133, 2654 ERR_SSL_CLIENT_AUTH_PRIVATE_KEY_ACCESS_DENIED = -134, 2655 ERR_SSL_CLIENT_AUTH_CERT_NO_PRIVATE_KEY = -135, 2656 ERR_PROXY_CERTIFICATE_INVALID = -136, 2657 ERR_NAME_RESOLUTION_FAILED = -137, 2658 ERR_NETWORK_ACCESS_DENIED = -138, 2659 ERR_TEMPORARILY_THROTTLED = -139, 2660 ERR_HTTPS_PROXY_TUNNEL_RESPONSE_REDIRECT = -140, 2661 ERR_SSL_CLIENT_AUTH_SIGNATURE_FAILED = -141, 2662 ERR_MSG_TOO_BIG = -142, 2663 ERR_WS_PROTOCOL_ERROR = -145, 2664 ERR_ADDRESS_IN_USE = -147, 2665 ERR_SSL_HANDSHAKE_NOT_COMPLETED = -148, 2666 ERR_SSL_BAD_PEER_PUBLIC_KEY = -149, 2667 ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN = -150, 2668 ERR_CLIENT_AUTH_CERT_TYPE_UNSUPPORTED = -151, 2669 ERR_SSL_DECRYPT_ERROR_ALERT = -153, 2670 ERR_WS_THROTTLE_QUEUE_TOO_LARGE = -154, 2671 ERR_SSL_SERVER_CERT_CHANGED = -156, 2672 ERR_SSL_UNRECOGNIZED_NAME_ALERT = -159, 2673 ERR_SOCKET_SET_RECEIVE_BUFFER_SIZE_ERROR = -160, 2674 ERR_SOCKET_SET_SEND_BUFFER_SIZE_ERROR = -161, 2675 ERR_SOCKET_RECEIVE_BUFFER_SIZE_UNCHANGEABLE = -162, 2676 ERR_SOCKET_SEND_BUFFER_SIZE_UNCHANGEABLE = -163, 2677 ERR_SSL_CLIENT_AUTH_CERT_BAD_FORMAT = -164, 2678 ERR_ICANN_NAME_COLLISION = -166, 2679 ERR_SSL_SERVER_CERT_BAD_FORMAT = -167, 2680 ERR_CT_STH_PARSING_FAILED = -168, 2681 ERR_CT_STH_INCOMPLETE = -169, 2682 ERR_UNABLE_TO_REUSE_CONNECTION_FOR_PROXY_AUTH = -170, 2683 ERR_CT_CONSISTENCY_PROOF_PARSING_FAILED = -171, 2684 ERR_SSL_OBSOLETE_CIPHER = -172, 2685 ERR_WS_UPGRADE = -173, 2686 ERR_READ_IF_READY_NOT_IMPLEMENTED = -174, 2687 ERR_NO_BUFFER_SPACE = -176, 2688 ERR_SSL_CLIENT_AUTH_NO_COMMON_ALGORITHMS = -177, 2689 ERR_EARLY_DATA_REJECTED = -178, 2690 ERR_WRONG_VERSION_ON_EARLY_DATA = -179, 2691 ERR_TLS13_DOWNGRADE_DETECTED = -180, 2692 ERR_SSL_KEY_USAGE_INCOMPATIBLE = -181, 2693 ERR_INVALID_ECH_CONFIG_LIST = -182, 2694 ERR_ECH_NOT_NEGOTIATED = -183, 2695 ERR_ECH_FALLBACK_CERTIFICATE_INVALID = -184, 2696 ERR_CERT_COMMON_NAME_INVALID = -200, 2697 ERR_CERT_DATE_INVALID = -201, 2698 ERR_CERT_AUTHORITY_INVALID = -202, 2699 ERR_CERT_CONTAINS_ERRORS = -203, 2700 ERR_CERT_NO_REVOCATION_MECHANISM = -204, 2701 ERR_CERT_UNABLE_TO_CHECK_REVOCATION = -205, 2702 ERR_CERT_REVOKED = -206, 2703 ERR_CERT_INVALID = -207, 2704 ERR_CERT_WEAK_SIGNATURE_ALGORITHM = -208, 2705 ERR_CERT_NON_UNIQUE_NAME = -210, 2706 ERR_CERT_WEAK_KEY = -211, 2707 ERR_CERT_NAME_CONSTRAINT_VIOLATION = -212, 2708 ERR_CERT_VALIDITY_TOO_LONG = -213, 2709 ERR_CERTIFICATE_TRANSPARENCY_REQUIRED = -214, 2710 ERR_CERT_SYMANTEC_LEGACY = -215, 2711 ERR_CERT_KNOWN_INTERCEPTION_BLOCKED = -217, 2712 ERR_CERT_END = -219, 2713 ERR_INVALID_URL = -300, 2714 ERR_DISALLOWED_URL_SCHEME = -301, 2715 ERR_UNKNOWN_URL_SCHEME = -302, 2716 ERR_INVALID_REDIRECT = -303, 2717 ERR_TOO_MANY_REDIRECTS = -310, 2718 ERR_UNSAFE_REDIRECT = -311, 2719 ERR_UNSAFE_PORT = -312, 2720 ERR_INVALID_RESPONSE = -320, 2721 ERR_INVALID_CHUNKED_ENCODING = -321, 2722 ERR_METHOD_NOT_SUPPORTED = -322, 2723 ERR_UNEXPECTED_PROXY_AUTH = -323, 2724 ERR_EMPTY_RESPONSE = -324, 2725 ERR_RESPONSE_HEADERS_TOO_BIG = -325, 2726 ERR_PAC_SCRIPT_FAILED = -327, 2727 ERR_REQUEST_RANGE_NOT_SATISFIABLE = -328, 2728 ERR_MALFORMED_IDENTITY = -329, 2729 ERR_CONTENT_DECODING_FAILED = -330, 2730 ERR_NETWORK_IO_SUSPENDED = -331, 2731 ERR_SYN_REPLY_NOT_RECEIVED = -332, 2732 ERR_ENCODING_CONVERSION_FAILED = -333, 2733 ERR_UNRECOGNIZED_FTP_DIRECTORY_LISTING_FORMAT = -334, 2734 ERR_NO_SUPPORTED_PROXIES = -336, 2735 ERR_HTTP2_PROTOCOL_ERROR = -337, 2736 ERR_INVALID_AUTH_CREDENTIALS = -338, 2737 ERR_UNSUPPORTED_AUTH_SCHEME = -339, 2738 ERR_ENCODING_DETECTION_FAILED = -340, 2739 ERR_MISSING_AUTH_CREDENTIALS = -341, 2740 ERR_UNEXPECTED_SECURITY_LIBRARY_STATUS = -342, 2741 ERR_MISCONFIGURED_AUTH_ENVIRONMENT = -343, 2742 ERR_UNDOCUMENTED_SECURITY_LIBRARY_STATUS = -344, 2743 ERR_RESPONSE_BODY_TOO_BIG_TO_DRAIN = -345, 2744 ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_LENGTH = -346, 2745 ERR_INCOMPLETE_HTTP2_HEADERS = -347, 2746 ERR_PAC_NOT_IN_DHCP = -348, 2747 ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION = -349, 2748 ERR_RESPONSE_HEADERS_MULTIPLE_LOCATION = -350, 2749 ERR_HTTP2_SERVER_REFUSED_STREAM = -351, 2750 ERR_HTTP2_PING_FAILED = -352, 2751 ERR_CONTENT_LENGTH_MISMATCH = -354, 2752 ERR_INCOMPLETE_CHUNKED_ENCODING = -355, 2753 ERR_QUIC_PROTOCOL_ERROR = -356, 2754 ERR_RESPONSE_HEADERS_TRUNCATED = -357, 2755 ERR_QUIC_HANDSHAKE_FAILED = -358, 2756 ERR_HTTP2_INADEQUATE_TRANSPORT_SECURITY = -360, 2757 ERR_HTTP2_FLOW_CONTROL_ERROR = -361, 2758 ERR_HTTP2_FRAME_SIZE_ERROR = -362, 2759 ERR_HTTP2_COMPRESSION_ERROR = -363, 2760 ERR_PROXY_AUTH_REQUESTED_WITH_NO_CONNECTION = -364, 2761 ERR_HTTP_1_1_REQUIRED = -365, 2762 ERR_PROXY_HTTP_1_1_REQUIRED = -366, 2763 ERR_PAC_SCRIPT_TERMINATED = -367, 2764 ERR_INVALID_HTTP_RESPONSE = -370, 2765 ERR_CONTENT_DECODING_INIT_FAILED = -371, 2766 ERR_HTTP2_RST_STREAM_NO_ERROR_RECEIVED = -372, 2767 ERR_HTTP2_PUSHED_STREAM_NOT_AVAILABLE = -373, 2768 ERR_HTTP2_CLAIMED_PUSHED_STREAM_RESET_BY_SERVER = -374, 2769 ERR_TOO_MANY_RETRIES = -375, 2770 ERR_HTTP2_STREAM_CLOSED = -376, 2771 ERR_HTTP2_CLIENT_REFUSED_STREAM = -377, 2772 ERR_HTTP2_PUSHED_RESPONSE_DOES_NOT_MATCH = -378, 2773 ERR_HTTP_RESPONSE_CODE_FAILURE = -379, 2774 ERR_QUIC_CERT_ROOT_NOT_KNOWN = -380, 2775 ERR_QUIC_GOAWAY_REQUEST_CAN_BE_RETRIED = -381, 2776 ERR_TOO_MANY_ACCEPT_CH_RESTARTS = -382, 2777 ERR_INCONSISTENT_IP_ADDRESS_SPACE = -383, 2778 ERR_CACHED_IP_ADDRESS_SPACE_BLOCKED_BY_PRIVATE_NETWORK_ACCESS_POLICY = -384, 2779 ERR_CACHE_MISS = -400, 2780 ERR_CACHE_READ_FAILURE = -401, 2781 ERR_CACHE_WRITE_FAILURE = -402, 2782 2783 /// 2784 /// Supported certificate status code values. See net\cert\cert_status_flags.h 2785 ERR_CACHE_OPERATION_NOT_SUPPORTED = -403, 2786 /// for more information. CERT_STATUS_NONE is new in CEF because we use an 2787 ERR_CACHE_OPEN_FAILURE = -404, 2788 /// enum while cert_status_flags.h uses a typedef and static const variables. 2789 ERR_CACHE_CREATE_FAILURE = -405, 2790 /// 2791 2792 // 1 << 3 is reserved for ERR_CERT_CONTAINS_ERRORS (not useful with WinHTTP). 2793 ERR_CACHE_RACE = -406, 2794 2795 // 1 << 9 was used for CERT_STATUS_NOT_IN_DNS 2796 ERR_CACHE_CHECKSUM_READ_FAILURE = -407, 2797 2798 // 1 << 12 was used for CERT_STATUS_WEAK_DH_KEY 2799 2800 // Bits 16 to 31 are for non-error statuses. 2801 ERR_CACHE_CHECKSUM_MISMATCH = -408, 2802 2803 // Bit 18 was CERT_STATUS_IS_DNSSEC 2804 ERR_CACHE_LOCK_TIMEOUT = -409, 2805 2806 /// 2807 /// The manner in which a link click should be opened. These constants match 2808 ERR_CACHE_AUTH_FAILURE_AFTER_READ = -410, 2809 /// their equivalents in Chromium's window_open_disposition.h and should not be 2810 /// renumbered. 2811 /// 2812 2813 /// 2814 /// Current tab. This is the default in most cases. 2815 /// 2816 2817 /// 2818 /// Indicates that only one tab with the url should exist in the same window. 2819 ERR_CACHE_ENTRY_NOT_SUITABLE = -411, 2820 /// 2821 ERR_CACHE_DOOM_FAILURE = -412, 2822 2823 /// 2824 /// Shift key + Middle mouse button or meta/ctrl key while clicking. 2825 /// 2826 ERR_CACHE_OPEN_OR_CREATE_FAILURE = -413, 2827 2828 /// 2829 /// Middle mouse button or meta/ctrl key while clicking. 2830 /// 2831 ERR_INSECURE_RESPONSE = -501, 2832 2833 /// 2834 /// New popup window. 2835 /// 2836 2837 /// 2838 /// Shift key while clicking. 2839 /// 2840 2841 /// 2842 /// Alt key while clicking. 2843 ERR_NO_PRIVATE_KEY_FOR_CERT = -502, 2844 /// 2845 2846 /// 2847 /// New off-the-record (incognito) window. 2848 /// 2849 ERR_ADD_USER_CERT_FAILED = -503, 2850 2851 /// 2852 /// Special case error condition from the renderer. 2853 /// 2854 2855 /// 2856 ERR_INVALID_SIGNED_EXCHANGE = -504, 2857 /// Activates an existing tab containing the url, rather than navigating. 2858 /// This is similar to SINGLETON_TAB, but searches across all windows from 2859 ERR_INVALID_WEB_BUNDLE = -505, 2860 /// the current profile and anonymity (instead of just the current one); 2861 /// closes the current tab on switching if the current tab was the NTP with 2862 ERR_TRUST_TOKEN_OPERATION_FAILED = -506, 2863 /// no session history; and behaves like CURRENT_TAB instead of 2864 /// NEW_FOREGROUND_TAB when no existing tab is found. 2865 /// 2866 2867 /// 2868 /// Creates a new document picture-in-picture window showing a child WebView. 2869 /// 2870 2871 /// 2872 /// "Verb" of a drag-and-drop operation as negotiated between the source and 2873 /// destination. These constants match their equivalents in WebCore's 2874 ERR_TRUST_TOKEN_OPERATION_SUCCESS_WITHOUT_SENDING_REQUEST = -507, 2875 /// DragActions.h and should not be renumbered. 2876 /// 2877 ERR_FTP_FAILED = -601, 2878 2879 /// 2880 /// Input mode of a virtual keyboard. These constants match their equivalents 2881 ERR_FTP_SERVICE_UNAVAILABLE = -602, 2882 /// in Chromium's text_input_mode.h and should not be renumbered. 2883 ERR_FTP_TRANSFER_ABORTED = -603, 2884 /// See https://html.spec.whatwg.org/#input-modalities:-the-inputmode-attribute 2885 /// 2886 ERR_FTP_FILE_BUSY = -604, 2887 ERR_FTP_SYNTAX_ERROR = -605, 2888 ERR_FTP_COMMAND_NOT_SUPPORTED = -606, 2889 2890 /// 2891 /// V8 access control values. 2892 /// 2893 ERR_FTP_BAD_COMMAND_SEQUENCE = -607, 2894 ERR_PKCS12_IMPORT_BAD_PASSWORD = -701, 2895 2896 /// 2897 /// V8 property attribute values. 2898 ERR_PKCS12_IMPORT_FAILED = -702, 2899 /// 2900 2901 /// 2902 /// Writeable, Enumerable, Configurable 2903 ERR_IMPORT_CA_CERT_NOT_CA = -703, 2904 /// 2905 2906 /// 2907 /// Not writeable 2908 /// 2909 2910 /// 2911 /// Not enumerable 2912 /// 2913 2914 /// 2915 /// Not configurable 2916 ERR_IMPORT_CERT_ALREADY_EXISTS = -704, 2917 /// 2918 2919 /// 2920 ERR_IMPORT_CA_CERT_FAILED = -705, 2921 /// Post data elements may represent either bytes or files. 2922 /// 2923 ERR_IMPORT_SERVER_CERT_FAILED = -706, 2924 2925 /// 2926 /// Resource type for a request. These constants match their equivalents in 2927 ERR_PKCS12_IMPORT_INVALID_MAC = -707, 2928 /// Chromium's ResourceType and should not be renumbered. 2929 ERR_PKCS12_IMPORT_INVALID_FILE = -708, 2930 /// 2931 2932 /// 2933 /// Top level page. 2934 /// 2935 2936 /// 2937 /// Frame or iframe. 2938 ERR_PKCS12_IMPORT_UNSUPPORTED = -709, 2939 /// 2940 2941 /// 2942 /// CSS stylesheet. 2943 ERR_KEY_GENERATION_FAILED = -710, 2944 /// 2945 2946 /// 2947 /// External script. 2948 /// 2949 2950 /// 2951 /// Image (jpg/gif/png/etc). 2952 /// 2953 2954 /// 2955 /// Font. 2956 ERR_PRIVATE_KEY_EXPORT_FAILED = -712, 2957 /// 2958 2959 /// 2960 /// Some other subresource. This is the default type if the actual type is 2961 ERR_SELF_SIGNED_CERT_GENERATION_FAILED = -713, 2962 /// unknown. 2963 /// 2964 2965 /// 2966 /// Object (or embed) tag for a plugin, or a resource that a plugin requested. 2967 ERR_CERT_DATABASE_CHANGED = -714, 2968 /// 2969 2970 /// 2971 /// Media resource. 2972 /// 2973 2974 /// 2975 /// Main resource of a dedicated worker. 2976 ERR_DNS_MALFORMED_RESPONSE = -800, 2977 /// 2978 2979 /// 2980 /// Main resource of a shared worker. 2981 ERR_DNS_SERVER_REQUIRES_TCP = -801, 2982 /// 2983 2984 /// 2985 /// Explicitly requested prefetch. 2986 /// 2987 2988 /// 2989 /// Favicon. 2990 /// 2991 2992 /// 2993 /// XMLHttpRequest. 2994 /// 2995 2996 /// 2997 /// A request for a "<ping>". 2998 /// 2999 3000 /// 3001 /// Main resource of a service worker. 3002 /// 3003 3004 /// 3005 /// A report of Content Security Policy violations. 3006 /// 3007 3008 /// 3009 /// A resource that a plugin requested. 3010 /// 3011 3012 /// 3013 /// A main-frame service worker navigation preload request. 3014 ERR_DNS_SERVER_FAILED = -802, 3015 /// 3016 ERR_DNS_TIMED_OUT = -803, 3017 3018 /// 3019 /// A sub-frame service worker navigation preload request. 3020 /// 3021 3022 /// 3023 /// Transition type for a request. Made up of one source value and 0 or more 3024 /// qualifiers. 3025 /// 3026 3027 /// 3028 /// Source is a link click or the JavaScript window.open function. This is 3029 ERR_DNS_CACHE_MISS = -804, 3030 /// also the default value for requests like sub-resource loads that are not 3031 ERR_DNS_SEARCH_EMPTY = -805, 3032 /// navigations. 3033 /// 3034 3035 /// 3036 /// Source is some other "explicit" navigation. This is the default value for 3037 ERR_DNS_SORT_ERROR = -806, 3038 /// navigations where the actual type is unknown. See also 3039 ERR_DNS_SECURE_RESOLVER_HOSTNAME_RESOLUTION_FAILED = -808, 3040 /// TT_DIRECT_LOAD_FLAG. 3041 /// 3042 3043 /// 3044 /// User got to this page through a suggestion in the UI (for example, via the 3045 /// destinations page). Chrome runtime only. 3046 /// 3047 3048 /// 3049 /// Source is a subframe navigation. This is any content that is automatically 3050 ERR_DNS_NAME_HTTPS_ONLY = -809, 3051 /// loaded in a non-toplevel frame. For example, if a page consists of several 3052 ERR_DNS_REQUEST_CANCELLED = -810, 3053 /// frames containing ads, those ad URLs will have this transition type. 3054 /// The user may not even realize the content in these pages is a separate 3055 ERR_DNS_NO_MACHING_SUPPORTED_ALPN = -811 3056 } 3057 3058 enum cef_cert_status_t 3059 { 3060 CERT_STATUS_NONE = 0, 3061 CERT_STATUS_COMMON_NAME_INVALID = 1 << 0, 3062 CERT_STATUS_DATE_INVALID = 1 << 1, 3063 CERT_STATUS_AUTHORITY_INVALID = 1 << 2, 3064 CERT_STATUS_NO_REVOCATION_MECHANISM = 1 << 4, 3065 CERT_STATUS_UNABLE_TO_CHECK_REVOCATION = 1 << 5, 3066 CERT_STATUS_REVOKED = 1 << 6, 3067 CERT_STATUS_INVALID = 1 << 7, 3068 CERT_STATUS_WEAK_SIGNATURE_ALGORITHM = 1 << 8, 3069 CERT_STATUS_NON_UNIQUE_NAME = 1 << 10, 3070 CERT_STATUS_WEAK_KEY = 1 << 11, 3071 CERT_STATUS_PINNED_KEY_MISSING = 1 << 13, 3072 CERT_STATUS_NAME_CONSTRAINT_VIOLATION = 1 << 14, 3073 CERT_STATUS_VALIDITY_TOO_LONG = 1 << 15, 3074 CERT_STATUS_IS_EV = 1 << 16, 3075 CERT_STATUS_REV_CHECKING_ENABLED = 1 << 17, 3076 CERT_STATUS_SHA1_SIGNATURE_PRESENT = 1 << 19, 3077 CERT_STATUS_CT_COMPLIANCE_FAILED = 1 << 20 3078 } 3079 3080 enum cef_window_open_disposition_t 3081 { 3082 WOD_UNKNOWN = 0, 3083 WOD_CURRENT_TAB = 1, 3084 WOD_SINGLETON_TAB = 2, 3085 WOD_NEW_FOREGROUND_TAB = 3, 3086 WOD_NEW_BACKGROUND_TAB = 4, 3087 WOD_NEW_POPUP = 5, 3088 WOD_NEW_WINDOW = 6, 3089 WOD_SAVE_TO_DISK = 7, 3090 WOD_OFF_THE_RECORD = 8, 3091 WOD_IGNORE_ACTION = 9, 3092 WOD_SWITCH_TO_TAB = 10, 3093 WOD_NEW_PICTURE_IN_PICTURE = 11 3094 } 3095 3096 enum cef_drag_operations_mask_t 3097 { 3098 DRAG_OPERATION_NONE = 0, 3099 DRAG_OPERATION_COPY = 1, 3100 DRAG_OPERATION_LINK = 2, 3101 DRAG_OPERATION_GENERIC = 4, 3102 DRAG_OPERATION_PRIVATE = 8, 3103 DRAG_OPERATION_MOVE = 16, 3104 DRAG_OPERATION_DELETE = 32, 3105 DRAG_OPERATION_EVERY = UINT_MAX 3106 } 3107 3108 enum cef_text_input_mode_t 3109 { 3110 CEF_TEXT_INPUT_MODE_DEFAULT = 0, 3111 CEF_TEXT_INPUT_MODE_NONE = 1, 3112 CEF_TEXT_INPUT_MODE_TEXT = 2, 3113 CEF_TEXT_INPUT_MODE_TEL = 3, 3114 CEF_TEXT_INPUT_MODE_URL = 4, 3115 CEF_TEXT_INPUT_MODE_EMAIL = 5, 3116 CEF_TEXT_INPUT_MODE_NUMERIC = 6, 3117 CEF_TEXT_INPUT_MODE_DECIMAL = 7, 3118 CEF_TEXT_INPUT_MODE_SEARCH = 8, 3119 CEF_TEXT_INPUT_MODE_MAX = CEF_TEXT_INPUT_MODE_SEARCH 3120 } 3121 3122 enum cef_v8_accesscontrol_t 3123 { 3124 V8_ACCESS_CONTROL_DEFAULT = 0, 3125 V8_ACCESS_CONTROL_ALL_CAN_READ = 1, 3126 V8_ACCESS_CONTROL_ALL_CAN_WRITE = 1 << 1, 3127 V8_ACCESS_CONTROL_PROHIBITS_OVERWRITING = 1 << 2 3128 } 3129 3130 enum cef_v8_propertyattribute_t 3131 { 3132 V8_PROPERTY_ATTRIBUTE_NONE = 0, 3133 V8_PROPERTY_ATTRIBUTE_READONLY = 1 << 0, 3134 V8_PROPERTY_ATTRIBUTE_DONTENUM = 1 << 1, 3135 V8_PROPERTY_ATTRIBUTE_DONTDELETE = 1 << 2 3136 } 3137 3138 enum cef_postdataelement_type_t 3139 { 3140 PDE_TYPE_EMPTY = 0, 3141 PDE_TYPE_BYTES = 1, 3142 PDE_TYPE_FILE = 2 3143 } 3144 3145 enum cef_resource_type_t 3146 { 3147 RT_MAIN_FRAME = 0, 3148 RT_SUB_FRAME = 1, 3149 RT_STYLESHEET = 2, 3150 RT_SCRIPT = 3, 3151 RT_IMAGE = 4, 3152 RT_FONT_RESOURCE = 5, 3153 RT_SUB_RESOURCE = 6, 3154 RT_OBJECT = 7, 3155 RT_MEDIA = 8, 3156 RT_WORKER = 9, 3157 RT_SHARED_WORKER = 10, 3158 RT_PREFETCH = 11, 3159 RT_FAVICON = 12, 3160 RT_XHR = 13, 3161 RT_PING = 14, 3162 RT_SERVICE_WORKER = 15, 3163 RT_CSP_REPORT = 16, 3164 RT_PLUGIN_RESOURCE = 17, 3165 RT_NAVIGATION_PRELOAD_MAIN_FRAME = 19, 3166 RT_NAVIGATION_PRELOAD_SUB_FRAME = 20 3167 } 3168 3169 enum cef_transition_type_t 3170 { 3171 TT_LINK = 0, 3172 TT_EXPLICIT = 1, 3173 TT_AUTO_BOOKMARK = 2, 3174 /// frame, so may not care about the URL. 3175 /// 3176 TT_AUTO_SUBFRAME = 3, 3177 3178 /// 3179 /// Source is a subframe navigation explicitly requested by the user that will 3180 /// generate new navigation entries in the back/forward list. These are 3181 /// probably more important than frames that were automatically loaded in 3182 /// the background because the user probably cares about the fact that this 3183 /// link was loaded. 3184 /// 3185 TT_MANUAL_SUBFRAME = 4, 3186 3187 /// 3188 /// User got to this page by typing in the URL bar and selecting an entry 3189 /// that did not look like a URL. For example, a match might have the URL 3190 /// of a Google search result page, but appear like "Search Google for ...". 3191 /// These are not quite the same as EXPLICIT navigations because the user 3192 /// didn't type or see the destination URL. Chrome runtime only. 3193 /// See also TT_KEYWORD. 3194 /// 3195 TT_GENERATED = 5, 3196 3197 /// 3198 /// This is a toplevel navigation. This is any content that is automatically 3199 /// loaded in a toplevel frame. For example, opening a tab to show the ASH 3200 /// screen saver, opening the devtools window, opening the NTP after the safe 3201 /// browsing warning, opening web-based dialog boxes are examples of 3202 /// AUTO_TOPLEVEL navigations. Chrome runtime only. 3203 /// 3204 TT_AUTO_TOPLEVEL = 6, 3205 3206 /// 3207 /// Source is a form submission by the user. NOTE: In some situations 3208 /// submitting a form does not result in this transition type. This can happen 3209 /// if the form uses a script to submit the contents. 3210 /// 3211 TT_FORM_SUBMIT = 7, 3212 3213 /// 3214 /// Source is a "reload" of the page via the Reload function or by re-visiting 3215 /// the same URL. NOTE: This is distinct from the concept of whether a 3216 /// particular load uses "reload semantics" (i.e. bypasses cached data). 3217 /// 3218 TT_RELOAD = 8, 3219 3220 /// 3221 /// The url was generated from a replaceable keyword other than the default 3222 /// search provider. If the user types a keyword (which also applies to 3223 /// tab-to-search) in the omnibox this qualifier is applied to the transition 3224 /// type of the generated url. TemplateURLModel then may generate an 3225 /// additional visit with a transition type of TT_KEYWORD_GENERATED against 3226 /// the url 'http://' + keyword. For example, if you do a tab-to-search 3227 /// against wikipedia the generated url has a transition qualifer of 3228 /// TT_KEYWORD, and TemplateURLModel generates a visit for 'wikipedia.org' 3229 /// with a transition type of TT_KEYWORD_GENERATED. Chrome runtime only. 3230 /// 3231 TT_KEYWORD = 9, 3232 3233 /// 3234 /// Corresponds to a visit generated for a keyword. See description of 3235 /// TT_KEYWORD for more details. Chrome runtime only. 3236 /// 3237 TT_KEYWORD_GENERATED = 10, 3238 3239 /// 3240 /// General mask defining the bits used for the source values. 3241 /// 3242 TT_SOURCE_MASK = 0xFF, 3243 3244 /// Qualifiers. 3245 /// Any of the core values above can be augmented by one or more qualifiers. 3246 /// These qualifiers further define the transition. 3247 3248 /// 3249 /// Attempted to visit a URL but was blocked. 3250 /// 3251 TT_BLOCKED_FLAG = 0x00800000, 3252 3253 /// 3254 /// Used the Forward or Back function to navigate among browsing history. 3255 /// Will be ORed to the transition type for the original load. 3256 /// 3257 TT_FORWARD_BACK_FLAG = 0x01000000, 3258 3259 /// 3260 /// Loaded a URL directly via CreateBrowser, LoadURL or LoadRequest. 3261 /// 3262 TT_DIRECT_LOAD_FLAG = 0x02000000, 3263 3264 /// 3265 /// User is navigating to the home page. Chrome runtime only. 3266 /// 3267 TT_HOME_PAGE_FLAG = 0x04000000, 3268 3269 /// 3270 /// The transition originated from an external application; the exact 3271 /// definition of this is embedder dependent. Chrome runtime and 3272 /// extension system only. 3273 /// 3274 TT_FROM_API_FLAG = 0x08000000, 3275 3276 /// 3277 /// The beginning of a navigation chain. 3278 /// 3279 TT_CHAIN_START_FLAG = 0x10000000, 3280 3281 /// 3282 /// The last transition in a redirect chain. 3283 /// 3284 TT_CHAIN_END_FLAG = 0x20000000, 3285 3286 /// 3287 /// Redirects caused by JavaScript or a meta refresh tag on the page. 3288 /// 3289 TT_CLIENT_REDIRECT_FLAG = 0x40000000, 3290 3291 /// 3292 /// Redirects sent from the server by HTTP headers. 3293 /// 3294 TT_SERVER_REDIRECT_FLAG = 0x80000000, 3295 3296 /// 3297 /// Used to test whether a transition involves a redirect. 3298 /// 3299 TT_IS_REDIRECT_MASK = 0xC0000000, 3300 3301 /// 3302 /// General mask defining the bits used for the qualifiers. 3303 /// 3304 TT_QUALIFIER_MASK = 0xFFFFFF00 3305 } 3306 3307 /// 3308 /// Flags used to customize the behavior of CefURLRequest. 3309 /// 3310 enum cef_urlrequest_flags_t 3311 { 3312 /// 3313 /// Default behavior. 3314 /// 3315 UR_FLAG_NONE = 0, 3316 3317 /// 3318 /// If set the cache will be skipped when handling the request. Setting this 3319 /// value is equivalent to specifying the "Cache-Control: no-cache" request 3320 /// header. Setting this value in combination with UR_FLAG_ONLY_FROM_CACHE 3321 /// will cause the request to fail. 3322 /// 3323 UR_FLAG_SKIP_CACHE = 1 << 0, 3324 3325 /// 3326 /// If set the request will fail if it cannot be served from the cache (or 3327 /// some equivalent local store). Setting this value is equivalent to 3328 /// specifying the "Cache-Control: only-if-cached" request header. Setting 3329 /// this value in combination with UR_FLAG_SKIP_CACHE or UR_FLAG_DISABLE_CACHE 3330 /// will cause the request to fail. 3331 /// 3332 UR_FLAG_ONLY_FROM_CACHE = 1 << 1, 3333 3334 /// 3335 /// If set the cache will not be used at all. Setting this value is equivalent 3336 /// to specifying the "Cache-Control: no-store" request header. Setting this 3337 /// value in combination with UR_FLAG_ONLY_FROM_CACHE will cause the request 3338 /// to fail. 3339 /// 3340 UR_FLAG_DISABLE_CACHE = 1 << 2, 3341 3342 /// 3343 /// If set user name, password, and cookies may be sent with the request, and 3344 /// cookies may be saved from the response. 3345 /// 3346 UR_FLAG_ALLOW_STORED_CREDENTIALS = 1 << 3, 3347 3348 /// 3349 /// If set upload progress events will be generated when a request has a body. 3350 /// 3351 UR_FLAG_REPORT_UPLOAD_PROGRESS = 1 << 4, 3352 3353 /// 3354 /// If set the CefURLRequestClient::OnDownloadData method will not be called. 3355 /// 3356 UR_FLAG_NO_DOWNLOAD_DATA = 1 << 5, 3357 3358 /// 3359 /// If set 5XX redirect errors will be propagated to the observer instead of 3360 /// automatically re-tried. This currently only applies for requests 3361 /// originated in the browser process. 3362 /// 3363 UR_FLAG_NO_RETRY_ON_5XX = 1 << 6, 3364 3365 /// 3366 /// If set 3XX responses will cause the fetch to halt immediately rather than 3367 /// continue through the redirect. 3368 /// 3369 UR_FLAG_STOP_ON_REDIRECT = 1 << 7 3370 } 3371 3372 /// 3373 /// Flags that represent CefURLRequest status. 3374 /// 3375 enum cef_urlrequest_status_t 3376 { 3377 /// 3378 /// Unknown status. 3379 /// 3380 UR_UNKNOWN = 0, 3381 3382 /// 3383 /// Request succeeded. 3384 /// 3385 UR_SUCCESS = 1, 3386 3387 /// 3388 /// An IO request is pending, and the caller will be informed when it is 3389 /// completed. 3390 /// 3391 UR_IO_PENDING = 2, 3392 3393 /// 3394 /// Request was canceled programatically. 3395 /// 3396 UR_CANCELED = 3, 3397 3398 /// 3399 /// Request failed for some reason. 3400 /// 3401 UR_FAILED = 4 3402 } 3403 3404 /// Structure representing a draggable region. 3405 /// 3406 struct cef_draggable_region_t 3407 { 3408 /// 3409 /// Bounds of the region. 3410 /// 3411 cef_rect_t bounds; 3412 3413 /// 3414 /// True (1) this this region is draggable and false (0) otherwise. 3415 /// 3416 int draggable; 3417 } 3418 3419 3420 3421 /// 3422 /// Existing process IDs. 3423 /// 3424 enum cef_process_id_t 3425 { 3426 /// 3427 /// Browser process. 3428 /// 3429 PID_BROWSER = 0, 3430 /// 3431 /// Renderer process. 3432 /// 3433 PID_RENDERER = 1 3434 } 3435 3436 /// 3437 /// Existing thread IDs. 3438 /// 3439 enum cef_thread_id_t 3440 { 3441 // BROWSER PROCESS THREADS -- Only available in the browser process. 3442 3443 /// 3444 /// The main thread in the browser. This will be the same as the main 3445 /// application thread if CefInitialize() is called with a 3446 /// CefSettings.multi_threaded_message_loop value of false. Do not perform 3447 /// blocking tasks on this thread. All tasks posted after 3448 /// CefBrowserProcessHandler::OnContextInitialized() and before CefShutdown() 3449 /// are guaranteed to run. This thread will outlive all other CEF threads. 3450 /// 3451 TID_UI = 0, 3452 3453 /// 3454 /// Used for blocking tasks like file system access where the user won't 3455 /// notice if the task takes an arbitrarily long time to complete. All tasks 3456 /// posted after CefBrowserProcessHandler::OnContextInitialized() and before 3457 /// CefShutdown() are guaranteed to run. 3458 /// 3459 TID_FILE_BACKGROUND = 1, 3460 3461 /// 3462 /// Used for blocking tasks like file system access that affect UI or 3463 /// responsiveness of future user interactions. Do not use if an immediate 3464 /// response to a user interaction is expected. All tasks posted after 3465 /// CefBrowserProcessHandler::OnContextInitialized() and before CefShutdown() 3466 /// are guaranteed to run. 3467 /// Examples: 3468 /// - Updating the UI to reflect progress on a long task. 3469 /// - Loading data that might be shown in the UI after a future user 3470 /// interaction. 3471 /// 3472 TID_FILE_USER_VISIBLE = 2, 3473 3474 /// 3475 /// Used for blocking tasks like file system access that affect UI 3476 /// immediately after a user interaction. All tasks posted after 3477 /// CefBrowserProcessHandler::OnContextInitialized() and before CefShutdown() 3478 /// are guaranteed to run. 3479 /// Example: Generating data shown in the UI immediately after a click. 3480 /// 3481 TID_FILE_USER_BLOCKING = 3, 3482 3483 /// 3484 /// Used to launch and terminate browser processes. 3485 /// 3486 TID_PROCESS_LAUNCHER = 4, 3487 3488 /// 3489 /// Used to process IPC and network messages. Do not perform blocking tasks on 3490 /// this thread. All tasks posted after 3491 /// CefBrowserProcessHandler::OnContextInitialized() and before CefShutdown() 3492 /// are guaranteed to run. 3493 /// 3494 TID_IO = 5, 3495 3496 // RENDER PROCESS THREADS -- Only available in the render process. 3497 3498 /// 3499 /// The main thread in the renderer. Used for all WebKit and V8 interaction. 3500 /// Tasks may be posted to this thread after 3501 /// CefRenderProcessHandler::OnWebKitInitialized but are not guaranteed to 3502 /// run before sub-process termination (sub-processes may be killed at any 3503 /// time without warning). 3504 /// 3505 TID_RENDERER = 6 3506 } 3507 3508 /// 3509 /// Thread priority values listed in increasing order of importance. 3510 /// 3511 enum cef_thread_priority_t 3512 { 3513 /// 3514 /// Suitable for threads that shouldn't disrupt high priority work. 3515 /// 3516 TP_BACKGROUND = 0, 3517 3518 /// 3519 /// Default priority level. 3520 /// 3521 TP_NORMAL = 1, 3522 3523 /// 3524 /// Suitable for threads which generate data for the display (at ~60Hz). 3525 /// 3526 TP_DISPLAY = 2, 3527 3528 /// 3529 /// Suitable for low-latency, glitch-resistant audio. 3530 /// 3531 TP_REALTIME_AUDIO = 3 3532 } 3533 3534 /// 3535 /// Message loop types. Indicates the set of asynchronous events that a message 3536 /// loop can process. 3537 /// 3538 enum cef_message_loop_type_t 3539 { 3540 /// 3541 /// Supports tasks and timers. 3542 /// 3543 ML_TYPE_DEFAULT = 0, 3544 3545 /// 3546 /// Supports tasks, timers and native UI events (e.g. Windows messages). 3547 /// 3548 ML_TYPE_UI = 1, 3549 3550 /// 3551 /// Supports tasks, timers and asynchronous IO events. 3552 /// 3553 ML_TYPE_IO = 2 3554 } 3555 3556 /// 3557 /// Windows COM initialization mode. Specifies how COM will be initialized for a 3558 /// new thread. 3559 /// 3560 enum cef_com_init_mode_t 3561 { 3562 /// 3563 /// No COM initialization. 3564 /// 3565 COM_INIT_MODE_NONE = 0, 3566 3567 /// 3568 /// Initialize COM using single-threaded apartments. 3569 /// 3570 COM_INIT_MODE_STA = 1, 3571 3572 /// 3573 /// Initialize COM using multi-threaded apartments. 3574 /// 3575 COM_INIT_MODE_MTA = 2 3576 } 3577 3578 /// 3579 /// Supported value types. 3580 /// 3581 enum cef_value_type_t 3582 { 3583 VTYPE_INVALID = 0, 3584 VTYPE_NULL = 1, 3585 VTYPE_BOOL = 2, 3586 VTYPE_INT = 3, 3587 VTYPE_DOUBLE = 4, 3588 VTYPE_STRING = 5, 3589 VTYPE_BINARY = 6, 3590 VTYPE_DICTIONARY = 7, 3591 VTYPE_LIST = 8 3592 } 3593 3594 /// 3595 /// Supported JavaScript dialog types. 3596 /// 3597 enum cef_jsdialog_type_t 3598 { 3599 JSDIALOGTYPE_ALERT = 0, 3600 JSDIALOGTYPE_CONFIRM = 1, 3601 JSDIALOGTYPE_PROMPT = 2 3602 } 3603 3604 /// 3605 /// Screen information used when window rendering is disabled. This structure is 3606 /// passed as a parameter to CefRenderHandler::GetScreenInfo and should be 3607 /// filled in by the client. 3608 /// 3609 struct cef_screen_info_t 3610 { 3611 /// 3612 /// Device scale factor. Specifies the ratio between physical and logical 3613 /// pixels. 3614 /// 3615 float device_scale_factor; 3616 3617 /// 3618 /// The screen depth in bits per pixel. 3619 /// 3620 int depth; 3621 3622 /// 3623 /// The bits per color component. This assumes that the colors are balanced 3624 /// equally. 3625 /// 3626 int depth_per_component; 3627 3628 /// 3629 /// This can be true for black and white printers. 3630 /// 3631 int is_monochrome; 3632 3633 /// 3634 /// This is set from the rcMonitor member of MONITORINFOEX, to whit: 3635 /// "A RECT structure that specifies the display monitor rectangle, 3636 /// expressed in virtual-screen coordinates. Note that if the monitor 3637 /// is not the primary display monitor, some of the rectangle's 3638 /// coordinates may be negative values." 3639 // 3640 /// The |rect| and |available_rect| properties are used to determine the 3641 /// available surface for rendering popup views. 3642 /// 3643 cef_rect_t rect; 3644 3645 /// 3646 /// This is set from the rcWork member of MONITORINFOEX, to whit: 3647 /// "A RECT structure that specifies the work area rectangle of the 3648 /// display monitor that can be used by applications, expressed in 3649 /// virtual-screen coordinates. Windows uses this rectangle to 3650 /// maximize an application on the monitor. The rest of the area in 3651 /// rcMonitor contains system windows such as the task bar and side 3652 /// bars. Note that if the monitor is not the primary display monitor, 3653 /// some of the rectangle's coordinates may be negative values". 3654 // 3655 /// The |rect| and |available_rect| properties are used to determine the 3656 /// available surface for rendering popup views. 3657 /// 3658 cef_rect_t available_rect; 3659 } 3660 3661 3662 3663 /// 3664 /// Supported menu IDs. Non-English translations can be provided for the 3665 /// IDS_MENU_* strings in CefResourceBundleHandler::GetLocalizedString(). 3666 /// 3667 enum cef_menu_id_t 3668 { 3669 // Navigation. 3670 MENU_ID_BACK = 100, 3671 MENU_ID_FORWARD = 101, 3672 MENU_ID_RELOAD = 102, 3673 MENU_ID_RELOAD_NOCACHE = 103, 3674 MENU_ID_STOPLOAD = 104, 3675 3676 // Editing. 3677 MENU_ID_UNDO = 110, 3678 MENU_ID_REDO = 111, 3679 MENU_ID_CUT = 112, 3680 MENU_ID_COPY = 113, 3681 MENU_ID_PASTE = 114, 3682 MENU_ID_DELETE = 115, 3683 MENU_ID_SELECT_ALL = 116, 3684 3685 // Miscellaneous. 3686 MENU_ID_FIND = 130, 3687 MENU_ID_PRINT = 131, 3688 MENU_ID_VIEW_SOURCE = 132, 3689 3690 // Spell checking word correction suggestions. 3691 MENU_ID_SPELLCHECK_SUGGESTION_0 = 200, 3692 MENU_ID_SPELLCHECK_SUGGESTION_1 = 201, 3693 MENU_ID_SPELLCHECK_SUGGESTION_2 = 202, 3694 MENU_ID_SPELLCHECK_SUGGESTION_3 = 203, 3695 MENU_ID_SPELLCHECK_SUGGESTION_4 = 204, 3696 MENU_ID_SPELLCHECK_SUGGESTION_LAST = 204, 3697 MENU_ID_NO_SPELLING_SUGGESTIONS = 205, 3698 MENU_ID_ADD_TO_DICTIONARY = 206, 3699 3700 // Custom menu items originating from the renderer process. 3701 MENU_ID_CUSTOM_FIRST = 220, 3702 MENU_ID_CUSTOM_LAST = 250, 3703 3704 // All user-defined menu IDs should come between MENU_ID_USER_FIRST and 3705 // MENU_ID_USER_LAST to avoid overlapping the Chromium and CEF ID ranges 3706 // defined in the tools/gritsettings/resource_ids file. 3707 MENU_ID_USER_FIRST = 26500, 3708 MENU_ID_USER_LAST = 28500 3709 } 3710 3711 /// 3712 /// Mouse button types. 3713 /// 3714 enum cef_mouse_button_type_t 3715 { 3716 MBT_LEFT = 0, 3717 MBT_MIDDLE = 1, 3718 MBT_RIGHT = 2 3719 } 3720 3721 /// 3722 /// Structure representing mouse event information. 3723 /// 3724 struct cef_mouse_event_t 3725 { 3726 /// 3727 /// X coordinate relative to the left side of the view. 3728 /// 3729 int x; 3730 3731 /// 3732 /// Y coordinate relative to the top side of the view. 3733 /// 3734 int y; 3735 3736 /// 3737 /// Bit flags describing any pressed modifier keys. See 3738 /// cef_event_flags_t for values. 3739 /// 3740 uint32 modifiers; 3741 } 3742 3743 3744 3745 /// 3746 /// Touch points states types. 3747 /// 3748 enum cef_touch_event_type_t 3749 { 3750 CEF_TET_RELEASED = 0, 3751 CEF_TET_PRESSED = 1, 3752 CEF_TET_MOVED = 2, 3753 CEF_TET_CANCELLED = 3 3754 } 3755 3756 /// 3757 /// The device type that caused the event. 3758 /// 3759 enum cef_pointer_type_t 3760 { 3761 CEF_POINTER_TYPE_TOUCH = 0, 3762 CEF_POINTER_TYPE_MOUSE = 1, 3763 CEF_POINTER_TYPE_PEN = 2, 3764 CEF_POINTER_TYPE_ERASER = 3, 3765 CEF_POINTER_TYPE_UNKNOWN = 4 3766 } 3767 3768 /// 3769 /// Structure representing touch event information. 3770 /// 3771 struct cef_touch_event_t 3772 { 3773 /// 3774 /// Id of a touch point. Must be unique per touch, can be any number except 3775 /// -1. Note that a maximum of 16 concurrent touches will be tracked; touches 3776 /// beyond that will be ignored. 3777 /// 3778 int id; 3779 3780 /// 3781 /// X coordinate relative to the left side of the view. 3782 /// 3783 float x; 3784 3785 /// 3786 /// Y coordinate relative to the top side of the view. 3787 /// 3788 float y; 3789 3790 /// 3791 /// X radius in pixels. Set to 0 if not applicable. 3792 /// 3793 float radius_x; 3794 3795 /// 3796 /// Y radius in pixels. Set to 0 if not applicable. 3797 /// 3798 float radius_y; 3799 3800 /// 3801 /// Rotation angle in radians. Set to 0 if not applicable. 3802 /// 3803 float rotation_angle; 3804 3805 /// 3806 /// The normalized pressure of the pointer input in the range of [0,1]. 3807 /// Set to 0 if not applicable. 3808 /// 3809 float pressure; 3810 3811 /// 3812 /// The state of the touch point. Touches begin with one CEF_TET_PRESSED event 3813 /// followed by zero or more CEF_TET_MOVED events and finally one 3814 /// CEF_TET_RELEASED or CEF_TET_CANCELLED event. Events not respecting this 3815 /// order will be ignored. 3816 /// 3817 cef_touch_event_type_t type; 3818 3819 /// 3820 /// Bit flags describing any pressed modifier keys. See 3821 /// cef_event_flags_t for values. 3822 /// 3823 uint32 modifiers; 3824 3825 /// 3826 /// The device type that caused the event. 3827 /// 3828 cef_pointer_type_t pointer_type; 3829 } 3830 3831 3832 3833 /// 3834 /// Paint element types. 3835 /// 3836 enum cef_paint_element_type_t 3837 { 3838 PET_VIEW = 0, 3839 PET_POPUP = 1 3840 } 3841 3842 /// 3843 /// Supported event bit flags. 3844 /// 3845 enum cef_event_flags_t 3846 { 3847 EVENTFLAG_NONE = 0, 3848 EVENTFLAG_CAPS_LOCK_ON = 1 << 0, 3849 EVENTFLAG_SHIFT_DOWN = 1 << 1, 3850 EVENTFLAG_CONTROL_DOWN = 1 << 2, 3851 EVENTFLAG_ALT_DOWN = 1 << 3, 3852 EVENTFLAG_LEFT_MOUSE_BUTTON = 1 << 4, 3853 EVENTFLAG_MIDDLE_MOUSE_BUTTON = 1 << 5, 3854 EVENTFLAG_RIGHT_MOUSE_BUTTON = 1 << 6, 3855 /// Mac OS-X command key. 3856 EVENTFLAG_COMMAND_DOWN = 1 << 7, 3857 EVENTFLAG_NUM_LOCK_ON = 1 << 8, 3858 EVENTFLAG_IS_KEY_PAD = 1 << 9, 3859 EVENTFLAG_IS_LEFT = 1 << 10, 3860 EVENTFLAG_IS_RIGHT = 1 << 11, 3861 EVENTFLAG_ALTGR_DOWN = 1 << 12, 3862 EVENTFLAG_IS_REPEAT = 1 << 13 3863 } 3864 3865 /// 3866 /// Supported menu item types. 3867 /// 3868 enum cef_menu_item_type_t 3869 { 3870 MENUITEMTYPE_NONE = 0, 3871 MENUITEMTYPE_COMMAND = 1, 3872 MENUITEMTYPE_CHECK = 2, 3873 MENUITEMTYPE_RADIO = 3, 3874 MENUITEMTYPE_SEPARATOR = 4, 3875 MENUITEMTYPE_SUBMENU = 5 3876 } 3877 3878 /// 3879 /// Supported context menu type flags. 3880 /// 3881 enum cef_context_menu_type_flags_t 3882 { 3883 /// 3884 /// No node is selected. 3885 /// 3886 CM_TYPEFLAG_NONE = 0, 3887 /// 3888 /// The top page is selected. 3889 /// 3890 CM_TYPEFLAG_PAGE = 1 << 0, 3891 /// 3892 /// A subframe page is selected. 3893 /// 3894 CM_TYPEFLAG_FRAME = 1 << 1, 3895 /// 3896 /// A link is selected. 3897 /// 3898 CM_TYPEFLAG_LINK = 1 << 2, 3899 /// 3900 /// A media node is selected. 3901 /// 3902 CM_TYPEFLAG_MEDIA = 1 << 3, 3903 /// 3904 /// There is a textual or mixed selection that is selected. 3905 /// 3906 CM_TYPEFLAG_SELECTION = 1 << 4, 3907 /// 3908 /// An editable element is selected. 3909 /// 3910 CM_TYPEFLAG_EDITABLE = 1 << 5 3911 } 3912 3913 /// 3914 /// Supported context menu media types. These constants match their equivalents 3915 /// in Chromium's ContextMenuDataMediaType and should not be renumbered. 3916 /// 3917 enum cef_context_menu_media_type_t 3918 { 3919 /// 3920 /// No special node is in context. 3921 /// 3922 CM_MEDIATYPE_NONE = 0, 3923 /// 3924 /// An image node is selected. 3925 /// 3926 CM_MEDIATYPE_IMAGE = 1, 3927 /// 3928 /// A video node is selected. 3929 /// 3930 CM_MEDIATYPE_VIDEO = 2, 3931 /// 3932 /// An audio node is selected. 3933 /// 3934 CM_MEDIATYPE_AUDIO = 3, 3935 /// 3936 /// An canvas node is selected. 3937 /// 3938 CM_MEDIATYPE_CANVAS = 4, 3939 /// 3940 /// A file node is selected. 3941 /// 3942 CM_MEDIATYPE_FILE = 5, 3943 /// 3944 /// A plugin node is selected. 3945 /// 3946 CM_MEDIATYPE_PLUGIN = 6 3947 } 3948 3949 /// 3950 /// Supported context menu media state bit flags. These constants match their 3951 /// equivalents in Chromium's ContextMenuData::MediaFlags and should not be 3952 /// renumbered. 3953 /// 3954 enum cef_context_menu_media_state_flags_t 3955 { 3956 CM_MEDIAFLAG_NONE = 0, 3957 CM_MEDIAFLAG_IN_ERROR = 1 << 0, 3958 CM_MEDIAFLAG_PAUSED = 1 << 1, 3959 CM_MEDIAFLAG_MUTED = 1 << 2, 3960 CM_MEDIAFLAG_LOOP = 1 << 3, 3961 CM_MEDIAFLAG_CAN_SAVE = 1 << 4, 3962 CM_MEDIAFLAG_HAS_AUDIO = 1 << 5, 3963 CM_MEDIAFLAG_CAN_TOGGLE_CONTROLS = 1 << 6, 3964 CM_MEDIAFLAG_CONTROLS = 1 << 7, 3965 CM_MEDIAFLAG_CAN_PRINT = 1 << 8, 3966 CM_MEDIAFLAG_CAN_ROTATE = 1 << 9, 3967 CM_MEDIAFLAG_CAN_PICTURE_IN_PICTURE = 1 << 10, 3968 CM_MEDIAFLAG_PICTURE_IN_PICTURE = 1 << 11, 3969 CM_MEDIAFLAG_CAN_LOOP = 1 << 12 3970 } 3971 3972 /// 3973 /// Supported context menu edit state bit flags. These constants match their 3974 /// equivalents in Chromium's ContextMenuDataEditFlags and should not be 3975 /// renumbered. 3976 /// 3977 enum cef_context_menu_edit_state_flags_t 3978 { 3979 CM_EDITFLAG_NONE = 0, 3980 CM_EDITFLAG_CAN_UNDO = 1 << 0, 3981 CM_EDITFLAG_CAN_REDO = 1 << 1, 3982 CM_EDITFLAG_CAN_CUT = 1 << 2, 3983 CM_EDITFLAG_CAN_COPY = 1 << 3, 3984 CM_EDITFLAG_CAN_PASTE = 1 << 4, 3985 CM_EDITFLAG_CAN_DELETE = 1 << 5, 3986 CM_EDITFLAG_CAN_SELECT_ALL = 1 << 6, 3987 CM_EDITFLAG_CAN_TRANSLATE = 1 << 7, 3988 CM_EDITFLAG_CAN_EDIT_RICHLY = 1 << 8 3989 } 3990 3991 /// 3992 /// Supported quick menu state bit flags. 3993 /// 3994 enum cef_quick_menu_edit_state_flags_t 3995 { 3996 QM_EDITFLAG_NONE = 0, 3997 QM_EDITFLAG_CAN_ELLIPSIS = 1 << 0, 3998 QM_EDITFLAG_CAN_CUT = 1 << 1, 3999 QM_EDITFLAG_CAN_COPY = 1 << 2, 4000 QM_EDITFLAG_CAN_PASTE = 1 << 3 4001 } 4002 4003 /// 4004 /// Key event types. 4005 /// 4006 enum cef_key_event_type_t 4007 { 4008 /// 4009 /// Notification that a key transitioned from "up" to "down". 4010 /// 4011 KEYEVENT_RAWKEYDOWN = 0, 4012 4013 /// 4014 /// Notification that a key was pressed. This does not necessarily correspond 4015 /// to a character depending on the key and language. Use KEYEVENT_CHAR for 4016 /// character input. 4017 /// 4018 KEYEVENT_KEYDOWN = 1, 4019 4020 /// 4021 /// Notification that a key was released. 4022 /// 4023 KEYEVENT_KEYUP = 2, 4024 4025 /// 4026 /// Notification that a character was typed. Use this for text input. Key 4027 /// down events may generate 0, 1, or more than one character event depending 4028 /// on the key, locale, and operating system. 4029 /// 4030 KEYEVENT_CHAR = 3 4031 } 4032 4033 /// 4034 /// Structure representing keyboard event information. 4035 /// 4036 struct cef_key_event_t 4037 { 4038 /// 4039 /// The type of keyboard event. 4040 /// 4041 cef_key_event_type_t type; 4042 4043 /// 4044 /// Bit flags describing any pressed modifier keys. See 4045 /// cef_event_flags_t for values. 4046 /// 4047 uint32 modifiers; 4048 4049 /// 4050 /// The Windows key code for the key event. This value is used by the DOM 4051 /// specification. Sometimes it comes directly from the event (i.e. on 4052 /// Windows) and sometimes it's determined using a mapping function. See 4053 /// WebCore/platform/chromium/KeyboardCodes.h for the list of values. 4054 /// 4055 int windows_key_code; 4056 4057 /// 4058 /// The actual key code genenerated by the platform. 4059 /// 4060 int native_key_code; 4061 4062 /// 4063 /// Indicates whether the event is considered a "system key" event (see 4064 /// http://msdn.microsoft.com/en-us/library/ms646286(VS.85).aspx for details). 4065 /// This value will always be false on non-Windows platforms. 4066 /// 4067 int is_system_key; 4068 4069 /// 4070 /// The character generated by the keystroke. 4071 /// 4072 char16 character; 4073 4074 /// 4075 /// Same as |character| but unmodified by any concurrently-held modifiers 4076 /// (except shift). This is useful for working out shortcut keys. 4077 /// 4078 char16 unmodified_character; 4079 4080 /// 4081 /// True if the focus is currently on an editable field on the page. This is 4082 /// useful for determining if standard key events should be intercepted. 4083 /// 4084 int focus_on_editable_field; 4085 } 4086 4087 4088 4089 /// 4090 /// Focus sources. 4091 /// 4092 enum cef_focus_source_t 4093 { 4094 /// 4095 /// The source is explicit navigation via the API (LoadURL(), etc). 4096 /// 4097 FOCUS_SOURCE_NAVIGATION = 0, 4098 /// 4099 /// The source is a system-generated focus event. 4100 /// 4101 FOCUS_SOURCE_SYSTEM = 1 4102 } 4103 4104 /// 4105 /// Navigation types. 4106 /// 4107 enum cef_navigation_type_t 4108 { 4109 NAVIGATION_LINK_CLICKED = 0, 4110 NAVIGATION_FORM_SUBMITTED = 1, 4111 NAVIGATION_BACK_FORWARD = 2, 4112 NAVIGATION_RELOAD = 3, 4113 NAVIGATION_FORM_RESUBMITTED = 4, 4114 NAVIGATION_OTHER = 5 4115 } 4116 4117 /// 4118 /// Supported XML encoding types. The parser supports ASCII, ISO-8859-1, and 4119 /// UTF16 (LE and BE) by default. All other types must be translated to UTF8 4120 /// before being passed to the parser. If a BOM is detected and the correct 4121 /// decoder is available then that decoder will be used automatically. 4122 /// 4123 enum cef_xml_encoding_type_t 4124 { 4125 XML_ENCODING_NONE = 0, 4126 XML_ENCODING_UTF8 = 1, 4127 XML_ENCODING_UTF16LE = 2, 4128 XML_ENCODING_UTF16BE = 3, 4129 XML_ENCODING_ASCII = 4 4130 } 4131 4132 /// 4133 /// XML node types. 4134 /// 4135 enum cef_xml_node_type_t 4136 { 4137 XML_NODE_UNSUPPORTED = 0, 4138 XML_NODE_PROCESSING_INSTRUCTION = 1, 4139 XML_NODE_DOCUMENT_TYPE = 2, 4140 XML_NODE_ELEMENT_START = 3, 4141 XML_NODE_ELEMENT_END = 4, 4142 XML_NODE_ATTRIBUTE = 5, 4143 XML_NODE_TEXT = 6, 4144 XML_NODE_CDATA = 7, 4145 XML_NODE_ENTITY_REFERENCE = 8, 4146 XML_NODE_WHITESPACE = 9, 4147 XML_NODE_COMMENT = 10 4148 } 4149 4150 /// 4151 /// Popup window features. 4152 /// 4153 struct cef_popup_features_t 4154 { 4155 int x; 4156 int xSet; 4157 int y; 4158 int ySet; 4159 int width; 4160 int widthSet; 4161 int height; 4162 int heightSet; 4163 4164 int menuBarVisible; 4165 int statusBarVisible; 4166 int toolBarVisible; 4167 int scrollbarsVisible; 4168 } 4169 4170 4171 4172 /// 4173 /// DOM document types. 4174 /// 4175 enum cef_dom_document_type_t 4176 { 4177 DOM_DOCUMENT_TYPE_UNKNOWN = 0, 4178 DOM_DOCUMENT_TYPE_HTML = 1, 4179 DOM_DOCUMENT_TYPE_XHTML = 2, 4180 DOM_DOCUMENT_TYPE_PLUGIN = 3 4181 } 4182 4183 /// 4184 /// DOM event category flags. 4185 /// 4186 enum cef_dom_event_category_t 4187 { 4188 DOM_EVENT_CATEGORY_UNKNOWN = 0x0, 4189 DOM_EVENT_CATEGORY_UI = 0x1, 4190 DOM_EVENT_CATEGORY_MOUSE = 0x2, 4191 DOM_EVENT_CATEGORY_MUTATION = 0x4, 4192 DOM_EVENT_CATEGORY_KEYBOARD = 0x8, 4193 DOM_EVENT_CATEGORY_TEXT = 0x10, 4194 DOM_EVENT_CATEGORY_COMPOSITION = 0x20, 4195 DOM_EVENT_CATEGORY_DRAG = 0x40, 4196 DOM_EVENT_CATEGORY_CLIPBOARD = 0x80, 4197 DOM_EVENT_CATEGORY_MESSAGE = 0x100, 4198 DOM_EVENT_CATEGORY_WHEEL = 0x200, 4199 DOM_EVENT_CATEGORY_BEFORE_TEXT_INSERTED = 0x400, 4200 DOM_EVENT_CATEGORY_OVERFLOW = 0x800, 4201 DOM_EVENT_CATEGORY_PAGE_TRANSITION = 0x1000, 4202 DOM_EVENT_CATEGORY_POPSTATE = 0x2000, 4203 DOM_EVENT_CATEGORY_PROGRESS = 0x4000, 4204 DOM_EVENT_CATEGORY_XMLHTTPREQUEST_PROGRESS = 0x8000 4205 } 4206 4207 /// 4208 /// DOM event processing phases. 4209 /// 4210 enum cef_dom_event_phase_t 4211 { 4212 DOM_EVENT_PHASE_UNKNOWN = 0, 4213 DOM_EVENT_PHASE_CAPTURING = 1, 4214 DOM_EVENT_PHASE_AT_TARGET = 2, 4215 DOM_EVENT_PHASE_BUBBLING = 3 4216 } 4217 4218 /// 4219 /// DOM node types. 4220 /// 4221 enum cef_dom_node_type_t 4222 { 4223 DOM_NODE_TYPE_UNSUPPORTED = 0, 4224 DOM_NODE_TYPE_ELEMENT = 1, 4225 DOM_NODE_TYPE_ATTRIBUTE = 2, 4226 DOM_NODE_TYPE_TEXT = 3, 4227 DOM_NODE_TYPE_CDATA_SECTION = 4, 4228 DOM_NODE_TYPE_PROCESSING_INSTRUCTIONS = 5, 4229 DOM_NODE_TYPE_COMMENT = 6, 4230 DOM_NODE_TYPE_DOCUMENT = 7, 4231 DOM_NODE_TYPE_DOCUMENT_TYPE = 8, 4232 DOM_NODE_TYPE_DOCUMENT_FRAGMENT = 9 4233 } 4234 4235 /// 4236 /// Supported file dialog modes. 4237 /// 4238 enum cef_file_dialog_mode_t 4239 { 4240 /// 4241 /// Requires that the file exists before allowing the user to pick it. 4242 /// 4243 FILE_DIALOG_OPEN = 0, 4244 4245 /// 4246 /// Like Open, but allows picking multiple files to open. 4247 /// 4248 FILE_DIALOG_OPEN_MULTIPLE = 1, 4249 4250 /// 4251 /// Like Open, but selects a folder to open. 4252 /// 4253 FILE_DIALOG_OPEN_FOLDER = 2, 4254 4255 /// 4256 /// Allows picking a nonexistent file, and prompts to overwrite if the file 4257 /// already exists. 4258 /// 4259 FILE_DIALOG_SAVE = 3 4260 } 4261 4262 /// 4263 /// Print job color mode values. 4264 /// 4265 enum cef_color_model_t 4266 { 4267 COLOR_MODEL_UNKNOWN = 0, 4268 COLOR_MODEL_GRAY = 1, 4269 COLOR_MODEL_COLOR = 2, 4270 COLOR_MODEL_CMYK = 3, 4271 COLOR_MODEL_CMY = 4, 4272 COLOR_MODEL_KCMY = 5, 4273 COLOR_MODEL_CMY_K = 6, // CMY_K represents CMY+K. 4274 COLOR_MODEL_BLACK = 7, 4275 COLOR_MODEL_GRAYSCALE = 8, 4276 COLOR_MODEL_RGB = 9, 4277 COLOR_MODEL_RGB16 = 10, 4278 COLOR_MODEL_RGBA = 11, 4279 COLOR_MODEL_COLORMODE_COLOR = 12, // Used in samsung printer ppds. 4280 COLOR_MODEL_COLORMODE_MONOCHROME = 13, // Used in samsung printer ppds. 4281 COLOR_MODEL_HP_COLOR_COLOR = 14, // Used in HP color printer ppds. 4282 COLOR_MODEL_HP_COLOR_BLACK = 15, // Used in HP color printer ppds. 4283 COLOR_MODEL_PRINTOUTMODE_NORMAL = 16, // Used in foomatic ppds. 4284 COLOR_MODEL_PRINTOUTMODE_NORMAL_GRAY = 17, // Used in foomatic ppds. 4285 COLOR_MODEL_PROCESSCOLORMODEL_CMYK = 18, // Used in canon printer ppds. 4286 COLOR_MODEL_PROCESSCOLORMODEL_GREYSCALE = 19, // Used in canon printer ppds. 4287 COLOR_MODEL_PROCESSCOLORMODEL_RGB = 20 // Used in canon printer ppds 4288 } 4289 4290 /// 4291 /// Print job duplex mode values. 4292 /// 4293 enum cef_duplex_mode_t 4294 { 4295 DUPLEX_MODE_UNKNOWN = -1, 4296 DUPLEX_MODE_SIMPLEX = 0, 4297 DUPLEX_MODE_LONG_EDGE = 1, 4298 DUPLEX_MODE_SHORT_EDGE = 2 4299 } 4300 4301 /// 4302 /// Cursor type values. 4303 /// 4304 enum cef_cursor_type_t 4305 { 4306 CT_POINTER = 0, 4307 CT_CROSS = 1, 4308 CT_HAND = 2, 4309 CT_IBEAM = 3, 4310 CT_WAIT = 4, 4311 CT_HELP = 5, 4312 CT_EASTRESIZE = 6, 4313 CT_NORTHRESIZE = 7, 4314 CT_NORTHEASTRESIZE = 8, 4315 CT_NORTHWESTRESIZE = 9, 4316 CT_SOUTHRESIZE = 10, 4317 CT_SOUTHEASTRESIZE = 11, 4318 CT_SOUTHWESTRESIZE = 12, 4319 CT_WESTRESIZE = 13, 4320 CT_NORTHSOUTHRESIZE = 14, 4321 CT_EASTWESTRESIZE = 15, 4322 CT_NORTHEASTSOUTHWESTRESIZE = 16, 4323 CT_NORTHWESTSOUTHEASTRESIZE = 17, 4324 CT_COLUMNRESIZE = 18, 4325 CT_ROWRESIZE = 19, 4326 CT_MIDDLEPANNING = 20, 4327 CT_EASTPANNING = 21, 4328 CT_NORTHPANNING = 22, 4329 CT_NORTHEASTPANNING = 23, 4330 CT_NORTHWESTPANNING = 24, 4331 CT_SOUTHPANNING = 25, 4332 CT_SOUTHEASTPANNING = 26, 4333 CT_SOUTHWESTPANNING = 27, 4334 CT_WESTPANNING = 28, 4335 CT_MOVE = 29, 4336 CT_VERTICALTEXT = 30, 4337 CT_CELL = 31, 4338 CT_CONTEXTMENU = 32, 4339 CT_ALIAS = 33, 4340 CT_PROGRESS = 34, 4341 CT_NODROP = 35, 4342 CT_COPY = 36, 4343 CT_NONE = 37, 4344 CT_NOTALLOWED = 38, 4345 CT_ZOOMIN = 39, 4346 CT_ZOOMOUT = 40, 4347 CT_GRAB = 41, 4348 CT_GRABBING = 42, 4349 CT_MIDDLE_PANNING_VERTICAL = 43, 4350 CT_MIDDLE_PANNING_HORIZONTAL = 44, 4351 CT_CUSTOM = 45, 4352 CT_DND_NONE = 46, 4353 CT_DND_MOVE = 47, 4354 CT_DND_COPY = 48, 4355 CT_DND_LINK = 49 4356 } 4357 4358 /// 4359 /// Structure representing cursor information. |buffer| will be 4360 /// |size.width|*|size.height|*4 bytes in size and represents a BGRA image with 4361 /// an upper-left origin. 4362 /// 4363 struct cef_cursor_info_t 4364 { 4365 cef_point_t hotspot; 4366 float image_scale_factor; 4367 void* buffer; 4368 cef_size_t size; 4369 } 4370 4371 4372 4373 /// 4374 /// URI unescape rules passed to CefURIDecode(). 4375 /// 4376 enum cef_uri_unescape_rule_t 4377 { 4378 /// 4379 /// Don't unescape anything at all. 4380 /// 4381 UU_NONE = 0, 4382 4383 /// 4384 /// Don't unescape anything special, but all normal unescaping will happen. 4385 /// This is a placeholder and can't be combined with other flags (since it's 4386 /// just the absence of them). All other unescape rules imply "normal" in 4387 /// addition to their special meaning. Things like escaped letters, digits, 4388 /// and most symbols will get unescaped with this mode. 4389 /// 4390 UU_NORMAL = 1 << 0, 4391 4392 /// 4393 /// Convert %20 to spaces. In some places where we're showing URLs, we may 4394 /// want this. In places where the URL may be copied and pasted out, then 4395 /// you wouldn't want this since it might not be interpreted in one piece 4396 /// by other applications. 4397 /// 4398 UU_SPACES = 1 << 1, 4399 4400 /// 4401 /// Unescapes '/' and '\\'. If these characters were unescaped, the resulting 4402 /// URL won't be the same as the source one. Moreover, they are dangerous to 4403 /// unescape in strings that will be used as file paths or names. This value 4404 /// should only be used when slashes don't have special meaning, like data 4405 /// URLs. 4406 /// 4407 UU_PATH_SEPARATORS = 1 << 2, 4408 4409 /// 4410 /// Unescapes various characters that will change the meaning of URLs, 4411 /// including '%', '+', '&', '#'. Does not unescape path separators. 4412 /// If these characters were unescaped, the resulting URL won't be the same 4413 /// as the source one. This flag is used when generating final output like 4414 /// filenames for URLs where we won't be interpreting as a URL and want to do 4415 /// as much unescaping as possible. 4416 /// 4417 UU_URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS = 1 << 3, 4418 4419 /// 4420 /// URL queries use "+" for space. This flag controls that replacement. 4421 /// 4422 UU_REPLACE_PLUS_WITH_SPACE = 1 << 4 4423 } 4424 4425 /// 4426 /// Options that can be passed to CefParseJSON. 4427 /// 4428 enum cef_json_parser_options_t 4429 { 4430 /// 4431 /// Parses the input strictly according to RFC 4627. See comments in 4432 /// Chromium's base/json/json_reader.h file for known limitations/ 4433 /// deviations from the RFC. 4434 /// 4435 JSON_PARSER_RFC = 0, 4436 4437 /// 4438 /// Allows commas to exist after the last element in structures. 4439 /// 4440 JSON_PARSER_ALLOW_TRAILING_COMMAS = 1 << 0 4441 } 4442 4443 /// 4444 /// Options that can be passed to CefWriteJSON. 4445 /// 4446 enum cef_json_writer_options_t 4447 { 4448 /// 4449 /// Default behavior. 4450 /// 4451 JSON_WRITER_DEFAULT = 0, 4452 4453 /// 4454 /// This option instructs the writer that if a Binary value is encountered, 4455 /// the value (and key if within a dictionary) will be omitted from the 4456 /// output, and success will be returned. Otherwise, if a binary value is 4457 /// encountered, failure will be returned. 4458 /// 4459 JSON_WRITER_OMIT_BINARY_VALUES = 1 << 0, 4460 4461 /// 4462 /// This option instructs the writer to write doubles that have no fractional 4463 /// part as a normal integer (i.e., without using exponential notation 4464 /// or appending a '.0') as long as the value is within the range of a 4465 /// 64-bit int. 4466 /// 4467 JSON_WRITER_OMIT_DOUBLE_TYPE_PRESERVATION = 1 << 1, 4468 4469 /// 4470 /// Return a slightly nicer formatted json string (pads with whitespace to 4471 /// help with readability). 4472 /// 4473 JSON_WRITER_PRETTY_PRINT = 1 << 2 4474 } 4475 4476 /// 4477 /// Margin type for PDF printing. 4478 /// 4479 enum cef_pdf_print_margin_type_t 4480 { 4481 /// 4482 /// Default margins. 4483 /// 4484 PDF_PRINT_MARGIN_DEFAULT = 0, 4485 4486 /// 4487 /// No margins. 4488 /// 4489 PDF_PRINT_MARGIN_NONE = 1, 4490 4491 /// 4492 /// Minimum margins. 4493 /// 4494 PDF_PRINT_MARGIN_MINIMUM = 2, 4495 4496 /// 4497 /// Custom margins using the |margin_*| values from cef_pdf_print_settings_t. 4498 /// 4499 PDF_PRINT_MARGIN_CUSTOM = 3 4500 } 4501 4502 /// 4503 /// Structure representing PDF print settings. 4504 /// 4505 struct cef_pdf_print_settings_t 4506 { 4507 /// 4508 /// Page title to display in the header. Only used if |header_footer_enabled| 4509 /// is set to true (1). 4510 /// 4511 cef_string_t header_footer_title; 4512 4513 /// 4514 /// URL to display in the footer. Only used if |header_footer_enabled| is set 4515 /// to true (1). 4516 /// 4517 cef_string_t header_footer_url; 4518 4519 /// 4520 /// Output page size in microns. If either of these values is less than or 4521 /// equal to zero then the default paper size (A4) will be used. 4522 /// 4523 int page_width; 4524 int page_height; 4525 4526 /// 4527 /// The percentage to scale the PDF by before printing (e.g. 50 is 50%). 4528 /// If this value is less than or equal to zero the default value of 100 4529 /// will be used. 4530 /// 4531 int scale_factor; 4532 4533 /// 4534 /// Margins in points. Only used if |margin_type| is set to 4535 /// PDF_PRINT_MARGIN_CUSTOM. 4536 /// 4537 int margin_top; 4538 int margin_right; 4539 int margin_bottom; 4540 int margin_left; 4541 4542 /// 4543 /// Margin type. 4544 /// 4545 cef_pdf_print_margin_type_t margin_type; 4546 4547 /// 4548 /// Set to true (1) to print headers and footers or false (0) to not print 4549 /// headers and footers. 4550 /// 4551 int header_footer_enabled; 4552 4553 /// 4554 /// Set to true (1) to print the selection only or false (0) to print all. 4555 /// 4556 int selection_only; 4557 4558 /// 4559 /// Set to true (1) for landscape mode or false (0) for portrait mode. 4560 /// 4561 int landscape; 4562 4563 /// 4564 /// Set to true (1) to print background graphics or false (0) to not print 4565 /// background graphics. 4566 /// 4567 int backgrounds_enabled; 4568 } 4569 4570 4571 4572 /// 4573 /// Supported UI scale factors for the platform. SCALE_FACTOR_NONE is used for 4574 /// density independent resources such as string, html/js files or an image that 4575 /// can be used for any scale factors (such as wallpapers). 4576 /// 4577 enum cef_scale_factor_t 4578 { 4579 SCALE_FACTOR_NONE = 0, 4580 SCALE_FACTOR_100P = 1, 4581 SCALE_FACTOR_125P = 2, 4582 SCALE_FACTOR_133P = 3, 4583 SCALE_FACTOR_140P = 4, 4584 SCALE_FACTOR_150P = 5, 4585 SCALE_FACTOR_180P = 6, 4586 SCALE_FACTOR_200P = 7, 4587 SCALE_FACTOR_250P = 8, 4588 SCALE_FACTOR_300P = 9 4589 } 4590 4591 /// 4592 /// Policy for how the Referrer HTTP header value will be sent during 4593 /// navigation. If the `--no-referrers` command-line flag is specified then the 4594 /// policy value will be ignored and the Referrer value will never be sent. Must 4595 /// be kept synchronized with net::URLRequest::ReferrerPolicy from Chromium. 4596 /// 4597 enum cef_referrer_policy_t 4598 { 4599 /// 4600 /// Clear the referrer header if the header value is HTTPS but the request 4601 /// destination is HTTP. This is the default behavior. 4602 /// 4603 REFERRER_POLICY_CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE = 0, 4604 REFERRER_POLICY_DEFAULT = REFERRER_POLICY_CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE, 4605 4606 /// 4607 /// A slight variant on CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE: 4608 /// If the request destination is HTTP, an HTTPS referrer will be cleared. If 4609 /// the request's destination is cross-origin with the referrer (but does not 4610 /// downgrade), the referrer's granularity will be stripped down to an origin 4611 /// rather than a full URL. Same-origin requests will send the full referrer. 4612 /// 4613 REFERRER_POLICY_REDUCE_REFERRER_GRANULARITY_ON_TRANSITION_CROSS_ORIGIN = 1, 4614 4615 /// 4616 /// Strip the referrer down to an origin when the origin of the referrer is 4617 /// different from the destination's origin. 4618 /// 4619 REFERRER_POLICY_ORIGIN_ONLY_ON_TRANSITION_CROSS_ORIGIN = 2, 4620 4621 /// 4622 /// Never change the referrer. 4623 /// 4624 REFERRER_POLICY_NEVER_CLEAR_REFERRER = 3, 4625 4626 /// 4627 /// Strip the referrer down to the origin regardless of the redirect location. 4628 /// 4629 REFERRER_POLICY_ORIGIN = 4, 4630 4631 /// 4632 /// Clear the referrer when the request's referrer is cross-origin with the 4633 /// request's destination. 4634 /// 4635 REFERRER_POLICY_CLEAR_REFERRER_ON_TRANSITION_CROSS_ORIGIN = 5, 4636 4637 /// 4638 /// Strip the referrer down to the origin, but clear it entirely if the 4639 /// referrer value is HTTPS and the destination is HTTP. 4640 /// 4641 REFERRER_POLICY_ORIGIN_CLEAR_ON_TRANSITION_FROM_SECURE_TO_INSECURE = 6, 4642 4643 /// 4644 /// Always clear the referrer regardless of the request destination. 4645 /// 4646 REFERRER_POLICY_NO_REFERRER = 7, 4647 4648 /// Always the last value in this enumeration. 4649 REFERRER_POLICY_LAST_VALUE = REFERRER_POLICY_NO_REFERRER 4650 } 4651 4652 /// 4653 /// Return values for CefResponseFilter::Filter(). 4654 /// 4655 enum cef_response_filter_status_t 4656 { 4657 /// 4658 /// Some or all of the pre-filter data was read successfully but more data is 4659 /// needed in order to continue filtering (filtered output is pending). 4660 /// 4661 RESPONSE_FILTER_NEED_MORE_DATA = 0, 4662 4663 /// 4664 /// Some or all of the pre-filter data was read successfully and all available 4665 /// filtered output has been written. 4666 /// 4667 RESPONSE_FILTER_DONE = 1, 4668 4669 /// 4670 /// An error occurred during filtering. 4671 /// 4672 RESPONSE_FILTER_ERROR = 2 4673 } 4674 4675 /// 4676 /// Describes how to interpret the components of a pixel. 4677 /// 4678 enum cef_color_type_t 4679 { 4680 /// 4681 /// RGBA with 8 bits per pixel (32bits total). 4682 /// 4683 CEF_COLOR_TYPE_RGBA_8888 = 0, 4684 4685 /// 4686 /// BGRA with 8 bits per pixel (32bits total). 4687 /// 4688 CEF_COLOR_TYPE_BGRA_8888 = 1 4689 } 4690 4691 /// 4692 /// Describes how to interpret the alpha component of a pixel. 4693 /// 4694 enum cef_alpha_type_t 4695 { 4696 /// 4697 /// No transparency. The alpha component is ignored. 4698 /// 4699 CEF_ALPHA_TYPE_OPAQUE = 0, 4700 4701 /// 4702 /// Transparency with pre-multiplied alpha component. 4703 /// 4704 CEF_ALPHA_TYPE_PREMULTIPLIED = 1, 4705 4706 /// 4707 /// Transparency with post-multiplied alpha component. 4708 /// 4709 CEF_ALPHA_TYPE_POSTMULTIPLIED = 2 4710 } 4711 4712 /// 4713 /// Text style types. Should be kepy in sync with gfx::TextStyle. 4714 /// 4715 enum cef_text_style_t 4716 { 4717 CEF_TEXT_STYLE_BOLD = 0, 4718 CEF_TEXT_STYLE_ITALIC = 1, 4719 CEF_TEXT_STYLE_STRIKE = 2, 4720 CEF_TEXT_STYLE_DIAGONAL_STRIKE = 3, 4721 CEF_TEXT_STYLE_UNDERLINE = 4 4722 } 4723 4724 /// 4725 /// Specifies where along the main axis the CefBoxLayout child views should be 4726 /// laid out. 4727 /// 4728 enum cef_main_axis_alignment_t 4729 { 4730 /// 4731 /// Child views will be left-aligned. 4732 /// 4733 CEF_MAIN_AXIS_ALIGNMENT_START = 0, 4734 4735 /// 4736 /// Child views will be center-aligned. 4737 /// 4738 CEF_MAIN_AXIS_ALIGNMENT_CENTER = 1, 4739 4740 /// 4741 /// Child views will be right-aligned. 4742 /// 4743 CEF_MAIN_AXIS_ALIGNMENT_END = 2 4744 } 4745 4746 /// 4747 /// Specifies where along the cross axis the CefBoxLayout child views should be 4748 /// laid out. 4749 /// 4750 enum cef_cross_axis_alignment_t 4751 { 4752 /// 4753 /// Child views will be stretched to fit. 4754 /// 4755 CEF_CROSS_AXIS_ALIGNMENT_STRETCH = 0, 4756 4757 /// 4758 /// Child views will be left-aligned. 4759 /// 4760 CEF_CROSS_AXIS_ALIGNMENT_START = 1, 4761 4762 /// 4763 /// Child views will be center-aligned. 4764 /// 4765 CEF_CROSS_AXIS_ALIGNMENT_CENTER = 2, 4766 4767 /// 4768 /// Child views will be right-aligned. 4769 /// 4770 CEF_CROSS_AXIS_ALIGNMENT_END = 3 4771 } 4772 4773 /// 4774 /// Settings used when initializing a CefBoxLayout. 4775 /// 4776 struct cef_box_layout_settings_t 4777 { 4778 /// 4779 /// If true (1) the layout will be horizontal, otherwise the layout will be 4780 /// vertical. 4781 /// 4782 int horizontal; 4783 4784 /// 4785 /// Adds additional horizontal space between the child view area and the host 4786 /// view border. 4787 /// 4788 int inside_border_horizontal_spacing; 4789 4790 /// 4791 /// Adds additional vertical space between the child view area and the host 4792 /// view border. 4793 /// 4794 int inside_border_vertical_spacing; 4795 4796 /// 4797 /// Adds additional space around the child view area. 4798 /// 4799 cef_insets_t inside_border_insets; 4800 4801 /// 4802 /// Adds additional space between child views. 4803 /// 4804 int between_child_spacing; 4805 4806 /// 4807 /// Specifies where along the main axis the child views should be laid out. 4808 /// 4809 cef_main_axis_alignment_t main_axis_alignment; 4810 4811 /// 4812 /// Specifies where along the cross axis the child views should be laid out. 4813 /// 4814 cef_cross_axis_alignment_t cross_axis_alignment; 4815 4816 /// 4817 /// Minimum cross axis size. 4818 /// 4819 int minimum_cross_axis_size; 4820 4821 /// 4822 /// Default flex for views when none is specified via CefBoxLayout methods. 4823 /// Using the preferred size as the basis, free space along the main axis is 4824 /// distributed to views in the ratio of their flex weights. Similarly, if the 4825 /// views will overflow the parent, space is subtracted in these ratios. A 4826 /// flex of 0 means this view is not resized. Flex values must not be 4827 /// negative. 4828 /// 4829 int default_flex; 4830 } 4831 4832 4833 4834 /// 4835 /// Specifies the button display state. 4836 /// 4837 enum cef_button_state_t 4838 { 4839 CEF_BUTTON_STATE_NORMAL = 0, 4840 CEF_BUTTON_STATE_HOVERED = 1, 4841 CEF_BUTTON_STATE_PRESSED = 2, 4842 CEF_BUTTON_STATE_DISABLED = 3 4843 } 4844 4845 /// 4846 /// Specifies the horizontal text alignment mode. 4847 /// 4848 enum cef_horizontal_alignment_t 4849 { 4850 /// 4851 /// Align the text's left edge with that of its display area. 4852 /// 4853 CEF_HORIZONTAL_ALIGNMENT_LEFT = 0, 4854 4855 /// 4856 /// Align the text's center with that of its display area. 4857 /// 4858 CEF_HORIZONTAL_ALIGNMENT_CENTER = 1, 4859 4860 /// 4861 /// Align the text's right edge with that of its display area. 4862 /// 4863 CEF_HORIZONTAL_ALIGNMENT_RIGHT = 2 4864 } 4865 4866 /// 4867 /// Specifies how a menu will be anchored for non-RTL languages. The opposite 4868 /// position will be used for RTL languages. 4869 /// 4870 enum cef_menu_anchor_position_t 4871 { 4872 CEF_MENU_ANCHOR_TOPLEFT = 0, 4873 CEF_MENU_ANCHOR_TOPRIGHT = 1, 4874 CEF_MENU_ANCHOR_BOTTOMCENTER = 2 4875 } 4876 4877 /// 4878 /// Supported color types for menu items. 4879 /// 4880 enum cef_menu_color_type_t 4881 { 4882 CEF_MENU_COLOR_TEXT = 0, 4883 CEF_MENU_COLOR_TEXT_HOVERED = 1, 4884 CEF_MENU_COLOR_TEXT_ACCELERATOR = 2, 4885 CEF_MENU_COLOR_TEXT_ACCELERATOR_HOVERED = 3, 4886 CEF_MENU_COLOR_BACKGROUND = 4, 4887 CEF_MENU_COLOR_BACKGROUND_HOVERED = 5, 4888 CEF_MENU_COLOR_COUNT = 6 4889 } 4890 4891 /// Supported SSL version values. See net/ssl/ssl_connection_status_flags.h 4892 /// for more information. 4893 enum cef_ssl_version_t 4894 { 4895 SSL_CONNECTION_VERSION_UNKNOWN = 0, // Unknown SSL version. 4896 SSL_CONNECTION_VERSION_SSL2 = 1, 4897 SSL_CONNECTION_VERSION_SSL3 = 2, 4898 SSL_CONNECTION_VERSION_TLS1 = 3, 4899 SSL_CONNECTION_VERSION_TLS1_1 = 4, 4900 SSL_CONNECTION_VERSION_TLS1_2 = 5, 4901 SSL_CONNECTION_VERSION_TLS1_3 = 6, 4902 SSL_CONNECTION_VERSION_QUIC = 7 4903 } 4904 4905 /// Supported SSL content status flags. See content/public/common/ssl_status.h 4906 /// for more information. 4907 enum cef_ssl_content_status_t 4908 { 4909 SSL_CONTENT_NORMAL_CONTENT = 0, 4910 SSL_CONTENT_DISPLAYED_INSECURE_CONTENT = 1 << 0, 4911 SSL_CONTENT_RAN_INSECURE_CONTENT = 1 << 1 4912 } 4913 4914 // 4915 /// Configuration options for registering a custom scheme. 4916 /// These values are used when calling AddCustomScheme. 4917 // 4918 enum cef_scheme_options_t 4919 { 4920 CEF_SCHEME_OPTION_NONE = 0, 4921 4922 /// 4923 /// If CEF_SCHEME_OPTION_STANDARD is set the scheme will be treated as a 4924 /// standard scheme. Standard schemes are subject to URL canonicalization and 4925 /// parsing rules as defined in the Common Internet Scheme Syntax RFC 1738 4926 /// Section 3.1 available at http://www.ietf.org/rfc/rfc1738.txt 4927 // 4928 /// In particular, the syntax for standard scheme URLs must be of the form: 4929 /// <pre> 4930 /// [scheme]://[username]:[password]@[host]:[port]/[url-path] 4931 /// </pre> Standard scheme URLs must have a host component that is a fully 4932 /// qualified domain name as defined in Section 3.5 of RFC 1034 [13] and 4933 /// Section 2.1 of RFC 1123. These URLs will be canonicalized to 4934 /// "scheme://host/path" in the simplest case and 4935 /// "scheme://username:password@host:port/path" in the most explicit case. For 4936 /// example, "scheme:host/path" and "scheme:///host/path" will both be 4937 /// canonicalized to "scheme://host/path". The origin of a standard scheme URL 4938 /// is the combination of scheme, host and port (i.e., "scheme://host:port" in 4939 /// the most explicit case). 4940 // 4941 /// For non-standard scheme URLs only the "scheme:" component is parsed and 4942 /// canonicalized. The remainder of the URL will be passed to the handler as- 4943 /// is. For example, "scheme:///some%20text" will remain the same. 4944 /// Non-standard scheme URLs cannot be used as a target for form submission. 4945 /// 4946 CEF_SCHEME_OPTION_STANDARD = 1 << 0, 4947 4948 /// 4949 /// If CEF_SCHEME_OPTION_LOCAL is set the scheme will be treated with the same 4950 /// security rules as those applied to "file" URLs. Normal pages cannot link 4951 /// to or access local URLs. Also, by default, local URLs can only perform 4952 /// XMLHttpRequest calls to the same URL (origin + path) that originated the 4953 /// request. To allow XMLHttpRequest calls from a local URL to other URLs with 4954 /// the same origin set the CefSettings.file_access_from_file_urls_allowed 4955 /// value to true (1). To allow XMLHttpRequest calls from a local URL to all 4956 /// origins set the CefSettings.universal_access_from_file_urls_allowed value 4957 /// to true (1). 4958 /// 4959 CEF_SCHEME_OPTION_LOCAL = 1 << 1, 4960 4961 /// 4962 /// If CEF_SCHEME_OPTION_DISPLAY_ISOLATED is set the scheme can only be 4963 /// displayed from other content hosted with the same scheme. For example, 4964 /// pages in other origins cannot create iframes or hyperlinks to URLs with 4965 /// the scheme. For schemes that must be accessible from other schemes don't 4966 /// set this, set CEF_SCHEME_OPTION_CORS_ENABLED, and use CORS 4967 /// "Access-Control-Allow-Origin" headers to further restrict access. 4968 /// 4969 CEF_SCHEME_OPTION_DISPLAY_ISOLATED = 1 << 2, 4970 4971 /// 4972 /// If CEF_SCHEME_OPTION_SECURE is set the scheme will be treated with the 4973 /// same security rules as those applied to "https" URLs. For example, loading 4974 /// this scheme from other secure schemes will not trigger mixed content 4975 /// warnings. 4976 /// 4977 CEF_SCHEME_OPTION_SECURE = 1 << 3, 4978 4979 /// 4980 /// If CEF_SCHEME_OPTION_CORS_ENABLED is set the scheme can be sent CORS 4981 /// requests. This value should be set in most cases where 4982 /// CEF_SCHEME_OPTION_STANDARD is set. 4983 /// 4984 CEF_SCHEME_OPTION_CORS_ENABLED = 1 << 4, 4985 4986 /// 4987 /// If CEF_SCHEME_OPTION_CSP_BYPASSING is set the scheme can bypass Content- 4988 /// Security-Policy (CSP) checks. This value should not be set in most cases 4989 /// where CEF_SCHEME_OPTION_STANDARD is set. 4990 /// 4991 CEF_SCHEME_OPTION_CSP_BYPASSING = 1 << 5, 4992 4993 /// 4994 /// If CEF_SCHEME_OPTION_FETCH_ENABLED is set the scheme can perform Fetch API 4995 /// requests. 4996 /// 4997 CEF_SCHEME_OPTION_FETCH_ENABLED = 1 << 6 4998 } 4999 5000 /// 5001 /// Structure representing a range. 5002 /// 5003 struct cef_range_t 5004 { 5005 int from; 5006 int to; 5007 } 5008 5009 5010 5011 /// 5012 /// Composition underline style. 5013 /// 5014 enum cef_composition_underline_style_t 5015 { 5016 CEF_CUS_SOLID = 0, 5017 CEF_CUS_DOT = 1, 5018 CEF_CUS_DASH = 2, 5019 CEF_CUS_NONE = 3 5020 } 5021 5022 /// 5023 /// Structure representing IME composition underline information. This is a thin 5024 /// wrapper around Blink's WebCompositionUnderline class and should be kept in 5025 /// sync with that. 5026 /// 5027 struct cef_composition_underline_t 5028 { 5029 /// 5030 /// Underline character range. 5031 /// 5032 cef_range_t range; 5033 5034 /// 5035 /// Text color. 5036 /// 5037 cef_color_t color; 5038 5039 /// 5040 /// Background color. 5041 /// 5042 cef_color_t background_color; 5043 5044 /// 5045 /// Set to true (1) for thick underline. 5046 /// 5047 int thick; 5048 5049 /// 5050 /// Style. 5051 /// 5052 cef_composition_underline_style_t style; 5053 } 5054 5055 5056 5057 /// 5058 /// Enumerates the various representations of the ordering of audio channels. 5059 /// Must be kept synchronized with media::ChannelLayout from Chromium. 5060 /// See media\base\channel_layout.h 5061 /// 5062 enum cef_channel_layout_t 5063 { 5064 CEF_CHANNEL_LAYOUT_NONE = 0, 5065 CEF_CHANNEL_LAYOUT_UNSUPPORTED = 1, 5066 5067 /// Front C 5068 CEF_CHANNEL_LAYOUT_MONO = 2, 5069 5070 /// Front L, Front R 5071 CEF_CHANNEL_LAYOUT_STEREO = 3, 5072 5073 /// Front L, Front R, Back C 5074 CEF_CHANNEL_LAYOUT_2_1 = 4, 5075 5076 /// Front L, Front R, Front C 5077 CEF_CHANNEL_LAYOUT_SURROUND = 5, 5078 5079 /// Front L, Front R, Front C, Back C 5080 CEF_CHANNEL_LAYOUT_4_0 = 6, 5081 5082 /// Front L, Front R, Side L, Side R 5083 CEF_CHANNEL_LAYOUT_2_2 = 7, 5084 5085 /// Front L, Front R, Back L, Back R 5086 CEF_CHANNEL_LAYOUT_QUAD = 8, 5087 5088 /// Front L, Front R, Front C, Side L, Side R 5089 CEF_CHANNEL_LAYOUT_5_0 = 9, 5090 5091 /// Front L, Front R, Front C, LFE, Side L, Side R 5092 CEF_CHANNEL_LAYOUT_5_1 = 10, 5093 5094 /// Front L, Front R, Front C, Back L, Back R 5095 CEF_CHANNEL_LAYOUT_5_0_BACK = 11, 5096 5097 /// Front L, Front R, Front C, LFE, Back L, Back R 5098 CEF_CHANNEL_LAYOUT_5_1_BACK = 12, 5099 5100 /// Front L, Front R, Front C, Side L, Side R, Back L, Back R 5101 CEF_CHANNEL_LAYOUT_7_0 = 13, 5102 5103 /// Front L, Front R, Front C, LFE, Side L, Side R, Back L, Back R 5104 CEF_CHANNEL_LAYOUT_7_1 = 14, 5105 5106 /// Front L, Front R, Front C, LFE, Side L, Side R, Front LofC, Front RofC 5107 CEF_CHANNEL_LAYOUT_7_1_WIDE = 15, 5108 5109 /// Stereo L, Stereo R 5110 CEF_CHANNEL_LAYOUT_STEREO_DOWNMIX = 16, 5111 5112 /// Stereo L, Stereo R, LFE 5113 CEF_CHANNEL_LAYOUT_2POINT1 = 17, 5114 5115 /// Stereo L, Stereo R, Front C, LFE 5116 CEF_CHANNEL_LAYOUT_3_1 = 18, 5117 5118 /// Stereo L, Stereo R, Front C, Rear C, LFE 5119 CEF_CHANNEL_LAYOUT_4_1 = 19, 5120 5121 /// Stereo L, Stereo R, Front C, Side L, Side R, Back C 5122 CEF_CHANNEL_LAYOUT_6_0 = 20, 5123 5124 /// Stereo L, Stereo R, Side L, Side R, Front LofC, Front RofC 5125 CEF_CHANNEL_LAYOUT_6_0_FRONT = 21, 5126 5127 /// Stereo L, Stereo R, Front C, Rear L, Rear R, Rear C 5128 CEF_CHANNEL_LAYOUT_HEXAGONAL = 22, 5129 5130 /// Stereo L, Stereo R, Front C, LFE, Side L, Side R, Rear Center 5131 CEF_CHANNEL_LAYOUT_6_1 = 23, 5132 5133 /// Stereo L, Stereo R, Front C, LFE, Back L, Back R, Rear Center 5134 CEF_CHANNEL_LAYOUT_6_1_BACK = 24, 5135 5136 /// Stereo L, Stereo R, Side L, Side R, Front LofC, Front RofC, LFE 5137 CEF_CHANNEL_LAYOUT_6_1_FRONT = 25, 5138 5139 /// Front L, Front R, Front C, Side L, Side R, Front LofC, Front RofC 5140 CEF_CHANNEL_LAYOUT_7_0_FRONT = 26, 5141 5142 /// Front L, Front R, Front C, LFE, Back L, Back R, Front LofC, Front RofC 5143 CEF_CHANNEL_LAYOUT_7_1_WIDE_BACK = 27, 5144 5145 /// Front L, Front R, Front C, Side L, Side R, Rear L, Back R, Back C. 5146 CEF_CHANNEL_LAYOUT_OCTAGONAL = 28, 5147 5148 /// Channels are not explicitly mapped to speakers. 5149 CEF_CHANNEL_LAYOUT_DISCRETE = 29, 5150 5151 /// Front L, Front R, Front C. Front C contains the keyboard mic audio. This 5152 /// layout is only intended for input for WebRTC. The Front C channel 5153 /// is stripped away in the WebRTC audio input pipeline and never seen outside 5154 /// of that. 5155 CEF_CHANNEL_LAYOUT_STEREO_AND_KEYBOARD_MIC = 30, 5156 5157 /// Front L, Front R, Side L, Side R, LFE 5158 CEF_CHANNEL_LAYOUT_4_1_QUAD_SIDE = 31, 5159 5160 /// Actual channel layout is specified in the bitstream and the actual channel 5161 /// count is unknown at Chromium media pipeline level (useful for audio 5162 /// pass-through mode). 5163 CEF_CHANNEL_LAYOUT_BITSTREAM = 32, 5164 5165 /// Front L, Front R, Front C, LFE, Side L, Side R, 5166 /// Front Height L, Front Height R, Rear Height L, Rear Height R 5167 /// Will be represented as six channels (5.1) due to eight channel limit 5168 /// kMaxConcurrentChannels 5169 CEF_CHANNEL_LAYOUT_5_1_4_DOWNMIX = 33, 5170 5171 /// Max value, must always equal the largest entry ever logged. 5172 CEF_CHANNEL_LAYOUT_MAX = CEF_CHANNEL_LAYOUT_5_1_4_DOWNMIX 5173 } 5174 5175 /// 5176 /// Structure representing the audio parameters for setting up the audio 5177 /// handler. 5178 /// 5179 struct cef_audio_parameters_t 5180 { 5181 /// 5182 /// Layout of the audio channels 5183 /// 5184 cef_channel_layout_t channel_layout; 5185 5186 /// 5187 /// Sample rate 5188 // 5189 int sample_rate; 5190 5191 /// 5192 /// Number of frames per buffer 5193 /// 5194 int frames_per_buffer; 5195 } 5196 5197 5198 5199 /// 5200 /// Result codes for CefMediaRouter::CreateRoute. Should be kept in sync with 5201 /// Chromium's media_router::mojom::RouteRequestResultCode type. 5202 /// 5203 enum cef_media_route_create_result_t 5204 { 5205 CEF_MRCR_UNKNOWN_ERROR = 0, 5206 CEF_MRCR_OK = 1, 5207 CEF_MRCR_TIMED_OUT = 2, 5208 CEF_MRCR_ROUTE_NOT_FOUND = 3, 5209 CEF_MRCR_SINK_NOT_FOUND = 4, 5210 CEF_MRCR_INVALID_ORIGIN = 5, 5211 CEF_MRCR_NO_SUPPORTED_PROVIDER = 7, 5212 CEF_MRCR_CANCELLED = 8, 5213 CEF_MRCR_ROUTE_ALREADY_EXISTS = 9, 5214 CEF_MRCR_ROUTE_ALREADY_TERMINATED = 11 5215 } 5216 5217 /// 5218 /// Connection state for a MediaRoute object. 5219 /// 5220 enum cef_media_route_connection_state_t 5221 { 5222 CEF_MRCS_UNKNOWN = 0, 5223 CEF_MRCS_CONNECTING = 1, 5224 CEF_MRCS_CONNECTED = 2, 5225 CEF_MRCS_CLOSED = 3, 5226 CEF_MRCS_TERMINATED = 4 5227 } 5228 5229 /// 5230 /// Icon types for a MediaSink object. Should be kept in sync with Chromium's 5231 /// media_router::SinkIconType type. 5232 /// 5233 enum cef_media_sink_icon_type_t 5234 { 5235 CEF_MSIT_CAST = 0, 5236 CEF_MSIT_CAST_AUDIO_GROUP = 1, 5237 CEF_MSIT_CAST_AUDIO = 2, 5238 CEF_MSIT_MEETING = 3, 5239 CEF_MSIT_HANGOUT = 4, 5240 CEF_MSIT_EDUCATION = 5, 5241 CEF_MSIT_WIRED_DISPLAY = 6, 5242 CEF_MSIT_GENERIC = 7, 5243 5244 CEF_MSIT_TOTAL_COUNT = 8 // The total number of values. 5245 } 5246 5247 /// 5248 /// Device information for a MediaSink object. 5249 /// 5250 struct cef_media_sink_device_info_t 5251 { 5252 cef_string_t ip_address; 5253 int port; 5254 cef_string_t model_name; 5255 } 5256 5257 5258 5259 /// 5260 /// Represents commands available to TextField. 5261 /// 5262 enum cef_text_field_commands_t 5263 { 5264 CEF_TFC_CUT = 1, 5265 CEF_TFC_COPY = 2, 5266 CEF_TFC_PASTE = 3, 5267 CEF_TFC_UNDO = 4, 5268 CEF_TFC_DELETE = 5, 5269 CEF_TFC_SELECT_ALL = 6 5270 } 5271 5272 /// 5273 /// Supported Chrome toolbar types. 5274 /// 5275 enum cef_chrome_toolbar_type_t 5276 { 5277 CEF_CTT_NONE = 1, 5278 CEF_CTT_NORMAL = 2, 5279 CEF_CTT_LOCATION = 3 5280 } 5281 5282 /// 5283 /// Docking modes supported by CefWindow::AddOverlay. 5284 /// 5285 enum cef_docking_mode_t 5286 { 5287 CEF_DOCKING_MODE_TOP_LEFT = 1, 5288 CEF_DOCKING_MODE_TOP_RIGHT = 2, 5289 CEF_DOCKING_MODE_BOTTOM_LEFT = 3, 5290 CEF_DOCKING_MODE_BOTTOM_RIGHT = 4, 5291 CEF_DOCKING_MODE_CUSTOM = 5 5292 } 5293 5294 /// 5295 /// Show states supported by CefWindowDelegate::GetInitialShowState. 5296 /// 5297 enum cef_show_state_t 5298 { 5299 CEF_SHOW_STATE_NORMAL = 1, 5300 CEF_SHOW_STATE_MINIMIZED = 2, 5301 CEF_SHOW_STATE_MAXIMIZED = 3, 5302 CEF_SHOW_STATE_FULLSCREEN = 4 5303 } 5304 5305 /// 5306 /// Values indicating what state of the touch handle is set. 5307 /// 5308 enum cef_touch_handle_state_flags_t 5309 { 5310 CEF_THS_FLAG_NONE = 0, 5311 CEF_THS_FLAG_ENABLED = 1 << 0, 5312 CEF_THS_FLAG_ORIENTATION = 1 << 1, 5313 CEF_THS_FLAG_ORIGIN = 1 << 2, 5314 CEF_THS_FLAG_ALPHA = 1 << 3 5315 } 5316 5317 struct cef_touch_handle_state_t 5318 { 5319 /// 5320 /// Touch handle id. Increments for each new touch handle. 5321 /// 5322 int touch_handle_id; 5323 5324 /// 5325 /// Combination of cef_touch_handle_state_flags_t values indicating what state 5326 /// is set. 5327 /// 5328 uint32 flags; 5329 5330 /// 5331 /// Enabled state. Only set if |flags| contains CEF_THS_FLAG_ENABLED. 5332 /// 5333 int enabled; 5334 5335 /// 5336 /// Orientation state. Only set if |flags| contains CEF_THS_FLAG_ORIENTATION. 5337 /// 5338 cef_horizontal_alignment_t orientation; 5339 int mirror_vertical; 5340 int mirror_horizontal; 5341 5342 /// 5343 /// Origin state. Only set if |flags| contains CEF_THS_FLAG_ORIGIN. 5344 /// 5345 cef_point_t origin; 5346 5347 /// 5348 /// Alpha state. Only set if |flags| contains CEF_THS_FLAG_ALPHA. 5349 /// 5350 float alpha; 5351 } 5352 5353 5354 5355 /// 5356 /// Media access permissions used by OnRequestMediaAccessPermission. 5357 /// 5358 enum cef_media_access_permission_types_t 5359 { 5360 /// 5361 /// No permission. 5362 /// 5363 CEF_MEDIA_PERMISSION_NONE = 0, 5364 5365 /// 5366 /// Device audio capture permission. 5367 /// 5368 CEF_MEDIA_PERMISSION_DEVICE_AUDIO_CAPTURE = 1 << 0, 5369 5370 /// 5371 /// Device video capture permission. 5372 /// 5373 CEF_MEDIA_PERMISSION_DEVICE_VIDEO_CAPTURE = 1 << 1, 5374 5375 /// 5376 /// Desktop audio capture permission. 5377 /// 5378 CEF_MEDIA_PERMISSION_DESKTOP_AUDIO_CAPTURE = 1 << 2, 5379 5380 /// 5381 /// Desktop video capture permission. 5382 /// 5383 CEF_MEDIA_PERMISSION_DESKTOP_VIDEO_CAPTURE = 1 << 3 5384 } 5385 5386 /// 5387 /// Permission types used with OnShowPermissionPrompt. Some types are 5388 /// platform-specific or only supported with the Chrome runtime. Should be kept 5389 /// in sync with Chromium's permissions::RequestType type. 5390 /// 5391 enum cef_permission_request_types_t 5392 { 5393 CEF_PERMISSION_TYPE_NONE = 0, 5394 CEF_PERMISSION_TYPE_ACCESSIBILITY_EVENTS = 1 << 0, 5395 CEF_PERMISSION_TYPE_AR_SESSION = 1 << 1, 5396 CEF_PERMISSION_TYPE_CAMERA_PAN_TILT_ZOOM = 1 << 2, 5397 CEF_PERMISSION_TYPE_CAMERA_STREAM = 1 << 3, 5398 CEF_PERMISSION_TYPE_CLIPBOARD = 1 << 4, 5399 CEF_PERMISSION_TYPE_DISK_QUOTA = 1 << 5, 5400 CEF_PERMISSION_TYPE_LOCAL_FONTS = 1 << 6, 5401 CEF_PERMISSION_TYPE_GEOLOCATION = 1 << 7, 5402 CEF_PERMISSION_TYPE_IDLE_DETECTION = 1 << 8, 5403 CEF_PERMISSION_TYPE_MIC_STREAM = 1 << 9, 5404 CEF_PERMISSION_TYPE_MIDI_SYSEX = 1 << 10, 5405 CEF_PERMISSION_TYPE_MULTIPLE_DOWNLOADS = 1 << 11, 5406 CEF_PERMISSION_TYPE_NOTIFICATIONS = 1 << 12, 5407 CEF_PERMISSION_TYPE_PROTECTED_MEDIA_IDENTIFIER = 1 << 13, 5408 CEF_PERMISSION_TYPE_REGISTER_PROTOCOL_HANDLER = 1 << 14, 5409 CEF_PERMISSION_TYPE_SECURITY_ATTESTATION = 1 << 15, 5410 CEF_PERMISSION_TYPE_STORAGE_ACCESS = 1 << 16, 5411 CEF_PERMISSION_TYPE_U2F_API_REQUEST = 1 << 17, 5412 CEF_PERMISSION_TYPE_VR_SESSION = 1 << 18, 5413 CEF_PERMISSION_TYPE_WINDOW_PLACEMENT = 1 << 19 5414 } 5415 5416 /// 5417 /// Permission request results. 5418 /// 5419 enum cef_permission_request_result_t 5420 { 5421 /// 5422 /// Accept the permission request as an explicit user action. 5423 /// 5424 CEF_PERMISSION_RESULT_ACCEPT = 0, 5425 5426 /// 5427 /// Deny the permission request as an explicit user action. 5428 /// 5429 CEF_PERMISSION_RESULT_DENY = 1, 5430 5431 /// 5432 /// Dismiss the permission request as an explicit user action. 5433 /// 5434 CEF_PERMISSION_RESULT_DISMISS = 2, 5435 5436 /// 5437 /// Ignore the permission request. If the prompt remains unhandled (e.g. 5438 /// OnShowPermissionPrompt returns false and there is no default permissions 5439 /// UI) then any related promises may remain unresolved. 5440 /// 5441 CEF_PERMISSION_RESULT_IGNORE = 3 5442 } 5443 5444 /// 5445 /// Certificate types supported by CefTestServer::CreateAndStart. The matching 5446 /// certificate file must exist in the "net/data/ssl/certificates" directory. 5447 /// See CefSetDataDirectoryForTests() for related configuration. 5448 /// 5449 enum cef_test_cert_type_t 5450 { 5451 /// Valid certificate using the IP (127.0.0.1). Loads the "ok_cert.pem" file. 5452 CEF_TEST_CERT_OK_IP = 0, 5453 5454 /// Valid certificate using the domain ("localhost"). Loads the 5455 /// "localhost_cert.pem" file. 5456 CEF_TEST_CERT_OK_DOMAIN = 1, 5457 5458 /// Expired certificate. Loads the "expired_cert.pem" file. 5459 CEF_TEST_CERT_EXPIRED = 2 5460 } 5461 5462 // CEF_INCLUDE_INTERNAL_CEF_TYPES_H_ 5463 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 5464 // 5465 // Redistribution and use in source and binary forms, with or without 5466 // modification, are permitted provided that the following conditions are 5467 // met: 5468 // 5469 // * Redistributions of source code must retain the above copyright 5470 // notice, this list of conditions and the following disclaimer. 5471 // * Redistributions in binary form must reproduce the above 5472 // copyright notice, this list of conditions and the following disclaimer 5473 // in the documentation and/or other materials provided with the 5474 // distribution. 5475 // * Neither the name of Google Inc. nor the name Chromium Embedded 5476 // Framework nor the names of its contributors may be used to endorse 5477 // or promote products derived from this software without specific prior 5478 // written permission. 5479 // 5480 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 5481 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 5482 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 5483 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 5484 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 5485 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 5486 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 5487 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 5488 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 5489 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 5490 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 5491 // 5492 // --------------------------------------------------------------------------- 5493 // 5494 // This file was generated by the CEF translator tool and should not edited 5495 // by hand. See the translator.README.txt file in the tools directory for 5496 // more information. 5497 // 5498 // $hash=6bdc0ce413420b45510fcc7f415c6a6fb05f0112$ 5499 // 5500 5501 extern (C): 5502 5503 /// 5504 /// Implement this structure to receive accessibility notification when 5505 /// accessibility events have been registered. The functions of this structure 5506 /// will be called on the UI thread. 5507 /// 5508 struct cef_accessibility_handler_t 5509 { 5510 /// 5511 /// Base structure. 5512 /// 5513 cef_base_ref_counted_t base; 5514 5515 /// 5516 /// Called after renderer process sends accessibility tree changes to the 5517 /// browser process. 5518 /// 5519 extern(System) void function ( 5520 cef_accessibility_handler_t* self, 5521 cef_value_t* value) nothrow on_accessibility_tree_change; 5522 5523 /// 5524 /// Called after renderer process sends accessibility location changes to the 5525 /// browser process. 5526 /// 5527 extern(System) void function ( 5528 cef_accessibility_handler_t* self, 5529 cef_value_t* value) nothrow on_accessibility_location_change; 5530 } 5531 5532 5533 5534 // CEF_INCLUDE_CAPI_CEF_ACCESSIBILITY_HANDLER_CAPI_H_ 5535 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 5536 // 5537 // Redistribution and use in source and binary forms, with or without 5538 // modification, are permitted provided that the following conditions are 5539 // met: 5540 // 5541 // * Redistributions of source code must retain the above copyright 5542 // notice, this list of conditions and the following disclaimer. 5543 // * Redistributions in binary form must reproduce the above 5544 // copyright notice, this list of conditions and the following disclaimer 5545 // in the documentation and/or other materials provided with the 5546 // distribution. 5547 // * Neither the name of Google Inc. nor the name Chromium Embedded 5548 // Framework nor the names of its contributors may be used to endorse 5549 // or promote products derived from this software without specific prior 5550 // written permission. 5551 // 5552 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 5553 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 5554 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 5555 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 5556 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 5557 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 5558 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 5559 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 5560 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 5561 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 5562 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 5563 // 5564 // --------------------------------------------------------------------------- 5565 // 5566 // This file was generated by the CEF translator tool and should not edited 5567 // by hand. See the translator.README.txt file in the tools directory for 5568 // more information. 5569 // 5570 // $hash=7c6894aae3e508aaa42a376532328316d9bd509c$ 5571 // 5572 5573 extern (C): 5574 5575 /// 5576 /// Implement this structure to provide handler implementations. Methods will be 5577 /// called by the process and/or thread indicated. 5578 /// 5579 struct cef_app_t 5580 { 5581 /// 5582 /// Base structure. 5583 /// 5584 cef_base_ref_counted_t base; 5585 5586 /// 5587 /// Provides an opportunity to view and/or modify command-line arguments 5588 /// before processing by CEF and Chromium. The |process_type| value will be 5589 /// NULL for the browser process. Do not keep a reference to the 5590 /// cef_command_line_t object passed to this function. The 5591 /// cef_settings_t.command_line_args_disabled value can be used to start with 5592 /// an NULL command-line object. Any values specified in CefSettings that 5593 /// equate to command-line arguments will be set before this function is 5594 /// called. Be cautious when using this function to modify command-line 5595 /// arguments for non-browser processes as this may result in undefined 5596 /// behavior including crashes. 5597 /// 5598 extern(System) void function ( 5599 cef_app_t* self, 5600 const(cef_string_t)* process_type, 5601 cef_command_line_t* command_line) nothrow on_before_command_line_processing; 5602 5603 /// 5604 /// Provides an opportunity to register custom schemes. Do not keep a 5605 /// reference to the |registrar| object. This function is called on the main 5606 /// thread for each process and the registered schemes should be the same 5607 /// across all processes. 5608 /// 5609 extern(System) void function ( 5610 cef_app_t* self, 5611 cef_scheme_registrar_t* registrar) nothrow on_register_custom_schemes; 5612 5613 /// 5614 /// Return the handler for resource bundle events. If 5615 /// cef_settings_t.pack_loading_disabled is true (1) a handler must be 5616 /// returned. If no handler is returned resources will be loaded from pack 5617 /// files. This function is called by the browser and render processes on 5618 /// multiple threads. 5619 /// 5620 extern(System) cef_resource_bundle_handler_t* function ( 5621 cef_app_t* self) nothrow get_resource_bundle_handler; 5622 5623 /// 5624 /// Return the handler for functionality specific to the browser process. This 5625 /// function is called on multiple threads in the browser process. 5626 /// 5627 extern(System) cef_browser_process_handler_t* function ( 5628 cef_app_t* self) nothrow get_browser_process_handler; 5629 5630 /// 5631 /// Return the handler for functionality specific to the render process. This 5632 /// function is called on the render process main thread. 5633 /// 5634 extern(System) cef_render_process_handler_t* function ( 5635 cef_app_t* self) nothrow get_render_process_handler; 5636 } 5637 5638 5639 5640 /// 5641 /// This function should be called from the application entry point function to 5642 /// execute a secondary process. It can be used to run secondary processes from 5643 /// the browser client executable (default behavior) or from a separate 5644 /// executable specified by the cef_settings_t.browser_subprocess_path value. If 5645 /// called for the browser process (identified by no "type" command-line value) 5646 /// it will return immediately with a value of -1. If called for a recognized 5647 /// secondary process it will block until the process should exit and then 5648 /// return the process exit code. The |application| parameter may be NULL. The 5649 /// |windows_sandbox_info| parameter is only used on Windows and may be NULL 5650 /// (see cef_sandbox_win.h for details). 5651 /// 5652 int cef_execute_process ( 5653 const(cef_main_args_t)* args, 5654 cef_app_t* application, 5655 void* windows_sandbox_info); 5656 5657 /// 5658 /// This function should be called on the main application thread to initialize 5659 /// the CEF browser process. The |application| parameter may be NULL. A return 5660 /// value of true (1) indicates that it succeeded and false (0) indicates that 5661 /// it failed. The |windows_sandbox_info| parameter is only used on Windows and 5662 /// may be NULL (see cef_sandbox_win.h for details). 5663 /// 5664 int cef_initialize ( 5665 const(cef_main_args_t)* args, 5666 const(cef_settings_t)* settings, 5667 cef_app_t* application, 5668 void* windows_sandbox_info); 5669 5670 /// 5671 /// This function should be called on the main application thread to shut down 5672 /// the CEF browser process before the application exits. 5673 /// 5674 void cef_shutdown (); 5675 5676 /// 5677 /// Perform a single iteration of CEF message loop processing. This function is 5678 /// provided for cases where the CEF message loop must be integrated into an 5679 /// existing application message loop. Use of this function is not recommended 5680 /// for most users; use either the cef_run_message_loop() function or 5681 /// cef_settings_t.multi_threaded_message_loop if possible. When using this 5682 /// function care must be taken to balance performance against excessive CPU 5683 /// usage. It is recommended to enable the cef_settings_t.external_message_pump 5684 /// option when using this function so that 5685 /// cef_browser_process_handler_t::on_schedule_message_pump_work() callbacks can 5686 /// facilitate the scheduling process. This function should only be called on 5687 /// the main application thread and only if cef_initialize() is called with a 5688 /// cef_settings_t.multi_threaded_message_loop value of false (0). This function 5689 /// will not block. 5690 /// 5691 void cef_do_message_loop_work (); 5692 5693 /// 5694 /// Run the CEF message loop. Use this function instead of an application- 5695 /// provided message loop to get the best balance between performance and CPU 5696 /// usage. This function should only be called on the main application thread 5697 /// and only if cef_initialize() is called with a 5698 /// cef_settings_t.multi_threaded_message_loop value of false (0). This function 5699 /// will block until a quit message is received by the system. 5700 /// 5701 void cef_run_message_loop (); 5702 5703 /// 5704 /// Quit the CEF message loop that was started by calling 5705 /// cef_run_message_loop(). This function should only be called on the main 5706 /// application thread and only if cef_run_message_loop() was used. 5707 /// 5708 void cef_quit_message_loop (); 5709 5710 /// 5711 /// Set to true (1) before calling Windows APIs like TrackPopupMenu that enter a 5712 /// modal message loop. Set to false (0) after exiting the modal message loop. 5713 /// 5714 void cef_set_osmodal_loop (int osModalLoop); 5715 5716 /// 5717 /// Call during process startup to enable High-DPI support on Windows 7 or 5718 /// newer. Older versions of Windows should be left DPI-unaware because they do 5719 /// not support DirectWrite and GDI fonts are kerned very badly. 5720 /// 5721 void cef_enable_highdpi_support (); 5722 5723 // CEF_INCLUDE_CAPI_CEF_APP_CAPI_H_ 5724 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 5725 // 5726 // Redistribution and use in source and binary forms, with or without 5727 // modification, are permitted provided that the following conditions are 5728 // met: 5729 // 5730 // * Redistributions of source code must retain the above copyright 5731 // notice, this list of conditions and the following disclaimer. 5732 // * Redistributions in binary form must reproduce the above 5733 // copyright notice, this list of conditions and the following disclaimer 5734 // in the documentation and/or other materials provided with the 5735 // distribution. 5736 // * Neither the name of Google Inc. nor the name Chromium Embedded 5737 // Framework nor the names of its contributors may be used to endorse 5738 // or promote products derived from this software without specific prior 5739 // written permission. 5740 // 5741 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 5742 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 5743 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 5744 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 5745 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 5746 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 5747 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 5748 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 5749 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 5750 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 5751 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 5752 // 5753 // --------------------------------------------------------------------------- 5754 // 5755 // This file was generated by the CEF translator tool and should not edited 5756 // by hand. See the translator.README.txt file in the tools directory for 5757 // more information. 5758 // 5759 // $hash=4e243df31e29bc6e473d56e371ed6328d948959c$ 5760 // 5761 5762 extern (C): 5763 5764 /// 5765 /// Implement this structure to handle audio events. 5766 /// 5767 struct cef_audio_handler_t 5768 { 5769 /// 5770 /// Base structure. 5771 /// 5772 cef_base_ref_counted_t base; 5773 5774 /// 5775 /// Called on the UI thread to allow configuration of audio stream parameters. 5776 /// Return true (1) to proceed with audio stream capture, or false (0) to 5777 /// cancel it. All members of |params| can optionally be configured here, but 5778 /// they are also pre-filled with some sensible defaults. 5779 /// 5780 extern(System) int function ( 5781 cef_audio_handler_t* self, 5782 cef_browser_t* browser, 5783 cef_audio_parameters_t* params) nothrow get_audio_parameters; 5784 5785 /// 5786 /// Called on a browser audio capture thread when the browser starts streaming 5787 /// audio. OnAudioStreamStopped will always be called after 5788 /// OnAudioStreamStarted; both functions may be called multiple times for the 5789 /// same browser. |params| contains the audio parameters like sample rate and 5790 /// channel layout. |channels| is the number of channels. 5791 /// 5792 extern(System) void function ( 5793 cef_audio_handler_t* self, 5794 cef_browser_t* browser, 5795 const(cef_audio_parameters_t)* params, 5796 int channels) nothrow on_audio_stream_started; 5797 5798 /// 5799 /// Called on the audio stream thread when a PCM packet is received for the 5800 /// stream. |data| is an array representing the raw PCM data as a floating 5801 /// point type, i.e. 4-byte value(s). |frames| is the number of frames in the 5802 /// PCM packet. |pts| is the presentation timestamp (in milliseconds since the 5803 /// Unix Epoch) and represents the time at which the decompressed packet 5804 /// should be presented to the user. Based on |frames| and the 5805 /// |channel_layout| value passed to OnAudioStreamStarted you can calculate 5806 /// the size of the |data| array in bytes. 5807 /// 5808 extern(System) void function ( 5809 cef_audio_handler_t* self, 5810 cef_browser_t* browser, 5811 const(float*)* data, 5812 int frames, 5813 int64 pts) nothrow on_audio_stream_packet; 5814 5815 /// 5816 /// Called on the UI thread when the stream has stopped. OnAudioSteamStopped 5817 /// will always be called after OnAudioStreamStarted; both functions may be 5818 /// called multiple times for the same stream. 5819 /// 5820 extern(System) void function ( 5821 cef_audio_handler_t* self, 5822 cef_browser_t* browser) nothrow on_audio_stream_stopped; 5823 5824 /// 5825 /// Called on the UI or audio stream thread when an error occurred. During the 5826 /// stream creation phase this callback will be called on the UI thread while 5827 /// in the capturing phase it will be called on the audio stream thread. The 5828 /// stream will be stopped immediately. 5829 /// 5830 extern(System) void function ( 5831 cef_audio_handler_t* self, 5832 cef_browser_t* browser, 5833 const(cef_string_t)* message) nothrow on_audio_stream_error; 5834 } 5835 5836 5837 5838 // CEF_INCLUDE_CAPI_CEF_AUDIO_HANDLER_CAPI_H_ 5839 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 5840 // 5841 // Redistribution and use in source and binary forms, with or without 5842 // modification, are permitted provided that the following conditions are 5843 // met: 5844 // 5845 // * Redistributions of source code must retain the above copyright 5846 // notice, this list of conditions and the following disclaimer. 5847 // * Redistributions in binary form must reproduce the above 5848 // copyright notice, this list of conditions and the following disclaimer 5849 // in the documentation and/or other materials provided with the 5850 // distribution. 5851 // * Neither the name of Google Inc. nor the name Chromium Embedded 5852 // Framework nor the names of its contributors may be used to endorse 5853 // or promote products derived from this software without specific prior 5854 // written permission. 5855 // 5856 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 5857 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 5858 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 5859 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 5860 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 5861 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 5862 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 5863 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 5864 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 5865 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 5866 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 5867 // 5868 // --------------------------------------------------------------------------- 5869 // 5870 // This file was generated by the CEF translator tool and should not edited 5871 // by hand. See the translator.README.txt file in the tools directory for 5872 // more information. 5873 // 5874 // $hash=c0704c0a87e8b57b20887be75700a30e887fee4f$ 5875 // 5876 5877 extern (C): 5878 5879 /// 5880 /// Callback structure used for asynchronous continuation of authentication 5881 /// requests. 5882 /// 5883 struct cef_auth_callback_t 5884 { 5885 /// 5886 /// Base structure. 5887 /// 5888 cef_base_ref_counted_t base; 5889 5890 /// 5891 /// Continue the authentication request. 5892 /// 5893 extern(System) void function ( 5894 cef_auth_callback_t* self, 5895 const(cef_string_t)* username, 5896 const(cef_string_t)* password) nothrow cont; 5897 5898 /// 5899 /// Cancel the authentication request. 5900 /// 5901 extern(System) void function (cef_auth_callback_t* self) nothrow cancel; 5902 } 5903 5904 5905 5906 // CEF_INCLUDE_CAPI_CEF_AUTH_CALLBACK_CAPI_H_ 5907 // Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. 5908 // 5909 // Redistribution and use in source and binary forms, with or without 5910 // modification, are permitted provided that the following conditions are 5911 // met: 5912 // 5913 // * Redistributions of source code must retain the above copyright 5914 // notice, this list of conditions and the following disclaimer. 5915 // * Redistributions in binary form must reproduce the above 5916 // copyright notice, this list of conditions and the following disclaimer 5917 // in the documentation and/or other materials provided with the 5918 // distribution. 5919 // * Neither the name of Google Inc. nor the name Chromium Embedded 5920 // Framework nor the names of its contributors may be used to endorse 5921 // or promote products derived from this software without specific prior 5922 // written permission. 5923 // 5924 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 5925 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 5926 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 5927 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 5928 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 5929 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 5930 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 5931 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 5932 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 5933 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 5934 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 5935 5936 extern (C): 5937 5938 /// 5939 // All ref-counted framework structures must include this structure first. 5940 /// 5941 struct cef_base_ref_counted_t 5942 { 5943 /// 5944 // Size of the data structure. 5945 /// 5946 size_t size; 5947 5948 /// 5949 // Called to increment the reference count for the object. Should be called 5950 // for every new copy of a pointer to a given object. 5951 /// 5952 extern(System) void function (cef_base_ref_counted_t* self) nothrow add_ref; 5953 5954 /// 5955 // Called to decrement the reference count for the object. If the reference 5956 // count falls to 0 the object should self-delete. Returns true (1) if the 5957 // resulting reference count is 0. 5958 /// 5959 extern(System) int function (cef_base_ref_counted_t* self) nothrow release; 5960 5961 /// 5962 // Returns true (1) if the current reference count is 1. 5963 /// 5964 extern(System) int function (cef_base_ref_counted_t* self) nothrow has_one_ref; 5965 5966 /// 5967 // Returns true (1) if the current reference count is at least 1. 5968 /// 5969 extern(System) int function (cef_base_ref_counted_t* self) nothrow has_at_least_one_ref; 5970 } 5971 5972 5973 5974 /// 5975 // All scoped framework structures must include this structure first. 5976 /// 5977 struct cef_base_scoped_t 5978 { 5979 /// 5980 // Size of the data structure. 5981 /// 5982 size_t size; 5983 5984 /// 5985 // Called to delete this object. May be NULL if the object is not owned. 5986 /// 5987 extern(System) void function (cef_base_scoped_t* self) nothrow del; 5988 } 5989 5990 5991 5992 // Check that the structure |s|, which is defined with a size_t member at the 5993 // top, is large enough to contain the specified member |f|. 5994 5995 5996 5997 5998 // CEF_INCLUDE_CAPI_CEF_BASE_CAPI_H_ 5999 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 6000 // 6001 // Redistribution and use in source and binary forms, with or without 6002 // modification, are permitted provided that the following conditions are 6003 // met: 6004 // 6005 // * Redistributions of source code must retain the above copyright 6006 // notice, this list of conditions and the following disclaimer. 6007 // * Redistributions in binary form must reproduce the above 6008 // copyright notice, this list of conditions and the following disclaimer 6009 // in the documentation and/or other materials provided with the 6010 // distribution. 6011 // * Neither the name of Google Inc. nor the name Chromium Embedded 6012 // Framework nor the names of its contributors may be used to endorse 6013 // or promote products derived from this software without specific prior 6014 // written permission. 6015 // 6016 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 6017 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 6018 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 6019 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 6020 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 6021 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 6022 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 6023 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 6024 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 6025 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 6026 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 6027 // 6028 // --------------------------------------------------------------------------- 6029 // 6030 // This file was generated by the CEF translator tool and should not edited 6031 // by hand. See the translator.README.txt file in the tools directory for 6032 // more information. 6033 // 6034 // $hash=f8a604f73a04bec535d72ec7d05906da8c953b6b$ 6035 // 6036 6037 import core.stdc.config; 6038 6039 extern (C): 6040 6041 6042 6043 /// 6044 /// Structure used to represent a browser. When used in the browser process the 6045 /// functions of this structure may be called on any thread unless otherwise 6046 /// indicated in the comments. When used in the render process the functions of 6047 /// this structure may only be called on the main thread. 6048 /// 6049 struct cef_browser_t 6050 { 6051 /// 6052 /// Base structure. 6053 /// 6054 cef_base_ref_counted_t base; 6055 6056 /// 6057 /// True if this object is currently valid. This will return false (0) after 6058 /// cef_life_span_handler_t::OnBeforeClose is called. 6059 /// 6060 extern(System) int function (cef_browser_t* self) nothrow is_valid; 6061 6062 /// 6063 /// Returns the browser host object. This function can only be called in the 6064 /// browser process. 6065 /// 6066 extern(System) cef_browser_host_t* function (cef_browser_t* self) nothrow get_host; 6067 6068 /// 6069 /// Returns true (1) if the browser can navigate backwards. 6070 /// 6071 extern(System) int function (cef_browser_t* self) nothrow can_go_back; 6072 6073 /// 6074 /// Navigate backwards. 6075 /// 6076 extern(System) void function (cef_browser_t* self) nothrow go_back; 6077 6078 /// 6079 /// Returns true (1) if the browser can navigate forwards. 6080 /// 6081 extern(System) int function (cef_browser_t* self) nothrow can_go_forward; 6082 6083 /// 6084 /// Navigate forwards. 6085 /// 6086 extern(System) void function (cef_browser_t* self) nothrow go_forward; 6087 6088 /// 6089 /// Returns true (1) if the browser is currently loading. 6090 /// 6091 extern(System) int function (cef_browser_t* self) nothrow is_loading; 6092 6093 /// 6094 /// Reload the current page. 6095 /// 6096 extern(System) void function (cef_browser_t* self) nothrow reload; 6097 6098 /// 6099 /// Reload the current page ignoring any cached data. 6100 /// 6101 extern(System) void function (cef_browser_t* self) nothrow reload_ignore_cache; 6102 6103 /// 6104 /// Stop loading the page. 6105 /// 6106 extern(System) void function (cef_browser_t* self) nothrow stop_load; 6107 6108 /// 6109 /// Returns the globally unique identifier for this browser. This value is 6110 /// also used as the tabId for extension APIs. 6111 /// 6112 extern(System) int function (cef_browser_t* self) nothrow get_identifier; 6113 6114 /// 6115 /// Returns true (1) if this object is pointing to the same handle as |that| 6116 /// object. 6117 /// 6118 extern(System) int function (cef_browser_t* self, cef_browser_t* that) nothrow is_same; 6119 6120 /// 6121 /// Returns true (1) if the browser is a popup. 6122 /// 6123 extern(System) int function (cef_browser_t* self) nothrow is_popup; 6124 6125 /// 6126 /// Returns true (1) if a document has been loaded in the browser. 6127 /// 6128 extern(System) int function (cef_browser_t* self) nothrow has_document; 6129 6130 /// 6131 /// Returns the main (top-level) frame for the browser. In the browser process 6132 /// this will return a valid object until after 6133 /// cef_life_span_handler_t::OnBeforeClose is called. In the renderer process 6134 /// this will return NULL if the main frame is hosted in a different renderer 6135 /// process (e.g. for cross-origin sub-frames). The main frame object will 6136 /// change during cross-origin navigation or re-navigation after renderer 6137 /// process termination (due to crashes, etc). 6138 /// 6139 extern(System) cef_frame_t* function (cef_browser_t* self) nothrow get_main_frame; 6140 6141 /// 6142 /// Returns the focused frame for the browser. 6143 /// 6144 extern(System) cef_frame_t* function (cef_browser_t* self) nothrow get_focused_frame; 6145 6146 /// 6147 /// Returns the frame with the specified identifier, or NULL if not found. 6148 /// 6149 extern(System) cef_frame_t* function ( 6150 cef_browser_t* self, 6151 int64 identifier) nothrow get_frame_byident; 6152 6153 /// 6154 /// Returns the frame with the specified name, or NULL if not found. 6155 /// 6156 extern(System) cef_frame_t* function ( 6157 cef_browser_t* self, 6158 const(cef_string_t)* name) nothrow get_frame; 6159 6160 /// 6161 /// Returns the number of frames that currently exist. 6162 /// 6163 extern(System) size_t function (cef_browser_t* self) nothrow get_frame_count; 6164 6165 /// 6166 /// Returns the identifiers of all existing frames. 6167 /// 6168 extern(System) void function ( 6169 cef_browser_t* self, 6170 size_t* identifiersCount, 6171 int64* identifiers) nothrow get_frame_identifiers; 6172 6173 /// 6174 /// Returns the names of all existing frames. 6175 /// 6176 extern(System) void function ( 6177 cef_browser_t* self, 6178 cef_string_list_t names) nothrow get_frame_names; 6179 } 6180 6181 6182 6183 /// 6184 /// Callback structure for cef_browser_host_t::RunFileDialog. The functions of 6185 /// this structure will be called on the browser process UI thread. 6186 /// 6187 struct cef_run_file_dialog_callback_t 6188 { 6189 /// 6190 /// Base structure. 6191 /// 6192 cef_base_ref_counted_t base; 6193 6194 /// 6195 /// Called asynchronously after the file dialog is dismissed. |file_paths| 6196 /// will be a single value or a list of values depending on the dialog mode. 6197 /// If the selection was cancelled |file_paths| will be NULL. 6198 /// 6199 extern(System) void function ( 6200 cef_run_file_dialog_callback_t* self, 6201 cef_string_list_t file_paths) nothrow on_file_dialog_dismissed; 6202 } 6203 6204 6205 6206 /// 6207 /// Callback structure for cef_browser_host_t::GetNavigationEntries. The 6208 /// functions of this structure will be called on the browser process UI thread. 6209 /// 6210 struct cef_navigation_entry_visitor_t 6211 { 6212 /// 6213 /// Base structure. 6214 /// 6215 cef_base_ref_counted_t base; 6216 6217 /// 6218 /// Method that will be executed. Do not keep a reference to |entry| outside 6219 /// of this callback. Return true (1) to continue visiting entries or false 6220 /// (0) to stop. |current| is true (1) if this entry is the currently loaded 6221 /// navigation entry. |index| is the 0-based index of this entry and |total| 6222 /// is the total number of entries. 6223 /// 6224 extern(System) int function ( 6225 cef_navigation_entry_visitor_t* self, 6226 cef_navigation_entry_t* entry, 6227 int current, 6228 int index, 6229 int total) nothrow visit; 6230 } 6231 6232 6233 6234 /// 6235 /// Callback structure for cef_browser_host_t::PrintToPDF. The functions of this 6236 /// structure will be called on the browser process UI thread. 6237 /// 6238 struct cef_pdf_print_callback_t 6239 { 6240 /// 6241 /// Base structure. 6242 /// 6243 cef_base_ref_counted_t base; 6244 6245 /// 6246 /// Method that will be executed when the PDF printing has completed. |path| 6247 /// is the output path. |ok| will be true (1) if the printing completed 6248 /// successfully or false (0) otherwise. 6249 /// 6250 extern(System) void function ( 6251 cef_pdf_print_callback_t* self, 6252 const(cef_string_t)* path, 6253 int ok) nothrow on_pdf_print_finished; 6254 } 6255 6256 6257 6258 /// 6259 /// Callback structure for cef_browser_host_t::DownloadImage. The functions of 6260 /// this structure will be called on the browser process UI thread. 6261 /// 6262 struct cef_download_image_callback_t 6263 { 6264 /// 6265 /// Base structure. 6266 /// 6267 cef_base_ref_counted_t base; 6268 6269 /// 6270 /// Method that will be executed when the image download has completed. 6271 /// |image_url| is the URL that was downloaded and |http_status_code| is the 6272 /// resulting HTTP status code. |image| is the resulting image, possibly at 6273 /// multiple scale factors, or NULL if the download failed. 6274 /// 6275 extern(System) void function ( 6276 cef_download_image_callback_t* self, 6277 const(cef_string_t)* image_url, 6278 int http_status_code, 6279 cef_image_t* image) nothrow on_download_image_finished; 6280 } 6281 6282 6283 6284 /// 6285 /// Structure used to represent the browser process aspects of a browser. The 6286 /// functions of this structure can only be called in the browser process. They 6287 /// may be called on any thread in that process unless otherwise indicated in 6288 /// the comments. 6289 /// 6290 struct cef_browser_host_t 6291 { 6292 /// 6293 /// Base structure. 6294 /// 6295 cef_base_ref_counted_t base; 6296 6297 /// 6298 /// Returns the hosted browser object. 6299 /// 6300 extern(System) cef_browser_t* function (cef_browser_host_t* self) nothrow get_browser; 6301 6302 /// 6303 /// Request that the browser close. The JavaScript 'onbeforeunload' event will 6304 /// be fired. If |force_close| is false (0) the event handler, if any, will be 6305 /// allowed to prompt the user and the user can optionally cancel the close. 6306 /// If |force_close| is true (1) the prompt will not be displayed and the 6307 /// close will proceed. Results in a call to 6308 /// cef_life_span_handler_t::do_close() if the event handler allows the close 6309 /// or if |force_close| is true (1). See cef_life_span_handler_t::do_close() 6310 /// documentation for additional usage information. 6311 /// 6312 extern(System) void function (cef_browser_host_t* self, int force_close) nothrow close_browser; 6313 6314 /// 6315 /// Helper for closing a browser. Call this function from the top-level window 6316 /// close handler (if any). Internally this calls CloseBrowser(false (0)) if 6317 /// the close has not yet been initiated. This function returns false (0) 6318 /// while the close is pending and true (1) after the close has completed. See 6319 /// close_browser() and cef_life_span_handler_t::do_close() documentation for 6320 /// additional usage information. This function must be called on the browser 6321 /// process UI thread. 6322 /// 6323 extern(System) int function (cef_browser_host_t* self) nothrow try_close_browser; 6324 6325 /// 6326 /// Set whether the browser is focused. 6327 /// 6328 extern(System) void function (cef_browser_host_t* self, int focus) nothrow set_focus; 6329 6330 /// 6331 /// Retrieve the window handle (if any) for this browser. If this browser is 6332 /// wrapped in a cef_browser_view_t this function should be called on the 6333 /// browser process UI thread and it will return the handle for the top-level 6334 /// native window. 6335 /// 6336 extern(System) c_ulong function (cef_browser_host_t* self) nothrow get_window_handle; 6337 6338 /// 6339 /// Retrieve the window handle (if any) of the browser that opened this 6340 /// browser. Will return NULL for non-popup browsers or if this browser is 6341 /// wrapped in a cef_browser_view_t. This function can be used in combination 6342 /// with custom handling of modal windows. 6343 /// 6344 extern(System) c_ulong function (cef_browser_host_t* self) nothrow get_opener_window_handle; 6345 6346 /// 6347 /// Returns true (1) if this browser is wrapped in a cef_browser_view_t. 6348 /// 6349 extern(System) int function (cef_browser_host_t* self) nothrow has_view; 6350 6351 /// 6352 /// Returns the client for this browser. 6353 /// 6354 extern(System) cef_client_t* function (cef_browser_host_t* self) nothrow get_client; 6355 6356 /// 6357 /// Returns the request context for this browser. 6358 /// 6359 extern(System) cef_request_context_t* function ( 6360 cef_browser_host_t* self) nothrow get_request_context; 6361 6362 /// 6363 /// Get the current zoom level. The default zoom level is 0.0. This function 6364 /// can only be called on the UI thread. 6365 /// 6366 extern(System) double function (cef_browser_host_t* self) nothrow get_zoom_level; 6367 6368 /// 6369 /// Change the zoom level to the specified value. Specify 0.0 to reset the 6370 /// zoom level. If called on the UI thread the change will be applied 6371 /// immediately. Otherwise, the change will be applied asynchronously on the 6372 /// UI thread. 6373 /// 6374 extern(System) void function (cef_browser_host_t* self, double zoomLevel) nothrow set_zoom_level; 6375 6376 /// 6377 /// Call to run a file chooser dialog. Only a single file chooser dialog may 6378 /// be pending at any given time. |mode| represents the type of dialog to 6379 /// display. |title| to the title to be used for the dialog and may be NULL to 6380 /// show the default title ("Open" or "Save" depending on the mode). 6381 /// |default_file_path| is the path with optional directory and/or file name 6382 /// component that will be initially selected in the dialog. |accept_filters| 6383 /// are used to restrict the selectable file types and may any combination of 6384 /// (a) valid lower-cased MIME types (e.g. "text/*" or "image/*"), (b) 6385 /// individual file extensions (e.g. ".txt" or ".png"), or (c) combined 6386 /// description and file extension delimited using "|" and ";" (e.g. "Image 6387 /// Types|.png;.gif;.jpg"). |callback| will be executed after the dialog is 6388 /// dismissed or immediately if another dialog is already pending. The dialog 6389 /// will be initiated asynchronously on the UI thread. 6390 /// 6391 extern(System) void function ( 6392 cef_browser_host_t* self, 6393 cef_file_dialog_mode_t mode, 6394 const(cef_string_t)* title, 6395 const(cef_string_t)* default_file_path, 6396 cef_string_list_t accept_filters, 6397 cef_run_file_dialog_callback_t* callback) nothrow run_file_dialog; 6398 6399 /// 6400 /// Download the file at |url| using cef_download_handler_t. 6401 /// 6402 extern(System) void function ( 6403 cef_browser_host_t* self, 6404 const(cef_string_t)* url) nothrow start_download; 6405 6406 /// 6407 /// Download |image_url| and execute |callback| on completion with the images 6408 /// received from the renderer. If |is_favicon| is true (1) then cookies are 6409 /// not sent and not accepted during download. Images with density independent 6410 /// pixel (DIP) sizes larger than |max_image_size| are filtered out from the 6411 /// image results. Versions of the image at different scale factors may be 6412 /// downloaded up to the maximum scale factor supported by the system. If 6413 /// there are no image results <= |max_image_size| then the smallest image is 6414 /// resized to |max_image_size| and is the only result. A |max_image_size| of 6415 /// 0 means unlimited. If |bypass_cache| is true (1) then |image_url| is 6416 /// requested from the server even if it is present in the browser cache. 6417 /// 6418 extern(System) void function ( 6419 cef_browser_host_t* self, 6420 const(cef_string_t)* image_url, 6421 int is_favicon, 6422 uint32 max_image_size, 6423 int bypass_cache, 6424 cef_download_image_callback_t* callback) nothrow download_image; 6425 6426 /// 6427 /// Print the current browser contents. 6428 /// 6429 extern(System) void function (cef_browser_host_t* self) nothrow print; 6430 6431 /// 6432 /// Print the current browser contents to the PDF file specified by |path| and 6433 /// execute |callback| on completion. The caller is responsible for deleting 6434 /// |path| when done. For PDF printing to work on Linux you must implement the 6435 /// cef_print_handler_t::GetPdfPaperSize function. 6436 /// 6437 extern(System) void function ( 6438 cef_browser_host_t* self, 6439 const(cef_string_t)* path, 6440 const(cef_pdf_print_settings_t)* settings, 6441 cef_pdf_print_callback_t* callback) nothrow print_to_pdf; 6442 6443 /// 6444 /// Search for |searchText|. |forward| indicates whether to search forward or 6445 /// backward within the page. |matchCase| indicates whether the search should 6446 /// be case-sensitive. |findNext| indicates whether this is the first request 6447 /// or a follow-up. The search will be restarted if |searchText| or 6448 /// |matchCase| change. The search will be stopped if |searchText| is NULL. 6449 /// The cef_find_handler_t instance, if any, returned via 6450 /// cef_client_t::GetFindHandler will be called to report find results. 6451 /// 6452 extern(System) void function ( 6453 cef_browser_host_t* self, 6454 const(cef_string_t)* searchText, 6455 int forward, 6456 int matchCase, 6457 int findNext) nothrow find; 6458 6459 /// 6460 /// Cancel all searches that are currently going on. 6461 /// 6462 extern(System) void function (cef_browser_host_t* self, int clearSelection) nothrow stop_finding; 6463 6464 /// 6465 /// Open developer tools (DevTools) in its own browser. The DevTools browser 6466 /// will remain associated with this browser. If the DevTools browser is 6467 /// already open then it will be focused, in which case the |windowInfo|, 6468 /// |client| and |settings| parameters will be ignored. If 6469 /// |inspect_element_at| is non-NULL then the element at the specified (x,y) 6470 /// location will be inspected. The |windowInfo| parameter will be ignored if 6471 /// this browser is wrapped in a cef_browser_view_t. 6472 /// 6473 extern(System) void function ( 6474 cef_browser_host_t* self, 6475 const(cef_window_info_t)* windowInfo, 6476 cef_client_t* client, 6477 const(cef_browser_settings_t)* settings, 6478 const(cef_point_t)* inspect_element_at) nothrow show_dev_tools; 6479 6480 /// 6481 /// Explicitly close the associated DevTools browser, if any. 6482 /// 6483 extern(System) void function (cef_browser_host_t* self) nothrow close_dev_tools; 6484 6485 /// 6486 /// Returns true (1) if this browser currently has an associated DevTools 6487 /// browser. Must be called on the browser process UI thread. 6488 /// 6489 extern(System) int function (cef_browser_host_t* self) nothrow has_dev_tools; 6490 6491 /// 6492 /// Send a function call message over the DevTools protocol. |message| must be 6493 /// a UTF8-encoded JSON dictionary that contains "id" (int), "function" 6494 /// (string) and "params" (dictionary, optional) values. See the DevTools 6495 /// protocol documentation at https://chromedevtools.github.io/devtools- 6496 /// protocol/ for details of supported functions and the expected "params" 6497 /// dictionary contents. |message| will be copied if necessary. This function 6498 /// will return true (1) if called on the UI thread and the message was 6499 /// successfully submitted for validation, otherwise false (0). Validation 6500 /// will be applied asynchronously and any messages that fail due to 6501 /// formatting errors or missing parameters may be discarded without 6502 /// notification. Prefer ExecuteDevToolsMethod if a more structured approach 6503 /// to message formatting is desired. 6504 /// 6505 /// Every valid function call will result in an asynchronous function result 6506 /// or error message that references the sent message "id". Event messages are 6507 /// received while notifications are enabled (for example, between function 6508 /// calls for "Page.enable" and "Page.disable"). All received messages will be 6509 /// delivered to the observer(s) registered with AddDevToolsMessageObserver. 6510 /// See cef_dev_tools_message_observer_t::OnDevToolsMessage documentation for 6511 /// details of received message contents. 6512 /// 6513 /// Usage of the SendDevToolsMessage, ExecuteDevToolsMethod and 6514 /// AddDevToolsMessageObserver functions does not require an active DevTools 6515 /// front-end or remote-debugging session. Other active DevTools sessions will 6516 /// continue to function independently. However, any modification of global 6517 /// browser state by one session may not be reflected in the UI of other 6518 /// sessions. 6519 /// 6520 /// Communication with the DevTools front-end (when displayed) can be logged 6521 /// for development purposes by passing the `--devtools-protocol-log- 6522 /// file=<path>` command-line flag. 6523 /// 6524 extern(System) int function ( 6525 cef_browser_host_t* self, 6526 const(void)* message, 6527 size_t message_size) nothrow send_dev_tools_message; 6528 6529 /// 6530 /// Execute a function call over the DevTools protocol. This is a more 6531 /// structured version of SendDevToolsMessage. |message_id| is an incremental 6532 /// number that uniquely identifies the message (pass 0 to have the next 6533 /// number assigned automatically based on previous values). |function| is the 6534 /// function name. |params| are the function parameters, which may be NULL. 6535 /// See the DevTools protocol documentation (linked above) for details of 6536 /// supported functions and the expected |params| dictionary contents. This 6537 /// function will return the assigned message ID if called on the UI thread 6538 /// and the message was successfully submitted for validation, otherwise 0. 6539 /// See the SendDevToolsMessage documentation for additional usage 6540 /// information. 6541 /// 6542 extern(System) int function ( 6543 cef_browser_host_t* self, 6544 int message_id, 6545 const(cef_string_t)* method, 6546 cef_dictionary_value_t* params) nothrow execute_dev_tools_method; 6547 6548 /// 6549 /// Add an observer for DevTools protocol messages (function results and 6550 /// events). The observer will remain registered until the returned 6551 /// Registration object is destroyed. See the SendDevToolsMessage 6552 /// documentation for additional usage information. 6553 /// 6554 extern(System) cef_registration_t* function ( 6555 cef_browser_host_t* self, 6556 cef_dev_tools_message_observer_t* observer) nothrow add_dev_tools_message_observer; 6557 6558 /// 6559 /// Retrieve a snapshot of current navigation entries as values sent to the 6560 /// specified visitor. If |current_only| is true (1) only the current 6561 /// navigation entry will be sent, otherwise all navigation entries will be 6562 /// sent. 6563 /// 6564 extern(System) void function ( 6565 cef_browser_host_t* self, 6566 cef_navigation_entry_visitor_t* visitor, 6567 int current_only) nothrow get_navigation_entries; 6568 6569 /// 6570 /// If a misspelled word is currently selected in an editable node calling 6571 /// this function will replace it with the specified |word|. 6572 /// 6573 extern(System) void function ( 6574 cef_browser_host_t* self, 6575 const(cef_string_t)* word) nothrow replace_misspelling; 6576 6577 /// 6578 /// Add the specified |word| to the spelling dictionary. 6579 /// 6580 extern(System) void function ( 6581 cef_browser_host_t* self, 6582 const(cef_string_t)* word) nothrow add_word_to_dictionary; 6583 6584 /// 6585 /// Returns true (1) if window rendering is disabled. 6586 /// 6587 extern(System) int function (cef_browser_host_t* self) nothrow is_window_rendering_disabled; 6588 6589 /// 6590 /// Notify the browser that the widget has been resized. The browser will 6591 /// first call cef_render_handler_t::GetViewRect to get the new size and then 6592 /// call cef_render_handler_t::OnPaint asynchronously with the updated 6593 /// regions. This function is only used when window rendering is disabled. 6594 /// 6595 extern(System) void function (cef_browser_host_t* self) nothrow was_resized; 6596 6597 /// 6598 /// Notify the browser that it has been hidden or shown. Layouting and 6599 /// cef_render_handler_t::OnPaint notification will stop when the browser is 6600 /// hidden. This function is only used when window rendering is disabled. 6601 /// 6602 extern(System) void function (cef_browser_host_t* self, int hidden) nothrow was_hidden; 6603 6604 /// 6605 /// Send a notification to the browser that the screen info has changed. The 6606 /// browser will then call cef_render_handler_t::GetScreenInfo to update the 6607 /// screen information with the new values. This simulates moving the webview 6608 /// window from one display to another, or changing the properties of the 6609 /// current display. This function is only used when window rendering is 6610 /// disabled. 6611 /// 6612 extern(System) void function (cef_browser_host_t* self) nothrow notify_screen_info_changed; 6613 6614 /// 6615 /// Invalidate the view. The browser will call cef_render_handler_t::OnPaint 6616 /// asynchronously. This function is only used when window rendering is 6617 /// disabled. 6618 /// 6619 extern(System) void function ( 6620 cef_browser_host_t* self, 6621 cef_paint_element_type_t type) nothrow invalidate; 6622 6623 /// 6624 /// Issue a BeginFrame request to Chromium. Only valid when 6625 /// cef_window_tInfo::external_begin_frame_enabled is set to true (1). 6626 /// 6627 extern(System) void function (cef_browser_host_t* self) nothrow send_external_begin_frame; 6628 6629 /// 6630 /// Send a key event to the browser. 6631 /// 6632 extern(System) void function ( 6633 cef_browser_host_t* self, 6634 const(cef_key_event_t)* event) nothrow send_key_event; 6635 6636 /// 6637 /// Send a mouse click event to the browser. The |x| and |y| coordinates are 6638 /// relative to the upper-left corner of the view. 6639 /// 6640 extern(System) void function ( 6641 cef_browser_host_t* self, 6642 const(cef_mouse_event_t)* event, 6643 cef_mouse_button_type_t type, 6644 int mouseUp, 6645 int clickCount) nothrow send_mouse_click_event; 6646 6647 /// 6648 /// Send a mouse move event to the browser. The |x| and |y| coordinates are 6649 /// relative to the upper-left corner of the view. 6650 /// 6651 extern(System) void function ( 6652 cef_browser_host_t* self, 6653 const(cef_mouse_event_t)* event, 6654 int mouseLeave) nothrow send_mouse_move_event; 6655 6656 /// 6657 /// Send a mouse wheel event to the browser. The |x| and |y| coordinates are 6658 /// relative to the upper-left corner of the view. The |deltaX| and |deltaY| 6659 /// values represent the movement delta in the X and Y directions 6660 /// respectively. In order to scroll inside select popups with window 6661 /// rendering disabled cef_render_handler_t::GetScreenPoint should be 6662 /// implemented properly. 6663 /// 6664 extern(System) void function ( 6665 cef_browser_host_t* self, 6666 const(cef_mouse_event_t)* event, 6667 int deltaX, 6668 int deltaY) nothrow send_mouse_wheel_event; 6669 6670 /// 6671 /// Send a touch event to the browser for a windowless browser. 6672 /// 6673 extern(System) void function ( 6674 cef_browser_host_t* self, 6675 const(cef_touch_event_t)* event) nothrow send_touch_event; 6676 6677 /// 6678 /// Send a capture lost event to the browser. 6679 /// 6680 extern(System) void function (cef_browser_host_t* self) nothrow send_capture_lost_event; 6681 6682 /// 6683 /// Notify the browser that the window hosting it is about to be moved or 6684 /// resized. This function is only used on Windows and Linux. 6685 /// 6686 extern(System) void function (cef_browser_host_t* self) nothrow notify_move_or_resize_started; 6687 6688 /// 6689 /// Returns the maximum rate in frames per second (fps) that 6690 /// cef_render_handler_t::OnPaint will be called for a windowless browser. The 6691 /// actual fps may be lower if the browser cannot generate frames at the 6692 /// requested rate. The minimum value is 1 and the maximum value is 60 6693 /// (default 30). This function can only be called on the UI thread. 6694 /// 6695 extern(System) int function (cef_browser_host_t* self) nothrow get_windowless_frame_rate; 6696 6697 /// 6698 /// Set the maximum rate in frames per second (fps) that 6699 /// cef_render_handler_t:: OnPaint will be called for a windowless browser. 6700 /// The actual fps may be lower if the browser cannot generate frames at the 6701 /// requested rate. The minimum value is 1 and the maximum value is 60 6702 /// (default 30). Can also be set at browser creation via 6703 /// cef_browser_tSettings.windowless_frame_rate. 6704 /// 6705 extern(System) void function ( 6706 cef_browser_host_t* self, 6707 int frame_rate) nothrow set_windowless_frame_rate; 6708 6709 /// 6710 /// Begins a new composition or updates the existing composition. Blink has a 6711 /// special node (a composition node) that allows the input function to change 6712 /// text without affecting other DOM nodes. |text| is the optional text that 6713 /// will be inserted into the composition node. |underlines| is an optional 6714 /// set of ranges that will be underlined in the resulting text. 6715 /// |replacement_range| is an optional range of the existing text that will be 6716 /// replaced. |selection_range| is an optional range of the resulting text 6717 /// that will be selected after insertion or replacement. The 6718 /// |replacement_range| value is only used on OS X. 6719 /// 6720 /// This function may be called multiple times as the composition changes. 6721 /// When the client is done making changes the composition should either be 6722 /// canceled or completed. To cancel the composition call 6723 /// ImeCancelComposition. To complete the composition call either 6724 /// ImeCommitText or ImeFinishComposingText. Completion is usually signaled 6725 /// when: 6726 /// 6727 /// 1. The client receives a WM_IME_COMPOSITION message with a GCS_RESULTSTR 6728 /// flag (on Windows), or; 6729 /// 2. The client receives a "commit" signal of GtkIMContext (on Linux), or; 6730 /// 3. insertText of NSTextInput is called (on Mac). 6731 /// 6732 /// This function is only used when window rendering is disabled. 6733 /// 6734 extern(System) void function ( 6735 cef_browser_host_t* self, 6736 const(cef_string_t)* text, 6737 size_t underlinesCount, 6738 const(cef_composition_underline_t)* underlines, 6739 const(cef_range_t)* replacement_range, 6740 const(cef_range_t)* selection_range) nothrow ime_set_composition; 6741 6742 /// 6743 /// Completes the existing composition by optionally inserting the specified 6744 /// |text| into the composition node. |replacement_range| is an optional range 6745 /// of the existing text that will be replaced. |relative_cursor_pos| is where 6746 /// the cursor will be positioned relative to the current cursor position. See 6747 /// comments on ImeSetComposition for usage. The |replacement_range| and 6748 /// |relative_cursor_pos| values are only used on OS X. This function is only 6749 /// used when window rendering is disabled. 6750 /// 6751 extern(System) void function ( 6752 cef_browser_host_t* self, 6753 const(cef_string_t)* text, 6754 const(cef_range_t)* replacement_range, 6755 int relative_cursor_pos) nothrow ime_commit_text; 6756 6757 /// 6758 /// Completes the existing composition by applying the current composition 6759 /// node contents. If |keep_selection| is false (0) the current selection, if 6760 /// any, will be discarded. See comments on ImeSetComposition for usage. This 6761 /// function is only used when window rendering is disabled. 6762 /// 6763 extern(System) void function ( 6764 cef_browser_host_t* self, 6765 int keep_selection) nothrow ime_finish_composing_text; 6766 6767 /// 6768 /// Cancels the existing composition and discards the composition node 6769 /// contents without applying them. See comments on ImeSetComposition for 6770 /// usage. This function is only used when window rendering is disabled. 6771 /// 6772 extern(System) void function (cef_browser_host_t* self) nothrow ime_cancel_composition; 6773 6774 /// 6775 /// Call this function when the user drags the mouse into the web view (before 6776 /// calling DragTargetDragOver/DragTargetLeave/DragTargetDrop). |drag_data| 6777 /// should not contain file contents as this type of data is not allowed to be 6778 /// dragged into the web view. File contents can be removed using 6779 /// cef_drag_data_t::ResetFileContents (for example, if |drag_data| comes from 6780 /// cef_render_handler_t::StartDragging). This function is only used when 6781 /// window rendering is disabled. 6782 /// 6783 extern(System) void function ( 6784 cef_browser_host_t* self, 6785 cef_drag_data_t* drag_data, 6786 const(cef_mouse_event_t)* event, 6787 cef_drag_operations_mask_t allowed_ops) nothrow drag_target_drag_enter; 6788 6789 /// 6790 /// Call this function each time the mouse is moved across the web view during 6791 /// a drag operation (after calling DragTargetDragEnter and before calling 6792 /// DragTargetDragLeave/DragTargetDrop). This function is only used when 6793 /// window rendering is disabled. 6794 /// 6795 extern(System) void function ( 6796 cef_browser_host_t* self, 6797 const(cef_mouse_event_t)* event, 6798 cef_drag_operations_mask_t allowed_ops) nothrow drag_target_drag_over; 6799 6800 /// 6801 /// Call this function when the user drags the mouse out of the web view 6802 /// (after calling DragTargetDragEnter). This function is only used when 6803 /// window rendering is disabled. 6804 /// 6805 extern(System) void function (cef_browser_host_t* self) nothrow drag_target_drag_leave; 6806 6807 /// 6808 /// Call this function when the user completes the drag operation by dropping 6809 /// the object onto the web view (after calling DragTargetDragEnter). The 6810 /// object being dropped is |drag_data|, given as an argument to the previous 6811 /// DragTargetDragEnter call. This function is only used when window rendering 6812 /// is disabled. 6813 /// 6814 extern(System) void function ( 6815 cef_browser_host_t* self, 6816 const(cef_mouse_event_t)* event) nothrow drag_target_drop; 6817 6818 /// 6819 /// Call this function when the drag operation started by a 6820 /// cef_render_handler_t::StartDragging call has ended either in a drop or by 6821 /// being cancelled. |x| and |y| are mouse coordinates relative to the upper- 6822 /// left corner of the view. If the web view is both the drag source and the 6823 /// drag target then all DragTarget* functions should be called before 6824 /// DragSource* mthods. This function is only used when window rendering is 6825 /// disabled. 6826 /// 6827 extern(System) void function ( 6828 cef_browser_host_t* self, 6829 int x, 6830 int y, 6831 cef_drag_operations_mask_t op) nothrow drag_source_ended_at; 6832 6833 /// 6834 /// Call this function when the drag operation started by a 6835 /// cef_render_handler_t::StartDragging call has completed. This function may 6836 /// be called immediately without first calling DragSourceEndedAt to cancel a 6837 /// drag operation. If the web view is both the drag source and the drag 6838 /// target then all DragTarget* functions should be called before DragSource* 6839 /// mthods. This function is only used when window rendering is disabled. 6840 /// 6841 extern(System) void function (cef_browser_host_t* self) nothrow drag_source_system_drag_ended; 6842 6843 /// 6844 /// Returns the current visible navigation entry for this browser. This 6845 /// function can only be called on the UI thread. 6846 /// 6847 extern(System) cef_navigation_entry_t* function ( 6848 cef_browser_host_t* self) nothrow get_visible_navigation_entry; 6849 6850 /// 6851 /// Set accessibility state for all frames. |accessibility_state| may be 6852 /// default, enabled or disabled. If |accessibility_state| is STATE_DEFAULT 6853 /// then accessibility will be disabled by default and the state may be 6854 /// further controlled with the "force-renderer-accessibility" and "disable- 6855 /// renderer-accessibility" command-line switches. If |accessibility_state| is 6856 /// STATE_ENABLED then accessibility will be enabled. If |accessibility_state| 6857 /// is STATE_DISABLED then accessibility will be completely disabled. 6858 /// 6859 /// For windowed browsers accessibility will be enabled in Complete mode 6860 /// (which corresponds to kAccessibilityModeComplete in Chromium). In this 6861 /// mode all platform accessibility objects will be created and managed by 6862 /// Chromium's internal implementation. The client needs only to detect the 6863 /// screen reader and call this function appropriately. For example, on macOS 6864 /// the client can handle the @"AXEnhancedUserStructure" accessibility 6865 /// attribute to detect VoiceOver state changes and on Windows the client can 6866 /// handle WM_GETOBJECT with OBJID_CLIENT to detect accessibility readers. 6867 /// 6868 /// For windowless browsers accessibility will be enabled in TreeOnly mode 6869 /// (which corresponds to kAccessibilityModeWebContentsOnly in Chromium). In 6870 /// this mode renderer accessibility is enabled, the full tree is computed, 6871 /// and events are passed to CefAccessibiltyHandler, but platform 6872 /// accessibility objects are not created. The client may implement platform 6873 /// accessibility objects using CefAccessibiltyHandler callbacks if desired. 6874 /// 6875 extern(System) void function ( 6876 cef_browser_host_t* self, 6877 cef_state_t accessibility_state) nothrow set_accessibility_state; 6878 6879 /// 6880 /// Enable notifications of auto resize via 6881 /// cef_display_handler_t::OnAutoResize. Notifications are disabled by 6882 /// default. |min_size| and |max_size| define the range of allowed sizes. 6883 /// 6884 extern(System) void function ( 6885 cef_browser_host_t* self, 6886 int enabled, 6887 const(cef_size_t)* min_size, 6888 const(cef_size_t)* max_size) nothrow set_auto_resize_enabled; 6889 6890 /// 6891 /// Returns the extension hosted in this browser or NULL if no extension is 6892 /// hosted. See cef_request_context_t::LoadExtension for details. 6893 /// 6894 extern(System) cef_extension_t* function (cef_browser_host_t* self) nothrow get_extension; 6895 6896 /// 6897 /// Returns true (1) if this browser is hosting an extension background 6898 /// script. Background hosts do not have a window and are not displayable. See 6899 /// cef_request_context_t::LoadExtension for details. 6900 /// 6901 extern(System) int function (cef_browser_host_t* self) nothrow is_background_host; 6902 6903 /// 6904 /// Set whether the browser's audio is muted. 6905 /// 6906 extern(System) void function (cef_browser_host_t* self, int mute) nothrow set_audio_muted; 6907 6908 /// 6909 /// Returns true (1) if the browser's audio is muted. This function can only 6910 /// be called on the UI thread. 6911 /// 6912 extern(System) int function (cef_browser_host_t* self) nothrow is_audio_muted; 6913 } 6914 6915 6916 6917 /// 6918 /// Create a new browser using the window parameters specified by |windowInfo|. 6919 /// All values will be copied internally and the actual window (if any) will be 6920 /// created on the UI thread. If |request_context| is NULL the global request 6921 /// context will be used. This function can be called on any browser process 6922 /// thread and will not block. The optional |extra_info| parameter provides an 6923 /// opportunity to specify extra information specific to the created browser 6924 /// that will be passed to cef_render_process_handler_t::on_browser_created() in 6925 /// the render process. 6926 /// 6927 int cef_browser_host_create_browser ( 6928 const(cef_window_info_t)* windowInfo, 6929 cef_client_t* client, 6930 const(cef_string_t)* url, 6931 const(cef_browser_settings_t)* settings, 6932 cef_dictionary_value_t* extra_info, 6933 cef_request_context_t* request_context); 6934 6935 /// 6936 /// Create a new browser using the window parameters specified by |windowInfo|. 6937 /// If |request_context| is NULL the global request context will be used. This 6938 /// function can only be called on the browser process UI thread. The optional 6939 /// |extra_info| parameter provides an opportunity to specify extra information 6940 /// specific to the created browser that will be passed to 6941 /// cef_render_process_handler_t::on_browser_created() in the render process. 6942 /// 6943 cef_browser_t* cef_browser_host_create_browser_sync ( 6944 const(cef_window_info_t)* windowInfo, 6945 cef_client_t* client, 6946 const(cef_string_t)* url, 6947 const(cef_browser_settings_t)* settings, 6948 cef_dictionary_value_t* extra_info, 6949 cef_request_context_t* request_context); 6950 6951 // CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_ 6952 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 6953 // 6954 // Redistribution and use in source and binary forms, with or without 6955 // modification, are permitted provided that the following conditions are 6956 // met: 6957 // 6958 // * Redistributions of source code must retain the above copyright 6959 // notice, this list of conditions and the following disclaimer. 6960 // * Redistributions in binary form must reproduce the above 6961 // copyright notice, this list of conditions and the following disclaimer 6962 // in the documentation and/or other materials provided with the 6963 // distribution. 6964 // * Neither the name of Google Inc. nor the name Chromium Embedded 6965 // Framework nor the names of its contributors may be used to endorse 6966 // or promote products derived from this software without specific prior 6967 // written permission. 6968 // 6969 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 6970 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 6971 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 6972 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 6973 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 6974 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 6975 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 6976 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 6977 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 6978 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 6979 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 6980 // 6981 // --------------------------------------------------------------------------- 6982 // 6983 // This file was generated by the CEF translator tool and should not edited 6984 // by hand. See the translator.README.txt file in the tools directory for 6985 // more information. 6986 // 6987 // $hash=c4ed4278e513daa2a1ccf42e50e242d61dfbb86f$ 6988 // 6989 6990 extern (C): 6991 6992 /// 6993 /// Structure used to implement browser process callbacks. The functions of this 6994 /// structure will be called on the browser process main thread unless otherwise 6995 /// indicated. 6996 /// 6997 struct cef_browser_process_handler_t 6998 { 6999 /// 7000 /// Base structure. 7001 /// 7002 cef_base_ref_counted_t base; 7003 7004 /// 7005 /// Called on the browser process UI thread immediately after the CEF context 7006 /// has been initialized. 7007 /// 7008 extern(System) void function ( 7009 cef_browser_process_handler_t* self) nothrow on_context_initialized; 7010 7011 /// 7012 /// Called before a child process is launched. Will be called on the browser 7013 /// process UI thread when launching a render process and on the browser 7014 /// process IO thread when launching a GPU process. Provides an opportunity to 7015 /// modify the child process command line. Do not keep a reference to 7016 /// |command_line| outside of this function. 7017 /// 7018 extern(System) void function ( 7019 cef_browser_process_handler_t* self, 7020 cef_command_line_t* command_line) nothrow on_before_child_process_launch; 7021 7022 /// 7023 /// Called from any thread when work has been scheduled for the browser 7024 /// process main (UI) thread. This callback is used in combination with 7025 /// cef_settings_t.external_message_pump and cef_do_message_loop_work() in 7026 /// cases where the CEF message loop must be integrated into an existing 7027 /// application message loop (see additional comments and warnings on 7028 /// CefDoMessageLoopWork). This callback should schedule a 7029 /// cef_do_message_loop_work() call to happen on the main (UI) thread. 7030 /// |delay_ms| is the requested delay in milliseconds. If |delay_ms| is <= 0 7031 /// then the call should happen reasonably soon. If |delay_ms| is > 0 then the 7032 /// call should be scheduled to happen after the specified delay and any 7033 /// currently pending scheduled call should be cancelled. 7034 /// 7035 extern(System) void function ( 7036 cef_browser_process_handler_t* self, 7037 int64 delay_ms) nothrow on_schedule_message_pump_work; 7038 7039 /// 7040 /// Return the default client for use with a newly created browser window. If 7041 /// null is returned the browser will be unmanaged (no callbacks will be 7042 /// executed for that browser) and application shutdown will be blocked until 7043 /// the browser window is closed manually. This function is currently only 7044 /// used with the chrome runtime. 7045 /// 7046 extern(System) cef_client_t* function ( 7047 cef_browser_process_handler_t* self) nothrow get_default_client; 7048 } 7049 7050 7051 7052 // CEF_INCLUDE_CAPI_CEF_BROWSER_PROCESS_HANDLER_CAPI_H_ 7053 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 7054 // 7055 // Redistribution and use in source and binary forms, with or without 7056 // modification, are permitted provided that the following conditions are 7057 // met: 7058 // 7059 // * Redistributions of source code must retain the above copyright 7060 // notice, this list of conditions and the following disclaimer. 7061 // * Redistributions in binary form must reproduce the above 7062 // copyright notice, this list of conditions and the following disclaimer 7063 // in the documentation and/or other materials provided with the 7064 // distribution. 7065 // * Neither the name of Google Inc. nor the name Chromium Embedded 7066 // Framework nor the names of its contributors may be used to endorse 7067 // or promote products derived from this software without specific prior 7068 // written permission. 7069 // 7070 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 7071 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 7072 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 7073 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 7074 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 7075 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 7076 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 7077 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 7078 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 7079 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 7080 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 7081 // 7082 // --------------------------------------------------------------------------- 7083 // 7084 // This file was generated by the CEF translator tool and should not edited 7085 // by hand. See the translator.README.txt file in the tools directory for 7086 // more information. 7087 // 7088 // $hash=1bb026d01d1d4bb38ceb4c54f6bcf70300bf5201$ 7089 // 7090 7091 extern (C): 7092 7093 /// 7094 /// Generic callback structure used for asynchronous continuation. 7095 /// 7096 struct cef_callback_t 7097 { 7098 /// 7099 /// Base structure. 7100 /// 7101 cef_base_ref_counted_t base; 7102 7103 /// 7104 /// Continue processing. 7105 /// 7106 extern(System) void function (cef_callback_t* self) nothrow cont; 7107 7108 /// 7109 /// Cancel processing. 7110 /// 7111 extern(System) void function (cef_callback_t* self) nothrow cancel; 7112 } 7113 7114 7115 7116 /// 7117 /// Generic callback structure used for asynchronous completion. 7118 /// 7119 struct cef_completion_callback_t 7120 { 7121 /// 7122 /// Base structure. 7123 /// 7124 cef_base_ref_counted_t base; 7125 7126 /// 7127 /// Method that will be called once the task is complete. 7128 /// 7129 extern(System) void function (cef_completion_callback_t* self) nothrow on_complete; 7130 } 7131 7132 7133 7134 // CEF_INCLUDE_CAPI_CEF_CALLBACK_CAPI_H_ 7135 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 7136 // 7137 // Redistribution and use in source and binary forms, with or without 7138 // modification, are permitted provided that the following conditions are 7139 // met: 7140 // 7141 // * Redistributions of source code must retain the above copyright 7142 // notice, this list of conditions and the following disclaimer. 7143 // * Redistributions in binary form must reproduce the above 7144 // copyright notice, this list of conditions and the following disclaimer 7145 // in the documentation and/or other materials provided with the 7146 // distribution. 7147 // * Neither the name of Google Inc. nor the name Chromium Embedded 7148 // Framework nor the names of its contributors may be used to endorse 7149 // or promote products derived from this software without specific prior 7150 // written permission. 7151 // 7152 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 7153 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 7154 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 7155 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 7156 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 7157 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 7158 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 7159 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 7160 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 7161 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 7162 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 7163 // 7164 // --------------------------------------------------------------------------- 7165 // 7166 // This file was generated by the CEF translator tool and should not edited 7167 // by hand. See the translator.README.txt file in the tools directory for 7168 // more information. 7169 // 7170 // $hash=93f1c39c102dc97d6ad8d236a90a2e0e88f10fb7$ 7171 // 7172 7173 extern (C): 7174 7175 /// 7176 /// Implement this structure to provide handler implementations. 7177 /// 7178 struct cef_client_t 7179 { 7180 /// 7181 /// Base structure. 7182 /// 7183 cef_base_ref_counted_t base; 7184 7185 /// 7186 /// Return the handler for audio rendering events. 7187 /// 7188 extern(System) cef_audio_handler_t* function (cef_client_t* self) nothrow get_audio_handler; 7189 7190 /// 7191 /// Return the handler for commands. If no handler is provided the default 7192 /// implementation will be used. 7193 /// 7194 extern(System) cef_command_handler_t* function (cef_client_t* self) nothrow get_command_handler; 7195 7196 /// 7197 /// Return the handler for context menus. If no handler is provided the 7198 /// default implementation will be used. 7199 /// 7200 extern(System) cef_context_menu_handler_t* function ( 7201 cef_client_t* self) nothrow get_context_menu_handler; 7202 7203 /// 7204 /// Return the handler for dialogs. If no handler is provided the default 7205 /// implementation will be used. 7206 /// 7207 extern(System) cef_dialog_handler_t* function (cef_client_t* self) nothrow get_dialog_handler; 7208 7209 /// 7210 /// Return the handler for browser display state events. 7211 /// 7212 extern(System) cef_display_handler_t* function (cef_client_t* self) nothrow get_display_handler; 7213 7214 /// 7215 /// Return the handler for download events. If no handler is returned 7216 /// downloads will not be allowed. 7217 /// 7218 extern(System) cef_download_handler_t* function ( 7219 cef_client_t* self) nothrow get_download_handler; 7220 7221 /// 7222 /// Return the handler for drag events. 7223 /// 7224 extern(System) cef_drag_handler_t* function (cef_client_t* self) nothrow get_drag_handler; 7225 7226 /// 7227 /// Return the handler for find result events. 7228 /// 7229 extern(System) cef_find_handler_t* function (cef_client_t* self) nothrow get_find_handler; 7230 7231 /// 7232 /// Return the handler for focus events. 7233 /// 7234 extern(System) cef_focus_handler_t* function (cef_client_t* self) nothrow get_focus_handler; 7235 7236 /// 7237 /// Return the handler for events related to cef_frame_t lifespan. This 7238 /// function will be called once during cef_browser_t creation and the result 7239 /// will be cached for performance reasons. 7240 /// 7241 extern(System) cef_frame_handler_t* function (cef_client_t* self) nothrow get_frame_handler; 7242 7243 /// 7244 /// Return the handler for permission requests. 7245 /// 7246 extern(System) cef_permission_handler_t* function ( 7247 cef_client_t* self) nothrow get_permission_handler; 7248 7249 /// 7250 /// Return the handler for JavaScript dialogs. If no handler is provided the 7251 /// default implementation will be used. 7252 /// 7253 extern(System) cef_jsdialog_handler_t* function ( 7254 cef_client_t* self) nothrow get_jsdialog_handler; 7255 7256 /// 7257 /// Return the handler for keyboard events. 7258 /// 7259 extern(System) cef_keyboard_handler_t* function ( 7260 cef_client_t* self) nothrow get_keyboard_handler; 7261 7262 /// 7263 /// Return the handler for browser life span events. 7264 /// 7265 extern(System) cef_life_span_handler_t* function ( 7266 cef_client_t* self) nothrow get_life_span_handler; 7267 7268 /// 7269 /// Return the handler for browser load status events. 7270 /// 7271 extern(System) cef_load_handler_t* function (cef_client_t* self) nothrow get_load_handler; 7272 7273 /// 7274 /// Return the handler for printing on Linux. If a print handler is not 7275 /// provided then printing will not be supported on the Linux platform. 7276 /// 7277 extern(System) cef_print_handler_t* function (cef_client_t* self) nothrow get_print_handler; 7278 7279 /// 7280 /// Return the handler for off-screen rendering events. 7281 /// 7282 extern(System) cef_render_handler_t* function (cef_client_t* self) nothrow get_render_handler; 7283 7284 /// 7285 /// Return the handler for browser request events. 7286 /// 7287 extern(System) cef_request_handler_t* function (cef_client_t* self) nothrow get_request_handler; 7288 7289 /// 7290 /// Called when a new message is received from a different process. Return 7291 /// true (1) if the message was handled or false (0) otherwise. It is safe to 7292 /// keep a reference to |message| outside of this callback. 7293 /// 7294 extern(System) int function ( 7295 cef_client_t* self, 7296 cef_browser_t* browser, 7297 cef_frame_t* frame, 7298 cef_process_id_t source_process, 7299 cef_process_message_t* message) nothrow on_process_message_received; 7300 } 7301 7302 7303 7304 // CEF_INCLUDE_CAPI_CEF_CLIENT_CAPI_H_ 7305 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 7306 // 7307 // Redistribution and use in source and binary forms, with or without 7308 // modification, are permitted provided that the following conditions are 7309 // met: 7310 // 7311 // * Redistributions of source code must retain the above copyright 7312 // notice, this list of conditions and the following disclaimer. 7313 // * Redistributions in binary form must reproduce the above 7314 // copyright notice, this list of conditions and the following disclaimer 7315 // in the documentation and/or other materials provided with the 7316 // distribution. 7317 // * Neither the name of Google Inc. nor the name Chromium Embedded 7318 // Framework nor the names of its contributors may be used to endorse 7319 // or promote products derived from this software without specific prior 7320 // written permission. 7321 // 7322 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 7323 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 7324 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 7325 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 7326 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 7327 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 7328 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 7329 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 7330 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 7331 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 7332 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 7333 // 7334 // --------------------------------------------------------------------------- 7335 // 7336 // This file was generated by the CEF translator tool and should not edited 7337 // by hand. See the translator.README.txt file in the tools directory for 7338 // more information. 7339 // 7340 // $hash=ec05ae57537091e3543c4b31d72d2d84d44df876$ 7341 // 7342 7343 extern (C): 7344 7345 /// 7346 /// Implement this structure to handle events related to commands. The functions 7347 /// of this structure will be called on the UI thread. 7348 /// 7349 struct cef_command_handler_t 7350 { 7351 /// 7352 /// Base structure. 7353 /// 7354 cef_base_ref_counted_t base; 7355 7356 /// 7357 /// Called to execute a Chrome command triggered via menu selection or 7358 /// keyboard shortcut. Values for |command_id| can be found in the 7359 /// cef_command_ids.h file. |disposition| provides information about the 7360 /// intended command target. Return true (1) if the command was handled or 7361 /// false (0) for the default implementation. For context menu commands this 7362 /// will be called after cef_context_menu_handler_t::OnContextMenuCommand. 7363 /// Only used with the Chrome runtime. 7364 /// 7365 extern(System) int function ( 7366 cef_command_handler_t* self, 7367 cef_browser_t* browser, 7368 int command_id, 7369 cef_window_open_disposition_t disposition) nothrow on_chrome_command; 7370 } 7371 7372 7373 7374 // CEF_INCLUDE_CAPI_CEF_COMMAND_HANDLER_CAPI_H_ 7375 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 7376 // 7377 // Redistribution and use in source and binary forms, with or without 7378 // modification, are permitted provided that the following conditions are 7379 // met: 7380 // 7381 // * Redistributions of source code must retain the above copyright 7382 // notice, this list of conditions and the following disclaimer. 7383 // * Redistributions in binary form must reproduce the above 7384 // copyright notice, this list of conditions and the following disclaimer 7385 // in the documentation and/or other materials provided with the 7386 // distribution. 7387 // * Neither the name of Google Inc. nor the name Chromium Embedded 7388 // Framework nor the names of its contributors may be used to endorse 7389 // or promote products derived from this software without specific prior 7390 // written permission. 7391 // 7392 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 7393 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 7394 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 7395 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 7396 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 7397 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 7398 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 7399 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 7400 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 7401 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 7402 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 7403 // 7404 // --------------------------------------------------------------------------- 7405 // 7406 // This file was generated by the CEF translator tool and should not edited 7407 // by hand. See the translator.README.txt file in the tools directory for 7408 // more information. 7409 // 7410 // $hash=f535e9560b9fde9b53fc4d8383905105ed029ea4$ 7411 // 7412 7413 extern (C): 7414 7415 /// 7416 /// Structure used to create and/or parse command line arguments. Arguments with 7417 /// "--", "-" and, on Windows, "/" prefixes are considered switches. Switches 7418 /// will always precede any arguments without switch prefixes. Switches can 7419 /// optionally have a value specified using the "=" delimiter (e.g. 7420 /// "-switch=value"). An argument of "--" will terminate switch parsing with all 7421 /// subsequent tokens, regardless of prefix, being interpreted as non-switch 7422 /// arguments. Switch names should be lowercase ASCII and will be converted to 7423 /// such if necessary. Switch values will retain the original case and UTF8 7424 /// encoding. This structure can be used before cef_initialize() is called. 7425 /// 7426 struct cef_command_line_t 7427 { 7428 /// 7429 /// Base structure. 7430 /// 7431 cef_base_ref_counted_t base; 7432 7433 /// 7434 /// Returns true (1) if this object is valid. Do not call any other functions 7435 /// if this function returns false (0). 7436 /// 7437 extern(System) int function (cef_command_line_t* self) nothrow is_valid; 7438 7439 /// 7440 /// Returns true (1) if the values of this object are read-only. Some APIs may 7441 /// expose read-only objects. 7442 /// 7443 extern(System) int function (cef_command_line_t* self) nothrow is_read_only; 7444 7445 /// 7446 /// Returns a writable copy of this object. 7447 /// 7448 extern(System) cef_command_line_t* function (cef_command_line_t* self) nothrow copy; 7449 7450 /// 7451 /// Initialize the command line with the specified |argc| and |argv| values. 7452 /// The first argument must be the name of the program. This function is only 7453 /// supported on non-Windows platforms. 7454 /// 7455 extern(System) void function ( 7456 cef_command_line_t* self, 7457 int argc, 7458 const(char*)* argv) nothrow init_from_argv; 7459 7460 /// 7461 /// Initialize the command line with the string returned by calling 7462 /// GetCommandLineW(). This function is only supported on Windows. 7463 /// 7464 extern(System) void function ( 7465 cef_command_line_t* self, 7466 const(cef_string_t)* command_line) nothrow init_from_string; 7467 7468 /// 7469 /// Reset the command-line switches and arguments but leave the program 7470 /// component unchanged. 7471 /// 7472 extern(System) void function (cef_command_line_t* self) nothrow reset; 7473 7474 /// 7475 /// Retrieve the original command line string as a vector of strings. The argv 7476 /// array: `{ program, [(--|-|/)switch[=value]]*, [--], [argument]* }` 7477 /// 7478 extern(System) void function (cef_command_line_t* self, cef_string_list_t argv) nothrow get_argv; 7479 7480 /// 7481 /// Constructs and returns the represented command line string. Use this 7482 /// function cautiously because quoting behavior is unclear. 7483 /// 7484 // The resulting string must be freed by calling cef_string_userfree_free(). 7485 extern(System) cef_string_userfree_t function ( 7486 cef_command_line_t* self) nothrow get_command_line_string; 7487 7488 /// 7489 /// Get the program part of the command line string (the first item). 7490 /// 7491 // The resulting string must be freed by calling cef_string_userfree_free(). 7492 extern(System) cef_string_userfree_t function (cef_command_line_t* self) nothrow get_program; 7493 7494 /// 7495 /// Set the program part of the command line string (the first item). 7496 /// 7497 extern(System) void function ( 7498 cef_command_line_t* self, 7499 const(cef_string_t)* program) nothrow set_program; 7500 7501 /// 7502 /// Returns true (1) if the command line has switches. 7503 /// 7504 extern(System) int function (cef_command_line_t* self) nothrow has_switches; 7505 7506 /// 7507 /// Returns true (1) if the command line contains the given switch. 7508 /// 7509 extern(System) int function ( 7510 cef_command_line_t* self, 7511 const(cef_string_t)* name) nothrow has_switch; 7512 7513 /// 7514 /// Returns the value associated with the given switch. If the switch has no 7515 /// value or isn't present this function returns the NULL string. 7516 /// 7517 // The resulting string must be freed by calling cef_string_userfree_free(). 7518 extern(System) cef_string_userfree_t function ( 7519 cef_command_line_t* self, 7520 const(cef_string_t)* name) nothrow get_switch_value; 7521 7522 /// 7523 /// Returns the map of switch names and values. If a switch has no value an 7524 /// NULL string is returned. 7525 /// 7526 extern(System) void function ( 7527 cef_command_line_t* self, 7528 cef_string_map_t switches) nothrow get_switches; 7529 7530 /// 7531 /// Add a switch to the end of the command line. If the switch has no value 7532 /// pass an NULL value string. 7533 /// 7534 extern(System) void function ( 7535 cef_command_line_t* self, 7536 const(cef_string_t)* name) nothrow append_switch; 7537 7538 /// 7539 /// Add a switch with the specified value to the end of the command line. 7540 /// 7541 extern(System) void function ( 7542 cef_command_line_t* self, 7543 const(cef_string_t)* name, 7544 const(cef_string_t)* value) nothrow append_switch_with_value; 7545 7546 /// 7547 /// True if there are remaining command line arguments. 7548 /// 7549 extern(System) int function (cef_command_line_t* self) nothrow has_arguments; 7550 7551 /// 7552 /// Get the remaining command line arguments. 7553 /// 7554 extern(System) void function ( 7555 cef_command_line_t* self, 7556 cef_string_list_t arguments) nothrow get_arguments; 7557 7558 /// 7559 /// Add an argument to the end of the command line. 7560 /// 7561 extern(System) void function ( 7562 cef_command_line_t* self, 7563 const(cef_string_t)* argument) nothrow append_argument; 7564 7565 /// 7566 /// Insert a command before the current command. Common for debuggers, like 7567 /// "valgrind" or "gdb --args". 7568 /// 7569 extern(System) void function ( 7570 cef_command_line_t* self, 7571 const(cef_string_t)* wrapper) nothrow prepend_wrapper; 7572 } 7573 7574 7575 7576 /// 7577 /// Create a new cef_command_line_t instance. 7578 /// 7579 cef_command_line_t* cef_command_line_create (); 7580 7581 /// 7582 /// Returns the singleton global cef_command_line_t object. The returned object 7583 /// will be read-only. 7584 /// 7585 cef_command_line_t* cef_command_line_get_global (); 7586 7587 // CEF_INCLUDE_CAPI_CEF_COMMAND_LINE_CAPI_H_ 7588 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 7589 // 7590 // Redistribution and use in source and binary forms, with or without 7591 // modification, are permitted provided that the following conditions are 7592 // met: 7593 // 7594 // * Redistributions of source code must retain the above copyright 7595 // notice, this list of conditions and the following disclaimer. 7596 // * Redistributions in binary form must reproduce the above 7597 // copyright notice, this list of conditions and the following disclaimer 7598 // in the documentation and/or other materials provided with the 7599 // distribution. 7600 // * Neither the name of Google Inc. nor the name Chromium Embedded 7601 // Framework nor the names of its contributors may be used to endorse 7602 // or promote products derived from this software without specific prior 7603 // written permission. 7604 // 7605 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 7606 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 7607 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 7608 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 7609 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 7610 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 7611 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 7612 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 7613 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 7614 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 7615 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 7616 // 7617 // --------------------------------------------------------------------------- 7618 // 7619 // This file was generated by the CEF translator tool and should not edited 7620 // by hand. See the translator.README.txt file in the tools directory for 7621 // more information. 7622 // 7623 // $hash=0ae549ed35e30afcbb01961fe55455beaadcd7f9$ 7624 // 7625 7626 extern (C): 7627 7628 /// 7629 /// Callback structure used for continuation of custom context menu display. 7630 /// 7631 struct cef_run_context_menu_callback_t 7632 { 7633 /// 7634 /// Base structure. 7635 /// 7636 cef_base_ref_counted_t base; 7637 7638 /// 7639 /// Complete context menu display by selecting the specified |command_id| and 7640 /// |event_flags|. 7641 /// 7642 extern(System) void function ( 7643 cef_run_context_menu_callback_t* self, 7644 int command_id, 7645 cef_event_flags_t event_flags) nothrow cont; 7646 7647 /// 7648 /// Cancel context menu display. 7649 /// 7650 extern(System) void function (cef_run_context_menu_callback_t* self) nothrow cancel; 7651 } 7652 7653 7654 7655 /// 7656 /// Callback structure used for continuation of custom quick menu display. 7657 /// 7658 struct cef_run_quick_menu_callback_t 7659 { 7660 /// 7661 /// Base structure. 7662 /// 7663 cef_base_ref_counted_t base; 7664 7665 /// 7666 /// Complete quick menu display by selecting the specified |command_id| and 7667 /// |event_flags|. 7668 /// 7669 extern(System) void function ( 7670 cef_run_quick_menu_callback_t* self, 7671 int command_id, 7672 cef_event_flags_t event_flags) nothrow cont; 7673 7674 /// 7675 /// Cancel quick menu display. 7676 /// 7677 extern(System) void function (cef_run_quick_menu_callback_t* self) nothrow cancel; 7678 } 7679 7680 7681 7682 /// 7683 /// Implement this structure to handle context menu events. The functions of 7684 /// this structure will be called on the UI thread. 7685 /// 7686 struct cef_context_menu_handler_t 7687 { 7688 /// 7689 /// Base structure. 7690 /// 7691 cef_base_ref_counted_t base; 7692 7693 /// 7694 /// Called before a context menu is displayed. |params| provides information 7695 /// about the context menu state. |model| initially contains the default 7696 /// context menu. The |model| can be cleared to show no context menu or 7697 /// modified to show a custom menu. Do not keep references to |params| or 7698 /// |model| outside of this callback. 7699 /// 7700 extern(System) void function ( 7701 cef_context_menu_handler_t* self, 7702 cef_browser_t* browser, 7703 cef_frame_t* frame, 7704 cef_context_menu_params_t* params, 7705 cef_menu_model_t* model) nothrow on_before_context_menu; 7706 7707 /// 7708 /// Called to allow custom display of the context menu. |params| provides 7709 /// information about the context menu state. |model| contains the context 7710 /// menu model resulting from OnBeforeContextMenu. For custom display return 7711 /// true (1) and execute |callback| either synchronously or asynchronously 7712 /// with the selected command ID. For default display return false (0). Do not 7713 /// keep references to |params| or |model| outside of this callback. 7714 /// 7715 extern(System) int function ( 7716 cef_context_menu_handler_t* self, 7717 cef_browser_t* browser, 7718 cef_frame_t* frame, 7719 cef_context_menu_params_t* params, 7720 cef_menu_model_t* model, 7721 cef_run_context_menu_callback_t* callback) nothrow run_context_menu; 7722 7723 /// 7724 /// Called to execute a command selected from the context menu. Return true 7725 /// (1) if the command was handled or false (0) for the default 7726 /// implementation. See cef_menu_id_t for the command ids that have default 7727 /// implementations. All user-defined command ids should be between 7728 /// MENU_ID_USER_FIRST and MENU_ID_USER_LAST. |params| will have the same 7729 /// values as what was passed to on_before_context_menu(). Do not keep a 7730 /// reference to |params| outside of this callback. 7731 /// 7732 extern(System) int function ( 7733 cef_context_menu_handler_t* self, 7734 cef_browser_t* browser, 7735 cef_frame_t* frame, 7736 cef_context_menu_params_t* params, 7737 int command_id, 7738 cef_event_flags_t event_flags) nothrow on_context_menu_command; 7739 7740 /// 7741 /// Called when the context menu is dismissed irregardless of whether the menu 7742 /// was canceled or a command was selected. 7743 /// 7744 extern(System) void function ( 7745 cef_context_menu_handler_t* self, 7746 cef_browser_t* browser, 7747 cef_frame_t* frame) nothrow on_context_menu_dismissed; 7748 7749 /// 7750 /// Called to allow custom display of the quick menu for a windowless browser. 7751 /// |location| is the top left corner of the selected region. |size| is the 7752 /// size of the selected region. |edit_state_flags| is a combination of flags 7753 /// that represent the state of the quick menu. Return true (1) if the menu 7754 /// will be handled and execute |callback| either synchronously or 7755 /// asynchronously with the selected command ID. Return false (0) to cancel 7756 /// the menu. 7757 /// 7758 extern(System) int function ( 7759 cef_context_menu_handler_t* self, 7760 cef_browser_t* browser, 7761 cef_frame_t* frame, 7762 const(cef_point_t)* location, 7763 const(cef_size_t)* size, 7764 cef_quick_menu_edit_state_flags_t edit_state_flags, 7765 cef_run_quick_menu_callback_t* callback) nothrow run_quick_menu; 7766 7767 /// 7768 /// Called to execute a command selected from the quick menu for a windowless 7769 /// browser. Return true (1) if the command was handled or false (0) for the 7770 /// default implementation. See cef_menu_id_t for command IDs that have 7771 /// default implementations. 7772 /// 7773 extern(System) int function ( 7774 cef_context_menu_handler_t* self, 7775 cef_browser_t* browser, 7776 cef_frame_t* frame, 7777 int command_id, 7778 cef_event_flags_t event_flags) nothrow on_quick_menu_command; 7779 7780 /// 7781 /// Called when the quick menu for a windowless browser is dismissed 7782 /// irregardless of whether the menu was canceled or a command was selected. 7783 /// 7784 extern(System) void function ( 7785 cef_context_menu_handler_t* self, 7786 cef_browser_t* browser, 7787 cef_frame_t* frame) nothrow on_quick_menu_dismissed; 7788 } 7789 7790 7791 7792 /// 7793 /// Provides information about the context menu state. The functions of this 7794 /// structure can only be accessed on browser process the UI thread. 7795 /// 7796 struct cef_context_menu_params_t 7797 { 7798 /// 7799 /// Base structure. 7800 /// 7801 cef_base_ref_counted_t base; 7802 7803 /// 7804 /// Returns the X coordinate of the mouse where the context menu was invoked. 7805 /// Coords are relative to the associated RenderView's origin. 7806 /// 7807 extern(System) int function (cef_context_menu_params_t* self) nothrow get_xcoord; 7808 7809 /// 7810 /// Returns the Y coordinate of the mouse where the context menu was invoked. 7811 /// Coords are relative to the associated RenderView's origin. 7812 /// 7813 extern(System) int function (cef_context_menu_params_t* self) nothrow get_ycoord; 7814 7815 /// 7816 /// Returns flags representing the type of node that the context menu was 7817 /// invoked on. 7818 /// 7819 extern(System) cef_context_menu_type_flags_t function ( 7820 cef_context_menu_params_t* self) nothrow get_type_flags; 7821 7822 /// 7823 /// Returns the URL of the link, if any, that encloses the node that the 7824 /// context menu was invoked on. 7825 /// 7826 // The resulting string must be freed by calling cef_string_userfree_free(). 7827 extern(System) cef_string_userfree_t function ( 7828 cef_context_menu_params_t* self) nothrow get_link_url; 7829 7830 /// 7831 /// Returns the link URL, if any, to be used ONLY for "copy link address". We 7832 /// don't validate this field in the frontend process. 7833 /// 7834 // The resulting string must be freed by calling cef_string_userfree_free(). 7835 extern(System) cef_string_userfree_t function ( 7836 cef_context_menu_params_t* self) nothrow get_unfiltered_link_url; 7837 7838 /// 7839 /// Returns the source URL, if any, for the element that the context menu was 7840 /// invoked on. Example of elements with source URLs are img, audio, and 7841 /// video. 7842 /// 7843 // The resulting string must be freed by calling cef_string_userfree_free(). 7844 extern(System) cef_string_userfree_t function ( 7845 cef_context_menu_params_t* self) nothrow get_source_url; 7846 7847 /// 7848 /// Returns true (1) if the context menu was invoked on an image which has 7849 /// non-NULL contents. 7850 /// 7851 extern(System) int function (cef_context_menu_params_t* self) nothrow has_image_contents; 7852 7853 /// 7854 /// Returns the title text or the alt text if the context menu was invoked on 7855 /// an image. 7856 /// 7857 // The resulting string must be freed by calling cef_string_userfree_free(). 7858 extern(System) cef_string_userfree_t function ( 7859 cef_context_menu_params_t* self) nothrow get_title_text; 7860 7861 /// 7862 /// Returns the URL of the top level page that the context menu was invoked 7863 /// on. 7864 /// 7865 // The resulting string must be freed by calling cef_string_userfree_free(). 7866 extern(System) cef_string_userfree_t function ( 7867 cef_context_menu_params_t* self) nothrow get_page_url; 7868 7869 /// 7870 /// Returns the URL of the subframe that the context menu was invoked on. 7871 /// 7872 // The resulting string must be freed by calling cef_string_userfree_free(). 7873 extern(System) cef_string_userfree_t function ( 7874 cef_context_menu_params_t* self) nothrow get_frame_url; 7875 7876 /// 7877 /// Returns the character encoding of the subframe that the context menu was 7878 /// invoked on. 7879 /// 7880 // The resulting string must be freed by calling cef_string_userfree_free(). 7881 extern(System) cef_string_userfree_t function ( 7882 cef_context_menu_params_t* self) nothrow get_frame_charset; 7883 7884 /// 7885 /// Returns the type of context node that the context menu was invoked on. 7886 /// 7887 extern(System) cef_context_menu_media_type_t function ( 7888 cef_context_menu_params_t* self) nothrow get_media_type; 7889 7890 /// 7891 /// Returns flags representing the actions supported by the media element, if 7892 /// any, that the context menu was invoked on. 7893 /// 7894 extern(System) cef_context_menu_media_state_flags_t function ( 7895 cef_context_menu_params_t* self) nothrow get_media_state_flags; 7896 7897 /// 7898 /// Returns the text of the selection, if any, that the context menu was 7899 /// invoked on. 7900 /// 7901 // The resulting string must be freed by calling cef_string_userfree_free(). 7902 extern(System) cef_string_userfree_t function ( 7903 cef_context_menu_params_t* self) nothrow get_selection_text; 7904 7905 /// 7906 /// Returns the text of the misspelled word, if any, that the context menu was 7907 /// invoked on. 7908 /// 7909 // The resulting string must be freed by calling cef_string_userfree_free(). 7910 extern(System) cef_string_userfree_t function ( 7911 cef_context_menu_params_t* self) nothrow get_misspelled_word; 7912 7913 /// 7914 /// Returns true (1) if suggestions exist, false (0) otherwise. Fills in 7915 /// |suggestions| from the spell check service for the misspelled word if 7916 /// there is one. 7917 /// 7918 extern(System) int function ( 7919 cef_context_menu_params_t* self, 7920 cef_string_list_t suggestions) nothrow get_dictionary_suggestions; 7921 7922 /// 7923 /// Returns true (1) if the context menu was invoked on an editable node. 7924 /// 7925 extern(System) int function (cef_context_menu_params_t* self) nothrow is_editable; 7926 7927 /// 7928 /// Returns true (1) if the context menu was invoked on an editable node where 7929 /// spell-check is enabled. 7930 /// 7931 extern(System) int function (cef_context_menu_params_t* self) nothrow is_spell_check_enabled; 7932 7933 /// 7934 /// Returns flags representing the actions supported by the editable node, if 7935 /// any, that the context menu was invoked on. 7936 /// 7937 extern(System) cef_context_menu_edit_state_flags_t function ( 7938 cef_context_menu_params_t* self) nothrow get_edit_state_flags; 7939 7940 /// 7941 /// Returns true (1) if the context menu contains items specified by the 7942 /// renderer process. 7943 /// 7944 extern(System) int function (cef_context_menu_params_t* self) nothrow is_custom_menu; 7945 } 7946 7947 7948 7949 // CEF_INCLUDE_CAPI_CEF_CONTEXT_MENU_HANDLER_CAPI_H_ 7950 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 7951 // 7952 // Redistribution and use in source and binary forms, with or without 7953 // modification, are permitted provided that the following conditions are 7954 // met: 7955 // 7956 // * Redistributions of source code must retain the above copyright 7957 // notice, this list of conditions and the following disclaimer. 7958 // * Redistributions in binary form must reproduce the above 7959 // copyright notice, this list of conditions and the following disclaimer 7960 // in the documentation and/or other materials provided with the 7961 // distribution. 7962 // * Neither the name of Google Inc. nor the name Chromium Embedded 7963 // Framework nor the names of its contributors may be used to endorse 7964 // or promote products derived from this software without specific prior 7965 // written permission. 7966 // 7967 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 7968 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 7969 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 7970 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 7971 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 7972 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 7973 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 7974 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 7975 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 7976 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 7977 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 7978 // 7979 // --------------------------------------------------------------------------- 7980 // 7981 // This file was generated by the CEF translator tool and should not edited 7982 // by hand. See the translator.README.txt file in the tools directory for 7983 // more information. 7984 // 7985 // $hash=37b5e115ff7abd1df1b9913404b69505fb9fef29$ 7986 // 7987 7988 extern (C): 7989 7990 /// 7991 /// Structure used for managing cookies. The functions of this structure may be 7992 /// called on any thread unless otherwise indicated. 7993 /// 7994 struct cef_cookie_manager_t 7995 { 7996 /// 7997 /// Base structure. 7998 /// 7999 cef_base_ref_counted_t base; 8000 8001 /// 8002 /// Visit all cookies on the UI thread. The returned cookies are ordered by 8003 /// longest path, then by earliest creation date. Returns false (0) if cookies 8004 /// cannot be accessed. 8005 /// 8006 extern(System) int function ( 8007 cef_cookie_manager_t* self, 8008 cef_cookie_visitor_t* visitor) nothrow visit_all_cookies; 8009 8010 /// 8011 /// Visit a subset of cookies on the UI thread. The results are filtered by 8012 /// the given url scheme, host, domain and path. If |includeHttpOnly| is true 8013 /// (1) HTTP-only cookies will also be included in the results. The returned 8014 /// cookies are ordered by longest path, then by earliest creation date. 8015 /// Returns false (0) if cookies cannot be accessed. 8016 /// 8017 extern(System) int function ( 8018 cef_cookie_manager_t* self, 8019 const(cef_string_t)* url, 8020 int includeHttpOnly, 8021 cef_cookie_visitor_t* visitor) nothrow visit_url_cookies; 8022 8023 /// 8024 /// Sets a cookie given a valid URL and explicit user-provided cookie 8025 /// attributes. This function expects each attribute to be well-formed. It 8026 /// will check for disallowed characters (e.g. the ';' character is disallowed 8027 /// within the cookie value attribute) and fail without setting the cookie if 8028 /// such characters are found. If |callback| is non-NULL it will be executed 8029 /// asnychronously on the UI thread after the cookie has been set. Returns 8030 /// false (0) if an invalid URL is specified or if cookies cannot be accessed. 8031 /// 8032 extern(System) int function ( 8033 cef_cookie_manager_t* self, 8034 const(cef_string_t)* url, 8035 const(cef_cookie_t)* cookie, 8036 cef_set_cookie_callback_t* callback) nothrow set_cookie; 8037 8038 /// 8039 /// Delete all cookies that match the specified parameters. If both |url| and 8040 /// |cookie_name| values are specified all host and domain cookies matching 8041 /// both will be deleted. If only |url| is specified all host cookies (but not 8042 /// domain cookies) irrespective of path will be deleted. If |url| is NULL all 8043 /// cookies for all hosts and domains will be deleted. If |callback| is non- 8044 /// NULL it will be executed asnychronously on the UI thread after the cookies 8045 /// have been deleted. Returns false (0) if a non-NULL invalid URL is 8046 /// specified or if cookies cannot be accessed. Cookies can alternately be 8047 /// deleted using the Visit*Cookies() functions. 8048 /// 8049 extern(System) int function ( 8050 cef_cookie_manager_t* self, 8051 const(cef_string_t)* url, 8052 const(cef_string_t)* cookie_name, 8053 cef_delete_cookies_callback_t* callback) nothrow delete_cookies; 8054 8055 /// 8056 /// Flush the backing store (if any) to disk. If |callback| is non-NULL it 8057 /// will be executed asnychronously on the UI thread after the flush is 8058 /// complete. Returns false (0) if cookies cannot be accessed. 8059 /// 8060 extern(System) int function ( 8061 cef_cookie_manager_t* self, 8062 cef_completion_callback_t* callback) nothrow flush_store; 8063 } 8064 8065 8066 8067 /// 8068 /// Returns the global cookie manager. By default data will be stored at 8069 /// cef_settings_t.cache_path if specified or in memory otherwise. If |callback| 8070 /// is non-NULL it will be executed asnychronously on the UI thread after the 8071 /// manager's storage has been initialized. Using this function is equivalent to 8072 /// calling cef_request_context_t::cef_request_context_get_global_context()->Get 8073 /// DefaultCookieManager(). 8074 /// 8075 cef_cookie_manager_t* cef_cookie_manager_get_global_manager ( 8076 cef_completion_callback_t* callback); 8077 8078 /// 8079 /// Structure to implement for visiting cookie values. The functions of this 8080 /// structure will always be called on the UI thread. 8081 /// 8082 struct cef_cookie_visitor_t 8083 { 8084 /// 8085 /// Base structure. 8086 /// 8087 cef_base_ref_counted_t base; 8088 8089 /// 8090 /// Method that will be called once for each cookie. |count| is the 0-based 8091 /// index for the current cookie. |total| is the total number of cookies. Set 8092 /// |deleteCookie| to true (1) to delete the cookie currently being visited. 8093 /// Return false (0) to stop visiting cookies. This function may never be 8094 /// called if no cookies are found. 8095 /// 8096 extern(System) int function ( 8097 cef_cookie_visitor_t* self, 8098 const(cef_cookie_t)* cookie, 8099 int count, 8100 int total, 8101 int* deleteCookie) nothrow visit; 8102 } 8103 8104 8105 8106 /// 8107 /// Structure to implement to be notified of asynchronous completion via 8108 /// cef_cookie_manager_t::set_cookie(). 8109 /// 8110 struct cef_set_cookie_callback_t 8111 { 8112 /// 8113 /// Base structure. 8114 /// 8115 cef_base_ref_counted_t base; 8116 8117 /// 8118 /// Method that will be called upon completion. |success| will be true (1) if 8119 /// the cookie was set successfully. 8120 /// 8121 extern(System) void function (cef_set_cookie_callback_t* self, int success) nothrow on_complete; 8122 } 8123 8124 8125 8126 /// 8127 /// Structure to implement to be notified of asynchronous completion via 8128 /// cef_cookie_manager_t::delete_cookies(). 8129 /// 8130 struct cef_delete_cookies_callback_t 8131 { 8132 /// 8133 /// Base structure. 8134 /// 8135 cef_base_ref_counted_t base; 8136 8137 /// 8138 /// Method that will be called upon completion. |num_deleted| will be the 8139 /// number of cookies that were deleted. 8140 /// 8141 extern(System) void function ( 8142 cef_delete_cookies_callback_t* self, 8143 int num_deleted) nothrow on_complete; 8144 } 8145 8146 8147 8148 // CEF_INCLUDE_CAPI_CEF_COOKIE_CAPI_H_ 8149 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 8150 // 8151 // Redistribution and use in source and binary forms, with or without 8152 // modification, are permitted provided that the following conditions are 8153 // met: 8154 // 8155 // * Redistributions of source code must retain the above copyright 8156 // notice, this list of conditions and the following disclaimer. 8157 // * Redistributions in binary form must reproduce the above 8158 // copyright notice, this list of conditions and the following disclaimer 8159 // in the documentation and/or other materials provided with the 8160 // distribution. 8161 // * Neither the name of Google Inc. nor the name Chromium Embedded 8162 // Framework nor the names of its contributors may be used to endorse 8163 // or promote products derived from this software without specific prior 8164 // written permission. 8165 // 8166 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 8167 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 8168 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 8169 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 8170 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 8171 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 8172 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 8173 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 8174 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 8175 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 8176 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 8177 // 8178 // --------------------------------------------------------------------------- 8179 // 8180 // This file was generated by the CEF translator tool and should not edited 8181 // by hand. See the translator.README.txt file in the tools directory for 8182 // more information. 8183 // 8184 // $hash=1ce19c3213f033ca9059da738102b9b4292d4a06$ 8185 // 8186 8187 extern (C): 8188 8189 /// 8190 /// Crash reporting is configured using an INI-style config file named 8191 /// "crash_reporter.cfg". On Windows and Linux this file must be placed next to 8192 /// the main application executable. On macOS this file must be placed in the 8193 /// top-level app bundle Resources directory (e.g. 8194 /// "<appname>.app/Contents/Resources"). File contents are as follows: 8195 /// 8196 /// <pre> 8197 /// # Comments start with a hash character and must be on their own line. 8198 /// 8199 /// [Config] 8200 /// ProductName=<Value of the "prod" crash key; defaults to "cef"> 8201 /// ProductVersion=<Value of the "ver" crash key; defaults to the CEF version> 8202 /// AppName=<Windows only; App-specific folder name component for storing crash 8203 /// information; default to "CEF"> 8204 /// ExternalHandler=<Windows only; Name of the external handler exe to use 8205 /// instead of re-launching the main exe; default to empty> 8206 /// BrowserCrashForwardingEnabled=<macOS only; True if browser process crashes 8207 /// should be forwarded to the system crash 8208 /// reporter; default to false> 8209 /// ServerURL=<crash server URL; default to empty> 8210 /// RateLimitEnabled=<True if uploads should be rate limited; default to true> 8211 /// MaxUploadsPerDay=<Max uploads per 24 hours, used if rate limit is enabled; 8212 /// default to 5> 8213 /// MaxDatabaseSizeInMb=<Total crash report disk usage greater than this value 8214 /// will cause older reports to be deleted; default to 20> 8215 /// MaxDatabaseAgeInDays=<Crash reports older than this value will be deleted; 8216 /// default to 5> 8217 /// 8218 /// [CrashKeys] 8219 /// my_key1=<small|medium|large> 8220 /// my_key2=<small|medium|large> 8221 /// </pre> 8222 /// 8223 /// <b>Config section:</b> 8224 /// 8225 /// If "ProductName" and/or "ProductVersion" are set then the specified values 8226 /// will be included in the crash dump metadata. On macOS if these values are 8227 /// set to NULL then they will be retrieved from the Info.plist file using the 8228 /// "CFBundleName" and "CFBundleShortVersionString" keys respectively. 8229 /// 8230 /// If "AppName" is set on Windows then crash report information (metrics, 8231 /// database and dumps) will be stored locally on disk under the 8232 /// "C:\Users\[CurrentUser]\AppData\Local\[AppName]\User Data" folder. On other 8233 /// platforms the cef_settings_t.user_data_path value will be used. 8234 /// 8235 /// If "ExternalHandler" is set on Windows then the specified exe will be 8236 /// launched as the crashpad-handler instead of re-launching the main process 8237 /// exe. The value can be an absolute path or a path relative to the main exe 8238 /// directory. On Linux the cef_settings_t.browser_subprocess_path value will be 8239 /// used. On macOS the existing subprocess app bundle will be used. 8240 /// 8241 /// If "BrowserCrashForwardingEnabled" is set to true (1) on macOS then browser 8242 /// process crashes will be forwarded to the system crash reporter. This results 8243 /// in the crash UI dialog being displayed to the user and crash reports being 8244 /// logged under "~/Library/Logs/DiagnosticReports". Forwarding of crash reports 8245 /// from non-browser processes and Debug builds is always disabled. 8246 /// 8247 /// If "ServerURL" is set then crashes will be uploaded as a multi-part POST 8248 /// request to the specified URL. Otherwise, reports will only be stored locally 8249 /// on disk. 8250 /// 8251 /// If "RateLimitEnabled" is set to true (1) then crash report uploads will be 8252 /// rate limited as follows: 8253 /// 1. If "MaxUploadsPerDay" is set to a positive value then at most the 8254 /// specified number of crashes will be uploaded in each 24 hour period. 8255 /// 2. If crash upload fails due to a network or server error then an 8256 /// incremental backoff delay up to a maximum of 24 hours will be applied 8257 /// for retries. 8258 /// 3. If a backoff delay is applied and "MaxUploadsPerDay" is > 1 then the 8259 /// "MaxUploadsPerDay" value will be reduced to 1 until the client is 8260 /// restarted. This helps to avoid an upload flood when the network or 8261 /// server error is resolved. 8262 /// Rate limiting is not supported on Linux. 8263 /// 8264 /// If "MaxDatabaseSizeInMb" is set to a positive value then crash report 8265 /// storage on disk will be limited to that size in megabytes. For example, on 8266 /// Windows each dump is about 600KB so a "MaxDatabaseSizeInMb" value of 20 8267 /// equates to about 34 crash reports stored on disk. Not supported on Linux. 8268 /// 8269 /// If "MaxDatabaseAgeInDays" is set to a positive value then crash reports 8270 /// older than the specified age in days will be deleted. Not supported on 8271 /// Linux. 8272 /// 8273 /// <b>CrashKeys section:</b> 8274 /// 8275 /// A maximum of 26 crash keys of each size can be specified for use by the 8276 /// application. Crash key values will be truncated based on the specified size 8277 /// (small = 64 bytes, medium = 256 bytes, large = 1024 bytes). The value of 8278 /// crash keys can be set from any thread or process using the 8279 /// CefSetCrashKeyValue function. These key/value pairs will be sent to the 8280 /// crash server along with the crash dump file. 8281 /// 8282 int cef_crash_reporting_enabled (); 8283 8284 /// 8285 /// Sets or clears a specific key-value pair from the crash metadata. 8286 /// 8287 void cef_set_crash_key_value ( 8288 const(cef_string_t)* key, 8289 const(cef_string_t)* value); 8290 8291 // CEF_INCLUDE_CAPI_CEF_CRASH_UTIL_CAPI_H_ 8292 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 8293 // 8294 // Redistribution and use in source and binary forms, with or without 8295 // modification, are permitted provided that the following conditions are 8296 // met: 8297 // 8298 // * Redistributions of source code must retain the above copyright 8299 // notice, this list of conditions and the following disclaimer. 8300 // * Redistributions in binary form must reproduce the above 8301 // copyright notice, this list of conditions and the following disclaimer 8302 // in the documentation and/or other materials provided with the 8303 // distribution. 8304 // * Neither the name of Google Inc. nor the name Chromium Embedded 8305 // Framework nor the names of its contributors may be used to endorse 8306 // or promote products derived from this software without specific prior 8307 // written permission. 8308 // 8309 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 8310 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 8311 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 8312 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 8313 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 8314 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 8315 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 8316 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 8317 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 8318 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 8319 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 8320 // 8321 // --------------------------------------------------------------------------- 8322 // 8323 // This file was generated by the CEF translator tool and should not edited 8324 // by hand. See the translator.README.txt file in the tools directory for 8325 // more information. 8326 // 8327 // $hash=076a01db2fc4241efeb46c5f247a9737fd828f9b$ 8328 // 8329 8330 extern (C): 8331 8332 8333 8334 /// 8335 /// Callback structure for cef_browser_host_t::AddDevToolsMessageObserver. The 8336 /// functions of this structure will be called on the browser process UI thread. 8337 /// 8338 struct cef_dev_tools_message_observer_t 8339 { 8340 /// 8341 /// Base structure. 8342 /// 8343 cef_base_ref_counted_t base; 8344 8345 /// 8346 /// Method that will be called on receipt of a DevTools protocol message. 8347 /// |browser| is the originating browser instance. |message| is a UTF8-encoded 8348 /// JSON dictionary representing either a function result or an event. 8349 /// |message| is only valid for the scope of this callback and should be 8350 /// copied if necessary. Return true (1) if the message was handled or false 8351 /// (0) if the message should be further processed and passed to the 8352 /// OnDevToolsMethodResult or OnDevToolsEvent functions as appropriate. 8353 /// 8354 /// Method result dictionaries include an "id" (int) value that identifies the 8355 /// orginating function call sent from 8356 /// cef_browser_host_t::SendDevToolsMessage, and optionally either a "result" 8357 /// (dictionary) or "error" (dictionary) value. The "error" dictionary will 8358 /// contain "code" (int) and "message" (string) values. Event dictionaries 8359 /// include a "function" (string) value and optionally a "params" (dictionary) 8360 /// value. See the DevTools protocol documentation at 8361 /// https://chromedevtools.github.io/devtools-protocol/ for details of 8362 /// supported function calls and the expected "result" or "params" dictionary 8363 /// contents. JSON dictionaries can be parsed using the CefParseJSON function 8364 /// if desired, however be aware of performance considerations when parsing 8365 /// large messages (some of which may exceed 1MB in size). 8366 /// 8367 extern(System) int function ( 8368 cef_dev_tools_message_observer_t* self, 8369 cef_browser_t* browser, 8370 const(void)* message, 8371 size_t message_size) nothrow on_dev_tools_message; 8372 8373 /// 8374 /// Method that will be called after attempted execution of a DevTools 8375 /// protocol function. |browser| is the originating browser instance. 8376 /// |message_id| is the "id" value that identifies the originating function 8377 /// call message. If the function succeeded |success| will be true (1) and 8378 /// |result| will be the UTF8-encoded JSON "result" dictionary value (which 8379 /// may be NULL). If the function failed |success| will be false (0) and 8380 /// |result| will be the UTF8-encoded JSON "error" dictionary value. |result| 8381 /// is only valid for the scope of this callback and should be copied if 8382 /// necessary. See the OnDevToolsMessage documentation for additional details 8383 /// on |result| contents. 8384 /// 8385 extern(System) void function ( 8386 cef_dev_tools_message_observer_t* self, 8387 cef_browser_t* browser, 8388 int message_id, 8389 int success, 8390 const(void)* result, 8391 size_t result_size) nothrow on_dev_tools_method_result; 8392 8393 /// 8394 /// Method that will be called on receipt of a DevTools protocol event. 8395 /// |browser| is the originating browser instance. |function| is the 8396 /// "function" value. |params| is the UTF8-encoded JSON "params" dictionary 8397 /// value (which may be NULL). |params| is only valid for the scope of this 8398 /// callback and should be copied if necessary. See the OnDevToolsMessage 8399 /// documentation for additional details on |params| contents. 8400 /// 8401 extern(System) void function ( 8402 cef_dev_tools_message_observer_t* self, 8403 cef_browser_t* browser, 8404 const(cef_string_t)* method, 8405 const(void)* params, 8406 size_t params_size) nothrow on_dev_tools_event; 8407 8408 /// 8409 /// Method that will be called when the DevTools agent has attached. |browser| 8410 /// is the originating browser instance. This will generally occur in response 8411 /// to the first message sent while the agent is detached. 8412 /// 8413 extern(System) void function ( 8414 cef_dev_tools_message_observer_t* self, 8415 cef_browser_t* browser) nothrow on_dev_tools_agent_attached; 8416 8417 /// 8418 /// Method that will be called when the DevTools agent has detached. |browser| 8419 /// is the originating browser instance. Any function results that were 8420 /// pending before the agent became detached will not be delivered, and any 8421 /// active event subscriptions will be canceled. 8422 /// 8423 extern(System) void function ( 8424 cef_dev_tools_message_observer_t* self, 8425 cef_browser_t* browser) nothrow on_dev_tools_agent_detached; 8426 } 8427 8428 8429 8430 // CEF_INCLUDE_CAPI_CEF_DEVTOOLS_MESSAGE_OBSERVER_CAPI_H_ 8431 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 8432 // 8433 // Redistribution and use in source and binary forms, with or without 8434 // modification, are permitted provided that the following conditions are 8435 // met: 8436 // 8437 // * Redistributions of source code must retain the above copyright 8438 // notice, this list of conditions and the following disclaimer. 8439 // * Redistributions in binary form must reproduce the above 8440 // copyright notice, this list of conditions and the following disclaimer 8441 // in the documentation and/or other materials provided with the 8442 // distribution. 8443 // * Neither the name of Google Inc. nor the name Chromium Embedded 8444 // Framework nor the names of its contributors may be used to endorse 8445 // or promote products derived from this software without specific prior 8446 // written permission. 8447 // 8448 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 8449 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 8450 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 8451 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 8452 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 8453 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 8454 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 8455 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 8456 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 8457 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 8458 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 8459 // 8460 // --------------------------------------------------------------------------- 8461 // 8462 // This file was generated by the CEF translator tool and should not edited 8463 // by hand. See the translator.README.txt file in the tools directory for 8464 // more information. 8465 // 8466 // $hash=3a1a3ac84690c6090d356ddec3ddb49b934fe28c$ 8467 // 8468 8469 extern (C): 8470 8471 /// 8472 /// Callback structure for asynchronous continuation of file dialog requests. 8473 /// 8474 struct cef_file_dialog_callback_t 8475 { 8476 /// 8477 /// Base structure. 8478 /// 8479 cef_base_ref_counted_t base; 8480 8481 /// 8482 /// Continue the file selection. |file_paths| should be a single value or a 8483 /// list of values depending on the dialog mode. An NULL |file_paths| value is 8484 /// treated the same as calling cancel(). 8485 /// 8486 extern(System) void function ( 8487 cef_file_dialog_callback_t* self, 8488 cef_string_list_t file_paths) nothrow cont; 8489 8490 /// 8491 /// Cancel the file selection. 8492 /// 8493 extern(System) void function (cef_file_dialog_callback_t* self) nothrow cancel; 8494 } 8495 8496 8497 8498 /// 8499 /// Implement this structure to handle dialog events. The functions of this 8500 /// structure will be called on the browser process UI thread. 8501 /// 8502 struct cef_dialog_handler_t 8503 { 8504 /// 8505 /// Base structure. 8506 /// 8507 cef_base_ref_counted_t base; 8508 8509 /// 8510 /// Called to run a file chooser dialog. |mode| represents the type of dialog 8511 /// to display. |title| to the title to be used for the dialog and may be NULL 8512 /// to show the default title ("Open" or "Save" depending on the mode). 8513 /// |default_file_path| is the path with optional directory and/or file name 8514 /// component that should be initially selected in the dialog. 8515 /// |accept_filters| are used to restrict the selectable file types and may 8516 /// any combination of (a) valid lower-cased MIME types (e.g. "text/*" or 8517 /// "image/*"), (b) individual file extensions (e.g. ".txt" or ".png"), or (c) 8518 /// combined description and file extension delimited using "|" and ";" (e.g. 8519 /// "Image Types|.png;.gif;.jpg"). To display a custom dialog return true (1) 8520 /// and execute |callback| either inline or at a later time. To display the 8521 /// default dialog return false (0). 8522 /// 8523 extern(System) int function ( 8524 cef_dialog_handler_t* self, 8525 cef_browser_t* browser, 8526 cef_file_dialog_mode_t mode, 8527 const(cef_string_t)* title, 8528 const(cef_string_t)* default_file_path, 8529 cef_string_list_t accept_filters, 8530 cef_file_dialog_callback_t* callback) nothrow on_file_dialog; 8531 } 8532 8533 8534 8535 // CEF_INCLUDE_CAPI_CEF_DIALOG_HANDLER_CAPI_H_ 8536 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 8537 // 8538 // Redistribution and use in source and binary forms, with or without 8539 // modification, are permitted provided that the following conditions are 8540 // met: 8541 // 8542 // * Redistributions of source code must retain the above copyright 8543 // notice, this list of conditions and the following disclaimer. 8544 // * Redistributions in binary form must reproduce the above 8545 // copyright notice, this list of conditions and the following disclaimer 8546 // in the documentation and/or other materials provided with the 8547 // distribution. 8548 // * Neither the name of Google Inc. nor the name Chromium Embedded 8549 // Framework nor the names of its contributors may be used to endorse 8550 // or promote products derived from this software without specific prior 8551 // written permission. 8552 // 8553 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 8554 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 8555 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 8556 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 8557 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 8558 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 8559 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 8560 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 8561 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 8562 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 8563 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 8564 // 8565 // --------------------------------------------------------------------------- 8566 // 8567 // This file was generated by the CEF translator tool and should not edited 8568 // by hand. See the translator.README.txt file in the tools directory for 8569 // more information. 8570 // 8571 // $hash=976a61df924efbcb0c53afeb75265e5e9e80c2de$ 8572 // 8573 8574 import core.stdc.config; 8575 8576 extern (C): 8577 8578 /// 8579 /// Implement this structure to handle events related to browser display state. 8580 /// The functions of this structure will be called on the UI thread. 8581 /// 8582 struct cef_display_handler_t 8583 { 8584 /// 8585 /// Base structure. 8586 /// 8587 cef_base_ref_counted_t base; 8588 8589 /// 8590 /// Called when a frame's address has changed. 8591 /// 8592 extern(System) void function ( 8593 cef_display_handler_t* self, 8594 cef_browser_t* browser, 8595 cef_frame_t* frame, 8596 const(cef_string_t)* url) nothrow on_address_change; 8597 8598 /// 8599 /// Called when the page title changes. 8600 /// 8601 extern(System) void function ( 8602 cef_display_handler_t* self, 8603 cef_browser_t* browser, 8604 const(cef_string_t)* title) nothrow on_title_change; 8605 8606 /// 8607 /// Called when the page icon changes. 8608 /// 8609 extern(System) void function ( 8610 cef_display_handler_t* self, 8611 cef_browser_t* browser, 8612 cef_string_list_t icon_urls) nothrow on_favicon_urlchange; 8613 8614 /// 8615 /// Called when web content in the page has toggled fullscreen mode. If 8616 /// |fullscreen| is true (1) the content will automatically be sized to fill 8617 /// the browser content area. If |fullscreen| is false (0) the content will 8618 /// automatically return to its original size and position. The client is 8619 /// responsible for resizing the browser if desired. 8620 /// 8621 extern(System) void function ( 8622 cef_display_handler_t* self, 8623 cef_browser_t* browser, 8624 int fullscreen) nothrow on_fullscreen_mode_change; 8625 8626 /// 8627 /// Called when the browser is about to display a tooltip. |text| contains the 8628 /// text that will be displayed in the tooltip. To handle the display of the 8629 /// tooltip yourself return true (1). Otherwise, you can optionally modify 8630 /// |text| and then return false (0) to allow the browser to display the 8631 /// tooltip. When window rendering is disabled the application is responsible 8632 /// for drawing tooltips and the return value is ignored. 8633 /// 8634 extern(System) int function ( 8635 cef_display_handler_t* self, 8636 cef_browser_t* browser, 8637 cef_string_t* text) nothrow on_tooltip; 8638 8639 /// 8640 /// Called when the browser receives a status message. |value| contains the 8641 /// text that will be displayed in the status message. 8642 /// 8643 extern(System) void function ( 8644 cef_display_handler_t* self, 8645 cef_browser_t* browser, 8646 const(cef_string_t)* value) nothrow on_status_message; 8647 8648 /// 8649 /// Called to display a console message. Return true (1) to stop the message 8650 /// from being output to the console. 8651 /// 8652 extern(System) int function ( 8653 cef_display_handler_t* self, 8654 cef_browser_t* browser, 8655 cef_log_severity_t level, 8656 const(cef_string_t)* message, 8657 const(cef_string_t)* source, 8658 int line) nothrow on_console_message; 8659 8660 /// 8661 /// Called when auto-resize is enabled via 8662 /// cef_browser_host_t::SetAutoResizeEnabled and the contents have auto- 8663 /// resized. |new_size| will be the desired size in view coordinates. Return 8664 /// true (1) if the resize was handled or false (0) for default handling. 8665 /// 8666 extern(System) int function ( 8667 cef_display_handler_t* self, 8668 cef_browser_t* browser, 8669 const(cef_size_t)* new_size) nothrow on_auto_resize; 8670 8671 /// 8672 /// Called when the overall page loading progress has changed. |progress| 8673 /// ranges from 0.0 to 1.0. 8674 /// 8675 extern(System) void function ( 8676 cef_display_handler_t* self, 8677 cef_browser_t* browser, 8678 double progress) nothrow on_loading_progress_change; 8679 8680 /// 8681 /// Called when the browser's cursor has changed. If |type| is CT_CUSTOM then 8682 /// |custom_cursor_info| will be populated with the custom cursor information. 8683 /// Return true (1) if the cursor change was handled or false (0) for default 8684 /// handling. 8685 /// 8686 extern(System) int function ( 8687 cef_display_handler_t* self, 8688 cef_browser_t* browser, 8689 c_ulong cursor, 8690 cef_cursor_type_t type, 8691 const(cef_cursor_info_t)* custom_cursor_info) nothrow on_cursor_change; 8692 8693 /// 8694 /// Called when the browser's access to an audio and/or video source has 8695 /// changed. 8696 /// 8697 extern(System) void function ( 8698 cef_display_handler_t* self, 8699 cef_browser_t* browser, 8700 int has_video_access, 8701 int has_audio_access) nothrow on_media_access_change; 8702 } 8703 8704 8705 8706 // CEF_INCLUDE_CAPI_CEF_DISPLAY_HANDLER_CAPI_H_ 8707 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 8708 // 8709 // Redistribution and use in source and binary forms, with or without 8710 // modification, are permitted provided that the following conditions are 8711 // met: 8712 // 8713 // * Redistributions of source code must retain the above copyright 8714 // notice, this list of conditions and the following disclaimer. 8715 // * Redistributions in binary form must reproduce the above 8716 // copyright notice, this list of conditions and the following disclaimer 8717 // in the documentation and/or other materials provided with the 8718 // distribution. 8719 // * Neither the name of Google Inc. nor the name Chromium Embedded 8720 // Framework nor the names of its contributors may be used to endorse 8721 // or promote products derived from this software without specific prior 8722 // written permission. 8723 // 8724 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 8725 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 8726 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 8727 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 8728 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 8729 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 8730 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 8731 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 8732 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 8733 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 8734 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 8735 // 8736 // --------------------------------------------------------------------------- 8737 // 8738 // This file was generated by the CEF translator tool and should not edited 8739 // by hand. See the translator.README.txt file in the tools directory for 8740 // more information. 8741 // 8742 // $hash=47d8c186f687b65c8e7f394b97d72530e67593cd$ 8743 // 8744 8745 extern (C): 8746 8747 /// 8748 /// Structure to implement for visiting the DOM. The functions of this structure 8749 /// will be called on the render process main thread. 8750 /// 8751 struct cef_domvisitor_t 8752 { 8753 /// 8754 /// Base structure. 8755 /// 8756 cef_base_ref_counted_t base; 8757 8758 /// 8759 /// Method executed for visiting the DOM. The document object passed to this 8760 /// function represents a snapshot of the DOM at the time this function is 8761 /// executed. DOM objects are only valid for the scope of this function. Do 8762 /// not keep references to or attempt to access any DOM objects outside the 8763 /// scope of this function. 8764 /// 8765 extern(System) void function ( 8766 cef_domvisitor_t* self, 8767 cef_domdocument_t* document) nothrow visit; 8768 } 8769 8770 8771 8772 /// 8773 /// Structure used to represent a DOM document. The functions of this structure 8774 /// should only be called on the render process main thread thread. 8775 /// 8776 struct cef_domdocument_t 8777 { 8778 /// 8779 /// Base structure. 8780 /// 8781 cef_base_ref_counted_t base; 8782 8783 /// 8784 /// Returns the document type. 8785 /// 8786 extern(System) cef_dom_document_type_t function (cef_domdocument_t* self) nothrow get_type; 8787 8788 /// 8789 /// Returns the root document node. 8790 /// 8791 extern(System) cef_domnode_t* function (cef_domdocument_t* self) nothrow get_document; 8792 8793 /// 8794 /// Returns the BODY node of an HTML document. 8795 /// 8796 extern(System) cef_domnode_t* function (cef_domdocument_t* self) nothrow get_body; 8797 8798 /// 8799 /// Returns the HEAD node of an HTML document. 8800 /// 8801 extern(System) cef_domnode_t* function (cef_domdocument_t* self) nothrow get_head; 8802 8803 /// 8804 /// Returns the title of an HTML document. 8805 /// 8806 // The resulting string must be freed by calling cef_string_userfree_free(). 8807 extern(System) cef_string_userfree_t function (cef_domdocument_t* self) nothrow get_title; 8808 8809 /// 8810 /// Returns the document element with the specified ID value. 8811 /// 8812 extern(System) cef_domnode_t* function ( 8813 cef_domdocument_t* self, 8814 const(cef_string_t)* id) nothrow get_element_by_id; 8815 8816 /// 8817 /// Returns the node that currently has keyboard focus. 8818 /// 8819 extern(System) cef_domnode_t* function (cef_domdocument_t* self) nothrow get_focused_node; 8820 8821 /// 8822 /// Returns true (1) if a portion of the document is selected. 8823 /// 8824 extern(System) int function (cef_domdocument_t* self) nothrow has_selection; 8825 8826 /// 8827 /// Returns the selection offset within the start node. 8828 /// 8829 extern(System) int function (cef_domdocument_t* self) nothrow get_selection_start_offset; 8830 8831 /// 8832 /// Returns the selection offset within the end node. 8833 /// 8834 extern(System) int function (cef_domdocument_t* self) nothrow get_selection_end_offset; 8835 8836 /// 8837 /// Returns the contents of this selection as markup. 8838 /// 8839 // The resulting string must be freed by calling cef_string_userfree_free(). 8840 extern(System) cef_string_userfree_t function ( 8841 cef_domdocument_t* self) nothrow get_selection_as_markup; 8842 8843 /// 8844 /// Returns the contents of this selection as text. 8845 /// 8846 // The resulting string must be freed by calling cef_string_userfree_free(). 8847 extern(System) cef_string_userfree_t function ( 8848 cef_domdocument_t* self) nothrow get_selection_as_text; 8849 8850 /// 8851 /// Returns the base URL for the document. 8852 /// 8853 // The resulting string must be freed by calling cef_string_userfree_free(). 8854 extern(System) cef_string_userfree_t function (cef_domdocument_t* self) nothrow get_base_url; 8855 8856 /// 8857 /// Returns a complete URL based on the document base URL and the specified 8858 /// partial URL. 8859 /// 8860 // The resulting string must be freed by calling cef_string_userfree_free(). 8861 extern(System) cef_string_userfree_t function ( 8862 cef_domdocument_t* self, 8863 const(cef_string_t)* partialURL) nothrow get_complete_url; 8864 } 8865 8866 8867 8868 /// 8869 /// Structure used to represent a DOM node. The functions of this structure 8870 /// should only be called on the render process main thread. 8871 /// 8872 struct cef_domnode_t 8873 { 8874 /// 8875 /// Base structure. 8876 /// 8877 cef_base_ref_counted_t base; 8878 8879 /// 8880 /// Returns the type for this node. 8881 /// 8882 extern(System) cef_dom_node_type_t function (cef_domnode_t* self) nothrow get_type; 8883 8884 /// 8885 /// Returns true (1) if this is a text node. 8886 /// 8887 extern(System) int function (cef_domnode_t* self) nothrow is_text; 8888 8889 /// 8890 /// Returns true (1) if this is an element node. 8891 /// 8892 extern(System) int function (cef_domnode_t* self) nothrow is_element; 8893 8894 /// 8895 /// Returns true (1) if this is an editable node. 8896 /// 8897 extern(System) int function (cef_domnode_t* self) nothrow is_editable; 8898 8899 /// 8900 /// Returns true (1) if this is a form control element node. 8901 /// 8902 extern(System) int function (cef_domnode_t* self) nothrow is_form_control_element; 8903 8904 /// 8905 /// Returns the type of this form control element node. 8906 /// 8907 // The resulting string must be freed by calling cef_string_userfree_free(). 8908 extern(System) cef_string_userfree_t function ( 8909 cef_domnode_t* self) nothrow get_form_control_element_type; 8910 8911 /// 8912 /// Returns true (1) if this object is pointing to the same handle as |that| 8913 /// object. 8914 /// 8915 extern(System) int function (cef_domnode_t* self, cef_domnode_t* that) nothrow is_same; 8916 8917 /// 8918 /// Returns the name of this node. 8919 /// 8920 // The resulting string must be freed by calling cef_string_userfree_free(). 8921 extern(System) cef_string_userfree_t function (cef_domnode_t* self) nothrow get_name; 8922 8923 /// 8924 /// Returns the value of this node. 8925 /// 8926 // The resulting string must be freed by calling cef_string_userfree_free(). 8927 extern(System) cef_string_userfree_t function (cef_domnode_t* self) nothrow get_value; 8928 8929 /// 8930 /// Set the value of this node. Returns true (1) on success. 8931 /// 8932 extern(System) int function (cef_domnode_t* self, const(cef_string_t)* value) nothrow set_value; 8933 8934 /// 8935 /// Returns the contents of this node as markup. 8936 /// 8937 // The resulting string must be freed by calling cef_string_userfree_free(). 8938 extern(System) cef_string_userfree_t function (cef_domnode_t* self) nothrow get_as_markup; 8939 8940 /// 8941 /// Returns the document associated with this node. 8942 /// 8943 extern(System) cef_domdocument_t* function (cef_domnode_t* self) nothrow get_document; 8944 8945 /// 8946 /// Returns the parent node. 8947 /// 8948 extern(System) cef_domnode_t* function (cef_domnode_t* self) nothrow get_parent; 8949 8950 /// 8951 /// Returns the previous sibling node. 8952 /// 8953 extern(System) cef_domnode_t* function (cef_domnode_t* self) nothrow get_previous_sibling; 8954 8955 /// 8956 /// Returns the next sibling node. 8957 /// 8958 extern(System) cef_domnode_t* function (cef_domnode_t* self) nothrow get_next_sibling; 8959 8960 /// 8961 /// Returns true (1) if this node has child nodes. 8962 /// 8963 extern(System) int function (cef_domnode_t* self) nothrow has_children; 8964 8965 /// 8966 /// Return the first child node. 8967 /// 8968 extern(System) cef_domnode_t* function (cef_domnode_t* self) nothrow get_first_child; 8969 8970 /// 8971 /// Returns the last child node. 8972 /// 8973 extern(System) cef_domnode_t* function (cef_domnode_t* self) nothrow get_last_child; 8974 8975 /// 8976 /// Returns the tag name of this element. 8977 /// 8978 // The resulting string must be freed by calling cef_string_userfree_free(). 8979 extern(System) cef_string_userfree_t function (cef_domnode_t* self) nothrow get_element_tag_name; 8980 8981 /// 8982 /// Returns true (1) if this element has attributes. 8983 /// 8984 extern(System) int function (cef_domnode_t* self) nothrow has_element_attributes; 8985 8986 /// 8987 /// Returns true (1) if this element has an attribute named |attrName|. 8988 /// 8989 extern(System) int function ( 8990 cef_domnode_t* self, 8991 const(cef_string_t)* attrName) nothrow has_element_attribute; 8992 8993 /// 8994 /// Returns the element attribute named |attrName|. 8995 /// 8996 // The resulting string must be freed by calling cef_string_userfree_free(). 8997 extern(System) cef_string_userfree_t function ( 8998 cef_domnode_t* self, 8999 const(cef_string_t)* attrName) nothrow get_element_attribute; 9000 9001 /// 9002 /// Returns a map of all element attributes. 9003 /// 9004 extern(System) void function ( 9005 cef_domnode_t* self, 9006 cef_string_map_t attrMap) nothrow get_element_attributes; 9007 9008 /// 9009 /// Set the value for the element attribute named |attrName|. Returns true (1) 9010 /// on success. 9011 /// 9012 extern(System) int function ( 9013 cef_domnode_t* self, 9014 const(cef_string_t)* attrName, 9015 const(cef_string_t)* value) nothrow set_element_attribute; 9016 9017 /// 9018 /// Returns the inner text of the element. 9019 /// 9020 // The resulting string must be freed by calling cef_string_userfree_free(). 9021 extern(System) cef_string_userfree_t function ( 9022 cef_domnode_t* self) nothrow get_element_inner_text; 9023 9024 /// 9025 /// Returns the bounds of the element in device pixels. Use 9026 /// "window.devicePixelRatio" to convert to/from CSS pixels. 9027 /// 9028 extern(System) cef_rect_t function (cef_domnode_t* self) nothrow get_element_bounds; 9029 } 9030 9031 9032 9033 // CEF_INCLUDE_CAPI_CEF_DOM_CAPI_H_ 9034 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 9035 // 9036 // Redistribution and use in source and binary forms, with or without 9037 // modification, are permitted provided that the following conditions are 9038 // met: 9039 // 9040 // * Redistributions of source code must retain the above copyright 9041 // notice, this list of conditions and the following disclaimer. 9042 // * Redistributions in binary form must reproduce the above 9043 // copyright notice, this list of conditions and the following disclaimer 9044 // in the documentation and/or other materials provided with the 9045 // distribution. 9046 // * Neither the name of Google Inc. nor the name Chromium Embedded 9047 // Framework nor the names of its contributors may be used to endorse 9048 // or promote products derived from this software without specific prior 9049 // written permission. 9050 // 9051 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 9052 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 9053 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 9054 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 9055 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 9056 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 9057 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 9058 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 9059 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 9060 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 9061 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 9062 // 9063 // --------------------------------------------------------------------------- 9064 // 9065 // This file was generated by the CEF translator tool and should not edited 9066 // by hand. See the translator.README.txt file in the tools directory for 9067 // more information. 9068 // 9069 // $hash=aff139899b4b8b769fd0e506d8a46e434f924eee$ 9070 // 9071 9072 extern (C): 9073 9074 /// 9075 /// Callback structure used to asynchronously continue a download. 9076 /// 9077 struct cef_before_download_callback_t 9078 { 9079 /// 9080 /// Base structure. 9081 /// 9082 cef_base_ref_counted_t base; 9083 9084 /// 9085 /// Call to continue the download. Set |download_path| to the full file path 9086 /// for the download including the file name or leave blank to use the 9087 /// suggested name and the default temp directory. Set |show_dialog| to true 9088 /// (1) if you do wish to show the default "Save As" dialog. 9089 /// 9090 extern(System) void function ( 9091 cef_before_download_callback_t* self, 9092 const(cef_string_t)* download_path, 9093 int show_dialog) nothrow cont; 9094 } 9095 9096 9097 9098 /// 9099 /// Callback structure used to asynchronously cancel a download. 9100 /// 9101 struct cef_download_item_callback_t 9102 { 9103 /// 9104 /// Base structure. 9105 /// 9106 cef_base_ref_counted_t base; 9107 9108 /// 9109 /// Call to cancel the download. 9110 /// 9111 extern(System) void function (cef_download_item_callback_t* self) nothrow cancel; 9112 9113 /// 9114 /// Call to pause the download. 9115 /// 9116 extern(System) void function (cef_download_item_callback_t* self) nothrow pause; 9117 9118 /// 9119 /// Call to resume the download. 9120 /// 9121 extern(System) void function (cef_download_item_callback_t* self) nothrow resume; 9122 } 9123 9124 9125 9126 /// 9127 /// Structure used to handle file downloads. The functions of this structure 9128 /// will called on the browser process UI thread. 9129 /// 9130 struct cef_download_handler_t 9131 { 9132 /// 9133 /// Base structure. 9134 /// 9135 cef_base_ref_counted_t base; 9136 9137 /// 9138 /// Called before a download begins in response to a user-initiated action 9139 /// (e.g. alt + link click or link click that returns a `Content-Disposition: 9140 /// attachment` response from the server). |url| is the target download URL 9141 /// and |request_function| is the target function (GET, POST, etc) nothrow. Return 9142 /// true (1) to proceed with the download or false (0) to cancel the download. 9143 /// 9144 extern(System) int function ( 9145 cef_download_handler_t* self, 9146 cef_browser_t* browser, 9147 const(cef_string_t)* url, 9148 const(cef_string_t)* request_method) nothrow can_download; 9149 9150 /// 9151 /// Called before a download begins. |suggested_name| is the suggested name 9152 /// for the download file. By default the download will be canceled. Execute 9153 /// |callback| either asynchronously or in this function to continue the 9154 /// download if desired. Do not keep a reference to |download_item| outside of 9155 /// this function. 9156 /// 9157 extern(System) void function ( 9158 cef_download_handler_t* self, 9159 cef_browser_t* browser, 9160 cef_download_item_t* download_item, 9161 const(cef_string_t)* suggested_name, 9162 cef_before_download_callback_t* callback) nothrow on_before_download; 9163 9164 /// 9165 /// Called when a download's status or progress information has been updated. 9166 /// This may be called multiple times before and after on_before_download(). 9167 /// Execute |callback| either asynchronously or in this function to cancel the 9168 /// download if desired. Do not keep a reference to |download_item| outside of 9169 /// this function. 9170 /// 9171 extern(System) void function ( 9172 cef_download_handler_t* self, 9173 cef_browser_t* browser, 9174 cef_download_item_t* download_item, 9175 cef_download_item_callback_t* callback) nothrow on_download_updated; 9176 } 9177 9178 9179 9180 // CEF_INCLUDE_CAPI_CEF_DOWNLOAD_HANDLER_CAPI_H_ 9181 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 9182 // 9183 // Redistribution and use in source and binary forms, with or without 9184 // modification, are permitted provided that the following conditions are 9185 // met: 9186 // 9187 // * Redistributions of source code must retain the above copyright 9188 // notice, this list of conditions and the following disclaimer. 9189 // * Redistributions in binary form must reproduce the above 9190 // copyright notice, this list of conditions and the following disclaimer 9191 // in the documentation and/or other materials provided with the 9192 // distribution. 9193 // * Neither the name of Google Inc. nor the name Chromium Embedded 9194 // Framework nor the names of its contributors may be used to endorse 9195 // or promote products derived from this software without specific prior 9196 // written permission. 9197 // 9198 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 9199 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 9200 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 9201 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 9202 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 9203 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 9204 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 9205 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 9206 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 9207 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 9208 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 9209 // 9210 // --------------------------------------------------------------------------- 9211 // 9212 // This file was generated by the CEF translator tool and should not edited 9213 // by hand. See the translator.README.txt file in the tools directory for 9214 // more information. 9215 // 9216 // $hash=a218058d7ceb842c9ea0cf0c252f9787de6562e7$ 9217 // 9218 9219 extern (C): 9220 9221 /// 9222 /// Structure used to represent a download item. 9223 /// 9224 struct cef_download_item_t 9225 { 9226 /// 9227 /// Base structure. 9228 /// 9229 cef_base_ref_counted_t base; 9230 9231 /// 9232 /// Returns true (1) if this object is valid. Do not call any other functions 9233 /// if this function returns false (0). 9234 /// 9235 extern(System) int function (cef_download_item_t* self) nothrow is_valid; 9236 9237 /// 9238 /// Returns true (1) if the download is in progress. 9239 /// 9240 extern(System) int function (cef_download_item_t* self) nothrow is_in_progress; 9241 9242 /// 9243 /// Returns true (1) if the download is complete. 9244 /// 9245 extern(System) int function (cef_download_item_t* self) nothrow is_complete; 9246 9247 /// 9248 /// Returns true (1) if the download has been canceled or interrupted. 9249 /// 9250 extern(System) int function (cef_download_item_t* self) nothrow is_canceled; 9251 9252 /// 9253 /// Returns a simple speed estimate in bytes/s. 9254 /// 9255 extern(System) int64 function (cef_download_item_t* self) nothrow get_current_speed; 9256 9257 /// 9258 /// Returns the rough percent complete or -1 if the receive total size is 9259 /// unknown. 9260 /// 9261 extern(System) int function (cef_download_item_t* self) nothrow get_percent_complete; 9262 9263 /// 9264 /// Returns the total number of bytes. 9265 /// 9266 extern(System) int64 function (cef_download_item_t* self) nothrow get_total_bytes; 9267 9268 /// 9269 /// Returns the number of received bytes. 9270 /// 9271 extern(System) int64 function (cef_download_item_t* self) nothrow get_received_bytes; 9272 9273 /// 9274 /// Returns the time that the download started. 9275 /// 9276 extern(System) cef_basetime_t function (cef_download_item_t* self) nothrow get_start_time; 9277 9278 /// 9279 /// Returns the time that the download ended. 9280 /// 9281 extern(System) cef_basetime_t function (cef_download_item_t* self) nothrow get_end_time; 9282 9283 /// 9284 /// Returns the full path to the downloaded or downloading file. 9285 /// 9286 // The resulting string must be freed by calling cef_string_userfree_free(). 9287 extern(System) cef_string_userfree_t function (cef_download_item_t* self) nothrow get_full_path; 9288 9289 /// 9290 /// Returns the unique identifier for this download. 9291 /// 9292 extern(System) uint32 function (cef_download_item_t* self) nothrow get_id; 9293 9294 /// 9295 /// Returns the URL. 9296 /// 9297 // The resulting string must be freed by calling cef_string_userfree_free(). 9298 extern(System) cef_string_userfree_t function (cef_download_item_t* self) nothrow get_url; 9299 9300 /// 9301 /// Returns the original URL before any redirections. 9302 /// 9303 // The resulting string must be freed by calling cef_string_userfree_free(). 9304 extern(System) cef_string_userfree_t function ( 9305 cef_download_item_t* self) nothrow get_original_url; 9306 9307 /// 9308 /// Returns the suggested file name. 9309 /// 9310 // The resulting string must be freed by calling cef_string_userfree_free(). 9311 extern(System) cef_string_userfree_t function ( 9312 cef_download_item_t* self) nothrow get_suggested_file_name; 9313 9314 /// 9315 /// Returns the content disposition. 9316 /// 9317 // The resulting string must be freed by calling cef_string_userfree_free(). 9318 extern(System) cef_string_userfree_t function ( 9319 cef_download_item_t* self) nothrow get_content_disposition; 9320 9321 /// 9322 /// Returns the mime type. 9323 /// 9324 // The resulting string must be freed by calling cef_string_userfree_free(). 9325 extern(System) cef_string_userfree_t function (cef_download_item_t* self) nothrow get_mime_type; 9326 } 9327 9328 9329 9330 // CEF_INCLUDE_CAPI_CEF_DOWNLOAD_ITEM_CAPI_H_ 9331 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 9332 // 9333 // Redistribution and use in source and binary forms, with or without 9334 // modification, are permitted provided that the following conditions are 9335 // met: 9336 // 9337 // * Redistributions of source code must retain the above copyright 9338 // notice, this list of conditions and the following disclaimer. 9339 // * Redistributions in binary form must reproduce the above 9340 // copyright notice, this list of conditions and the following disclaimer 9341 // in the documentation and/or other materials provided with the 9342 // distribution. 9343 // * Neither the name of Google Inc. nor the name Chromium Embedded 9344 // Framework nor the names of its contributors may be used to endorse 9345 // or promote products derived from this software without specific prior 9346 // written permission. 9347 // 9348 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 9349 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 9350 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 9351 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 9352 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 9353 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 9354 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 9355 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 9356 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 9357 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 9358 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 9359 // 9360 // --------------------------------------------------------------------------- 9361 // 9362 // This file was generated by the CEF translator tool and should not edited 9363 // by hand. See the translator.README.txt file in the tools directory for 9364 // more information. 9365 // 9366 // $hash=9e8375de3d30eb7e4f67488da3568d19848eb038$ 9367 // 9368 9369 extern (C): 9370 9371 /// 9372 /// Structure used to represent drag data. The functions of this structure may 9373 /// be called on any thread. 9374 /// 9375 struct cef_drag_data_t 9376 { 9377 /// 9378 /// Base structure. 9379 /// 9380 cef_base_ref_counted_t base; 9381 9382 /// 9383 /// Returns a copy of the current object. 9384 /// 9385 extern(System) cef_drag_data_t* function (cef_drag_data_t* self) nothrow clone; 9386 9387 /// 9388 /// Returns true (1) if this object is read-only. 9389 /// 9390 extern(System) int function (cef_drag_data_t* self) nothrow is_read_only; 9391 9392 /// 9393 /// Returns true (1) if the drag data is a link. 9394 /// 9395 extern(System) int function (cef_drag_data_t* self) nothrow is_link; 9396 9397 /// 9398 /// Returns true (1) if the drag data is a text or html fragment. 9399 /// 9400 extern(System) int function (cef_drag_data_t* self) nothrow is_fragment; 9401 9402 /// 9403 /// Returns true (1) if the drag data is a file. 9404 /// 9405 extern(System) int function (cef_drag_data_t* self) nothrow is_file; 9406 9407 /// 9408 /// Return the link URL that is being dragged. 9409 /// 9410 // The resulting string must be freed by calling cef_string_userfree_free(). 9411 extern(System) cef_string_userfree_t function (cef_drag_data_t* self) nothrow get_link_url; 9412 9413 /// 9414 /// Return the title associated with the link being dragged. 9415 /// 9416 // The resulting string must be freed by calling cef_string_userfree_free(). 9417 extern(System) cef_string_userfree_t function (cef_drag_data_t* self) nothrow get_link_title; 9418 9419 /// 9420 /// Return the metadata, if any, associated with the link being dragged. 9421 /// 9422 // The resulting string must be freed by calling cef_string_userfree_free(). 9423 extern(System) cef_string_userfree_t function (cef_drag_data_t* self) nothrow get_link_metadata; 9424 9425 /// 9426 /// Return the plain text fragment that is being dragged. 9427 /// 9428 // The resulting string must be freed by calling cef_string_userfree_free(). 9429 extern(System) cef_string_userfree_t function (cef_drag_data_t* self) nothrow get_fragment_text; 9430 9431 /// 9432 /// Return the text/html fragment that is being dragged. 9433 /// 9434 // The resulting string must be freed by calling cef_string_userfree_free(). 9435 extern(System) cef_string_userfree_t function (cef_drag_data_t* self) nothrow get_fragment_html; 9436 9437 /// 9438 /// Return the base URL that the fragment came from. This value is used for 9439 /// resolving relative URLs and may be NULL. 9440 /// 9441 // The resulting string must be freed by calling cef_string_userfree_free(). 9442 extern(System) cef_string_userfree_t function ( 9443 cef_drag_data_t* self) nothrow get_fragment_base_url; 9444 9445 /// 9446 /// Return the name of the file being dragged out of the browser window. 9447 /// 9448 // The resulting string must be freed by calling cef_string_userfree_free(). 9449 extern(System) cef_string_userfree_t function (cef_drag_data_t* self) nothrow get_file_name; 9450 9451 /// 9452 /// Write the contents of the file being dragged out of the web view into 9453 /// |writer|. Returns the number of bytes sent to |writer|. If |writer| is 9454 /// NULL this function will return the size of the file contents in bytes. 9455 /// Call get_file_name() to get a suggested name for the file. 9456 /// 9457 extern(System) size_t function ( 9458 cef_drag_data_t* self, 9459 cef_stream_writer_t* writer) nothrow get_file_contents; 9460 9461 /// 9462 /// Retrieve the list of file names that are being dragged into the browser 9463 /// window. 9464 /// 9465 extern(System) int function ( 9466 cef_drag_data_t* self, 9467 cef_string_list_t names) nothrow get_file_names; 9468 9469 /// 9470 /// Set the link URL that is being dragged. 9471 /// 9472 extern(System) void function ( 9473 cef_drag_data_t* self, 9474 const(cef_string_t)* url) nothrow set_link_url; 9475 9476 /// 9477 /// Set the title associated with the link being dragged. 9478 /// 9479 extern(System) void function ( 9480 cef_drag_data_t* self, 9481 const(cef_string_t)* title) nothrow set_link_title; 9482 9483 /// 9484 /// Set the metadata associated with the link being dragged. 9485 /// 9486 extern(System) void function ( 9487 cef_drag_data_t* self, 9488 const(cef_string_t)* data) nothrow set_link_metadata; 9489 9490 /// 9491 /// Set the plain text fragment that is being dragged. 9492 /// 9493 extern(System) void function ( 9494 cef_drag_data_t* self, 9495 const(cef_string_t)* text) nothrow set_fragment_text; 9496 9497 /// 9498 /// Set the text/html fragment that is being dragged. 9499 /// 9500 extern(System) void function ( 9501 cef_drag_data_t* self, 9502 const(cef_string_t)* html) nothrow set_fragment_html; 9503 9504 /// 9505 /// Set the base URL that the fragment came from. 9506 /// 9507 extern(System) void function ( 9508 cef_drag_data_t* self, 9509 const(cef_string_t)* base_url) nothrow set_fragment_base_url; 9510 9511 /// 9512 /// Reset the file contents. You should do this before calling 9513 /// cef_browser_host_t::DragTargetDragEnter as the web view does not allow us 9514 /// to drag in this kind of data. 9515 /// 9516 extern(System) void function (cef_drag_data_t* self) nothrow reset_file_contents; 9517 9518 /// 9519 /// Add a file that is being dragged into the webview. 9520 /// 9521 extern(System) void function ( 9522 cef_drag_data_t* self, 9523 const(cef_string_t)* path, 9524 const(cef_string_t)* display_name) nothrow add_file; 9525 9526 /// 9527 /// Clear list of filenames. 9528 /// 9529 extern(System) void function (cef_drag_data_t* self) nothrow clear_filenames; 9530 9531 /// 9532 /// Get the image representation of drag data. May return NULL if no image 9533 /// representation is available. 9534 /// 9535 extern(System) cef_image_t* function (cef_drag_data_t* self) nothrow get_image; 9536 9537 /// 9538 /// Get the image hotspot (drag start location relative to image dimensions). 9539 /// 9540 extern(System) cef_point_t function (cef_drag_data_t* self) nothrow get_image_hotspot; 9541 9542 /// 9543 /// Returns true (1) if an image representation of drag data is available. 9544 /// 9545 extern(System) int function (cef_drag_data_t* self) nothrow has_image; 9546 } 9547 9548 9549 9550 /// 9551 /// Create a new cef_drag_data_t object. 9552 /// 9553 cef_drag_data_t* cef_drag_data_create (); 9554 9555 // CEF_INCLUDE_CAPI_CEF_DRAG_DATA_CAPI_H_ 9556 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 9557 // 9558 // Redistribution and use in source and binary forms, with or without 9559 // modification, are permitted provided that the following conditions are 9560 // met: 9561 // 9562 // * Redistributions of source code must retain the above copyright 9563 // notice, this list of conditions and the following disclaimer. 9564 // * Redistributions in binary form must reproduce the above 9565 // copyright notice, this list of conditions and the following disclaimer 9566 // in the documentation and/or other materials provided with the 9567 // distribution. 9568 // * Neither the name of Google Inc. nor the name Chromium Embedded 9569 // Framework nor the names of its contributors may be used to endorse 9570 // or promote products derived from this software without specific prior 9571 // written permission. 9572 // 9573 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 9574 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 9575 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 9576 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 9577 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 9578 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 9579 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 9580 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 9581 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 9582 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 9583 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 9584 // 9585 // --------------------------------------------------------------------------- 9586 // 9587 // This file was generated by the CEF translator tool and should not edited 9588 // by hand. See the translator.README.txt file in the tools directory for 9589 // more information. 9590 // 9591 // $hash=ec450acb2c3cc4d0e69b7da725387d5c1049773b$ 9592 // 9593 9594 extern (C): 9595 9596 /// 9597 /// Implement this structure to handle events related to dragging. The functions 9598 /// of this structure will be called on the UI thread. 9599 /// 9600 struct cef_drag_handler_t 9601 { 9602 /// 9603 /// Base structure. 9604 /// 9605 cef_base_ref_counted_t base; 9606 9607 /// 9608 /// Called when an external drag event enters the browser window. |dragData| 9609 /// contains the drag event data and |mask| represents the type of drag 9610 /// operation. Return false (0) for default drag handling behavior or true (1) 9611 /// to cancel the drag event. 9612 /// 9613 extern(System) int function ( 9614 cef_drag_handler_t* self, 9615 cef_browser_t* browser, 9616 cef_drag_data_t* dragData, 9617 cef_drag_operations_mask_t mask) nothrow on_drag_enter; 9618 9619 /// 9620 /// Called whenever draggable regions for the browser window change. These can 9621 /// be specified using the '-webkit-app-region: drag/no-drag' CSS-property. If 9622 /// draggable regions are never defined in a document this function will also 9623 /// never be called. If the last draggable region is removed from a document 9624 /// this function will be called with an NULL vector. 9625 /// 9626 extern(System) void function ( 9627 cef_drag_handler_t* self, 9628 cef_browser_t* browser, 9629 cef_frame_t* frame, 9630 size_t regionsCount, 9631 const(cef_draggable_region_t)* regions) nothrow on_draggable_regions_changed; 9632 } 9633 9634 9635 9636 // CEF_INCLUDE_CAPI_CEF_DRAG_HANDLER_CAPI_H_ 9637 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 9638 // 9639 // Redistribution and use in source and binary forms, with or without 9640 // modification, are permitted provided that the following conditions are 9641 // met: 9642 // 9643 // * Redistributions of source code must retain the above copyright 9644 // notice, this list of conditions and the following disclaimer. 9645 // * Redistributions in binary form must reproduce the above 9646 // copyright notice, this list of conditions and the following disclaimer 9647 // in the documentation and/or other materials provided with the 9648 // distribution. 9649 // * Neither the name of Google Inc. nor the name Chromium Embedded 9650 // Framework nor the names of its contributors may be used to endorse 9651 // or promote products derived from this software without specific prior 9652 // written permission. 9653 // 9654 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 9655 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 9656 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 9657 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 9658 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 9659 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 9660 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 9661 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 9662 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 9663 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 9664 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 9665 // 9666 // --------------------------------------------------------------------------- 9667 // 9668 // This file was generated by the CEF translator tool and should not edited 9669 // by hand. See the translator.README.txt file in the tools directory for 9670 // more information. 9671 // 9672 // $hash=b16b1c47d26e911d360159e5535743622a411c31$ 9673 // 9674 9675 extern (C): 9676 9677 9678 9679 9680 /// 9681 /// Object representing an extension. Methods may be called on any thread unless 9682 /// otherwise indicated. 9683 /// 9684 struct cef_extension_t 9685 { 9686 /// 9687 /// Base structure. 9688 /// 9689 cef_base_ref_counted_t base; 9690 9691 /// 9692 /// Returns the unique extension identifier. This is calculated based on the 9693 /// extension public key, if available, or on the extension path. See 9694 /// https://developer.chrome.com/extensions/manifest/key for details. 9695 /// 9696 // The resulting string must be freed by calling cef_string_userfree_free(). 9697 extern(System) cef_string_userfree_t function (cef_extension_t* self) nothrow get_identifier; 9698 9699 /// 9700 /// Returns the absolute path to the extension directory on disk. This value 9701 /// will be prefixed with PK_DIR_RESOURCES if a relative path was passed to 9702 /// cef_request_context_t::LoadExtension. 9703 /// 9704 // The resulting string must be freed by calling cef_string_userfree_free(). 9705 extern(System) cef_string_userfree_t function (cef_extension_t* self) nothrow get_path; 9706 9707 /// 9708 /// Returns the extension manifest contents as a cef_dictionary_value_t 9709 /// object. See https://developer.chrome.com/extensions/manifest for details. 9710 /// 9711 extern(System) cef_dictionary_value_t* function (cef_extension_t* self) nothrow get_manifest; 9712 9713 /// 9714 /// Returns true (1) if this object is the same extension as |that| object. 9715 /// Extensions are considered the same if identifier, path and loader context 9716 /// match. 9717 /// 9718 extern(System) int function (cef_extension_t* self, cef_extension_t* that) nothrow is_same; 9719 9720 /// 9721 /// Returns the handler for this extension. Will return NULL for internal 9722 /// extensions or if no handler was passed to 9723 /// cef_request_context_t::LoadExtension. 9724 /// 9725 extern(System) cef_extension_handler_t* function (cef_extension_t* self) nothrow get_handler; 9726 9727 /// 9728 /// Returns the request context that loaded this extension. Will return NULL 9729 /// for internal extensions or if the extension has been unloaded. See the 9730 /// cef_request_context_t::LoadExtension documentation for more information 9731 /// about loader contexts. Must be called on the browser process UI thread. 9732 /// 9733 extern(System) cef_request_context_t* function ( 9734 cef_extension_t* self) nothrow get_loader_context; 9735 9736 /// 9737 /// Returns true (1) if this extension is currently loaded. Must be called on 9738 /// the browser process UI thread. 9739 /// 9740 extern(System) int function (cef_extension_t* self) nothrow is_loaded; 9741 9742 /// 9743 /// Unload this extension if it is not an internal extension and is currently 9744 /// loaded. Will result in a call to 9745 /// cef_extension_handler_t::OnExtensionUnloaded on success. 9746 /// 9747 extern(System) void function (cef_extension_t* self) nothrow unload; 9748 } 9749 9750 9751 9752 // CEF_INCLUDE_CAPI_CEF_EXTENSION_CAPI_H_ 9753 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 9754 // 9755 // Redistribution and use in source and binary forms, with or without 9756 // modification, are permitted provided that the following conditions are 9757 // met: 9758 // 9759 // * Redistributions of source code must retain the above copyright 9760 // notice, this list of conditions and the following disclaimer. 9761 // * Redistributions in binary form must reproduce the above 9762 // copyright notice, this list of conditions and the following disclaimer 9763 // in the documentation and/or other materials provided with the 9764 // distribution. 9765 // * Neither the name of Google Inc. nor the name Chromium Embedded 9766 // Framework nor the names of its contributors may be used to endorse 9767 // or promote products derived from this software without specific prior 9768 // written permission. 9769 // 9770 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 9771 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 9772 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 9773 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 9774 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 9775 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 9776 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 9777 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 9778 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 9779 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 9780 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 9781 // 9782 // --------------------------------------------------------------------------- 9783 // 9784 // This file was generated by the CEF translator tool and should not edited 9785 // by hand. See the translator.README.txt file in the tools directory for 9786 // more information. 9787 // 9788 // $hash=ba961ade334c82e53213e7e8ac848adc2a7b533a$ 9789 // 9790 9791 extern (C): 9792 9793 9794 9795 /// 9796 /// Callback structure used for asynchronous continuation of 9797 /// cef_extension_handler_t::GetExtensionResource. 9798 /// 9799 struct cef_get_extension_resource_callback_t 9800 { 9801 /// 9802 /// Base structure. 9803 /// 9804 cef_base_ref_counted_t base; 9805 9806 /// 9807 /// Continue the request. Read the resource contents from |stream|. 9808 /// 9809 extern(System) void function ( 9810 cef_get_extension_resource_callback_t* self, 9811 cef_stream_reader_t* stream) nothrow cont; 9812 9813 /// 9814 /// Cancel the request. 9815 /// 9816 extern(System) void function (cef_get_extension_resource_callback_t* self) nothrow cancel; 9817 } 9818 9819 9820 9821 /// 9822 /// Implement this structure to handle events related to browser extensions. The 9823 /// functions of this structure will be called on the UI thread. See 9824 /// cef_request_context_t::LoadExtension for information about extension 9825 /// loading. 9826 /// 9827 struct cef_extension_handler_t 9828 { 9829 /// 9830 /// Base structure. 9831 /// 9832 cef_base_ref_counted_t base; 9833 9834 /// 9835 /// Called if the cef_request_context_t::LoadExtension request fails. |result| 9836 /// will be the error code. 9837 /// 9838 extern(System) void function ( 9839 cef_extension_handler_t* self, 9840 cef_errorcode_t result) nothrow on_extension_load_failed; 9841 9842 /// 9843 /// Called if the cef_request_context_t::LoadExtension request succeeds. 9844 /// |extension| is the loaded extension. 9845 /// 9846 extern(System) void function ( 9847 cef_extension_handler_t* self, 9848 cef_extension_t* extension) nothrow on_extension_loaded; 9849 9850 /// 9851 /// Called after the cef_extension_t::Unload request has completed. 9852 /// 9853 extern(System) void function ( 9854 cef_extension_handler_t* self, 9855 cef_extension_t* extension) nothrow on_extension_unloaded; 9856 9857 /// 9858 /// Called when an extension needs a browser to host a background script 9859 /// specified via the "background" manifest key. The browser will have no 9860 /// visible window and cannot be displayed. |extension| is the extension that 9861 /// is loading the background script. |url| is an internally generated 9862 /// reference to an HTML page that will be used to load the background script 9863 /// via a "<script>" src attribute. To allow creation of the browser 9864 /// optionally modify |client| and |settings| and return false (0). To cancel 9865 /// creation of the browser (and consequently cancel load of the background 9866 /// script) return true (1). Successful creation will be indicated by a call 9867 /// to cef_life_span_handler_t::OnAfterCreated, and 9868 /// cef_browser_host_t::IsBackgroundHost will return true (1) for the 9869 /// resulting browser. See https://developer.chrome.com/extensions/event_pages 9870 /// for more information about extension background script usage. 9871 /// 9872 extern(System) int function ( 9873 cef_extension_handler_t* self, 9874 cef_extension_t* extension, 9875 const(cef_string_t)* url, 9876 cef_client_t** client, 9877 cef_browser_settings_t* settings) nothrow on_before_background_browser; 9878 9879 /// 9880 /// Called when an extension API (e.g. chrome.tabs.create) requests creation 9881 /// of a new browser. |extension| and |browser| are the source of the API 9882 /// call. |active_browser| may optionally be specified via the windowId 9883 /// property or returned via the get_active_browser() callback and provides 9884 /// the default |client| and |settings| values for the new browser. |index| is 9885 /// the position value optionally specified via the index property. |url| is 9886 /// the URL that will be loaded in the browser. |active| is true (1) if the 9887 /// new browser should be active when opened. To allow creation of the 9888 /// browser optionally modify |windowInfo|, |client| and |settings| and return 9889 /// false (0). To cancel creation of the browser return true (1). Successful 9890 /// creation will be indicated by a call to 9891 /// cef_life_span_handler_t::OnAfterCreated. Any modifications to |windowInfo| 9892 /// will be ignored if |active_browser| is wrapped in a cef_browser_view_t. 9893 /// 9894 extern(System) int function ( 9895 cef_extension_handler_t* self, 9896 cef_extension_t* extension, 9897 cef_browser_t* browser, 9898 cef_browser_t* active_browser, 9899 int index, 9900 const(cef_string_t)* url, 9901 int active, 9902 cef_window_info_t* windowInfo, 9903 cef_client_t** client, 9904 cef_browser_settings_t* settings) nothrow on_before_browser; 9905 9906 /// 9907 /// Called when no tabId is specified to an extension API call that accepts a 9908 /// tabId parameter (e.g. chrome.tabs.*). |extension| and |browser| are the 9909 /// source of the API call. Return the browser that will be acted on by the 9910 /// API call or return NULL to act on |browser|. The returned browser must 9911 /// share the same cef_request_context_t as |browser|. Incognito browsers 9912 /// should not be considered unless the source extension has incognito access 9913 /// enabled, in which case |include_incognito| will be true (1). 9914 /// 9915 extern(System) cef_browser_t* function ( 9916 cef_extension_handler_t* self, 9917 cef_extension_t* extension, 9918 cef_browser_t* browser, 9919 int include_incognito) nothrow get_active_browser; 9920 9921 /// 9922 /// Called when the tabId associated with |target_browser| is specified to an 9923 /// extension API call that accepts a tabId parameter (e.g. chrome.tabs.*). 9924 /// |extension| and |browser| are the source of the API call. Return true (1) 9925 /// to allow access of false (0) to deny access. Access to incognito browsers 9926 /// should not be allowed unless the source extension has incognito access 9927 /// enabled, in which case |include_incognito| will be true (1). 9928 /// 9929 extern(System) int function ( 9930 cef_extension_handler_t* self, 9931 cef_extension_t* extension, 9932 cef_browser_t* browser, 9933 int include_incognito, 9934 cef_browser_t* target_browser) nothrow can_access_browser; 9935 9936 /// 9937 /// Called to retrieve an extension resource that would normally be loaded 9938 /// from disk (e.g. if a file parameter is specified to 9939 /// chrome.tabs.executeScript). |extension| and |browser| are the source of 9940 /// the resource request. |file| is the requested relative file path. To 9941 /// handle the resource request return true (1) and execute |callback| either 9942 /// synchronously or asynchronously. For the default behavior which reads the 9943 /// resource from the extension directory on disk return false (0). 9944 /// Localization substitutions will not be applied to resources handled via 9945 /// this function. 9946 /// 9947 extern(System) int function ( 9948 cef_extension_handler_t* self, 9949 cef_extension_t* extension, 9950 cef_browser_t* browser, 9951 const(cef_string_t)* file, 9952 cef_get_extension_resource_callback_t* callback) nothrow get_extension_resource; 9953 } 9954 9955 9956 9957 // CEF_INCLUDE_CAPI_CEF_EXTENSION_HANDLER_CAPI_H_ 9958 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 9959 // 9960 // Redistribution and use in source and binary forms, with or without 9961 // modification, are permitted provided that the following conditions are 9962 // met: 9963 // 9964 // * Redistributions of source code must retain the above copyright 9965 // notice, this list of conditions and the following disclaimer. 9966 // * Redistributions in binary form must reproduce the above 9967 // copyright notice, this list of conditions and the following disclaimer 9968 // in the documentation and/or other materials provided with the 9969 // distribution. 9970 // * Neither the name of Google Inc. nor the name Chromium Embedded 9971 // Framework nor the names of its contributors may be used to endorse 9972 // or promote products derived from this software without specific prior 9973 // written permission. 9974 // 9975 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 9976 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 9977 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 9978 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 9979 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 9980 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 9981 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 9982 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 9983 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 9984 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 9985 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 9986 // 9987 // --------------------------------------------------------------------------- 9988 // 9989 // This file was generated by the CEF translator tool and should not edited 9990 // by hand. See the translator.README.txt file in the tools directory for 9991 // more information. 9992 // 9993 // $hash=3e2e068a2be0a3b12653eea65a4bbe1c9cdb8c7f$ 9994 // 9995 9996 extern (C): 9997 9998 /// 9999 /// Creates a directory and all parent directories if they don't already exist. 10000 /// Returns true (1) on successful creation or if the directory already exists. 10001 /// The directory is only readable by the current user. Calling this function on 10002 /// the browser process UI or IO threads is not allowed. 10003 /// 10004 int cef_create_directory (const(cef_string_t)* full_path); 10005 10006 /// 10007 /// Get the temporary directory provided by the system. 10008 /// 10009 /// WARNING: In general, you should use the temp directory variants below 10010 /// instead of this function. Those variants will ensure that the proper 10011 /// permissions are set so that other users on the system can't edit them while 10012 /// they're open (which could lead to security issues). 10013 /// 10014 int cef_get_temp_directory (cef_string_t* temp_dir); 10015 10016 /// 10017 /// Creates a new directory. On Windows if |prefix| is provided the new 10018 /// directory name is in the format of "prefixyyyy". Returns true (1) on success 10019 /// and sets |new_temp_path| to the full path of the directory that was created. 10020 /// The directory is only readable by the current user. Calling this function on 10021 /// the browser process UI or IO threads is not allowed. 10022 /// 10023 int cef_create_new_temp_directory ( 10024 const(cef_string_t)* prefix, 10025 cef_string_t* new_temp_path); 10026 10027 /// 10028 /// Creates a directory within another directory. Extra characters will be 10029 /// appended to |prefix| to ensure that the new directory does not have the same 10030 /// name as an existing directory. Returns true (1) on success and sets 10031 /// |new_dir| to the full path of the directory that was created. The directory 10032 /// is only readable by the current user. Calling this function on the browser 10033 /// process UI or IO threads is not allowed. 10034 /// 10035 int cef_create_temp_directory_in_directory ( 10036 const(cef_string_t)* base_dir, 10037 const(cef_string_t)* prefix, 10038 cef_string_t* new_dir); 10039 10040 /// 10041 /// Returns true (1) if the given path exists and is a directory. Calling this 10042 /// function on the browser process UI or IO threads is not allowed. 10043 /// 10044 int cef_directory_exists (const(cef_string_t)* path); 10045 10046 /// 10047 /// Deletes the given path whether it's a file or a directory. If |path| is a 10048 /// directory all contents will be deleted. If |recursive| is true (1) any sub- 10049 /// directories and their contents will also be deleted (equivalent to executing 10050 /// "rm -rf", so use with caution). On POSIX environments if |path| is a 10051 /// symbolic link then only the symlink will be deleted. Returns true (1) on 10052 /// successful deletion or if |path| does not exist. Calling this function on 10053 /// the browser process UI or IO threads is not allowed. 10054 /// 10055 int cef_delete_file (const(cef_string_t)* path, int recursive); 10056 10057 /// 10058 /// Writes the contents of |src_dir| into a zip archive at |dest_file|. If 10059 /// |include_hidden_files| is true (1) files starting with "." will be included. 10060 /// Returns true (1) on success. Calling this function on the browser process 10061 /// UI or IO threads is not allowed. 10062 /// 10063 int cef_zip_directory ( 10064 const(cef_string_t)* src_dir, 10065 const(cef_string_t)* dest_file, 10066 int include_hidden_files); 10067 10068 /// 10069 /// Loads the existing "Certificate Revocation Lists" file that is managed by 10070 /// Google Chrome. This file can generally be found in Chrome's User Data 10071 /// directory (e.g. "C:\Users\[User]\AppData\Local\Google\Chrome\User Data\" on 10072 /// Windows) and is updated periodically by Chrome's component updater service. 10073 /// Must be called in the browser process after the context has been 10074 /// initialized. See https://dev.chromium.org/Home/chromium-security/crlsets for 10075 /// background. 10076 /// 10077 void cef_load_crlsets_file (const(cef_string_t)* path); 10078 10079 // CEF_INCLUDE_CAPI_CEF_FILE_UTIL_CAPI_H_ 10080 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 10081 // 10082 // Redistribution and use in source and binary forms, with or without 10083 // modification, are permitted provided that the following conditions are 10084 // met: 10085 // 10086 // * Redistributions of source code must retain the above copyright 10087 // notice, this list of conditions and the following disclaimer. 10088 // * Redistributions in binary form must reproduce the above 10089 // copyright notice, this list of conditions and the following disclaimer 10090 // in the documentation and/or other materials provided with the 10091 // distribution. 10092 // * Neither the name of Google Inc. nor the name Chromium Embedded 10093 // Framework nor the names of its contributors may be used to endorse 10094 // or promote products derived from this software without specific prior 10095 // written permission. 10096 // 10097 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 10098 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 10099 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 10100 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 10101 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 10102 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 10103 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 10104 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 10105 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 10106 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 10107 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 10108 // 10109 // --------------------------------------------------------------------------- 10110 // 10111 // This file was generated by the CEF translator tool and should not edited 10112 // by hand. See the translator.README.txt file in the tools directory for 10113 // more information. 10114 // 10115 // $hash=30e86c9dd440616305f94747b313eb526c4323c7$ 10116 // 10117 10118 extern (C): 10119 10120 /// 10121 /// Implement this structure to handle events related to find results. The 10122 /// functions of this structure will be called on the UI thread. 10123 /// 10124 struct cef_find_handler_t 10125 { 10126 /// 10127 /// Base structure. 10128 /// 10129 cef_base_ref_counted_t base; 10130 10131 /// 10132 /// Called to report find results returned by cef_browser_host_t::find(). 10133 /// |identifer| is a unique incremental identifier for the currently active 10134 /// search, |count| is the number of matches currently identified, 10135 /// |selectionRect| is the location of where the match was found (in window 10136 /// coordinates), |activeMatchOrdinal| is the current position in the search 10137 /// results, and |finalUpdate| is true (1) if this is the last find 10138 /// notification. 10139 /// 10140 extern(System) void function ( 10141 cef_find_handler_t* self, 10142 cef_browser_t* browser, 10143 int identifier, 10144 int count, 10145 const(cef_rect_t)* selectionRect, 10146 int activeMatchOrdinal, 10147 int finalUpdate) nothrow on_find_result; 10148 } 10149 10150 10151 10152 // CEF_INCLUDE_CAPI_CEF_FIND_HANDLER_CAPI_H_ 10153 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 10154 // 10155 // Redistribution and use in source and binary forms, with or without 10156 // modification, are permitted provided that the following conditions are 10157 // met: 10158 // 10159 // * Redistributions of source code must retain the above copyright 10160 // notice, this list of conditions and the following disclaimer. 10161 // * Redistributions in binary form must reproduce the above 10162 // copyright notice, this list of conditions and the following disclaimer 10163 // in the documentation and/or other materials provided with the 10164 // distribution. 10165 // * Neither the name of Google Inc. nor the name Chromium Embedded 10166 // Framework nor the names of its contributors may be used to endorse 10167 // or promote products derived from this software without specific prior 10168 // written permission. 10169 // 10170 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 10171 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 10172 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 10173 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 10174 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 10175 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 10176 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 10177 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 10178 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 10179 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 10180 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 10181 // 10182 // --------------------------------------------------------------------------- 10183 // 10184 // This file was generated by the CEF translator tool and should not edited 10185 // by hand. See the translator.README.txt file in the tools directory for 10186 // more information. 10187 // 10188 // $hash=907b9628ac4b7ab4603dc6e20b7e8675a51987ba$ 10189 // 10190 10191 extern (C): 10192 10193 /// 10194 /// Implement this structure to handle events related to focus. The functions of 10195 /// this structure will be called on the UI thread. 10196 /// 10197 struct cef_focus_handler_t 10198 { 10199 /// 10200 /// Base structure. 10201 /// 10202 cef_base_ref_counted_t base; 10203 10204 /// 10205 /// Called when the browser component is about to loose focus. For instance, 10206 /// if focus was on the last HTML element and the user pressed the TAB key. 10207 /// |next| will be true (1) if the browser is giving focus to the next 10208 /// component and false (0) if the browser is giving focus to the previous 10209 /// component. 10210 /// 10211 extern(System) void function ( 10212 cef_focus_handler_t* self, 10213 cef_browser_t* browser, 10214 int next) nothrow on_take_focus; 10215 10216 /// 10217 /// Called when the browser component is requesting focus. |source| indicates 10218 /// where the focus request is originating from. Return false (0) to allow the 10219 /// focus to be set or true (1) to cancel setting the focus. 10220 /// 10221 extern(System) int function ( 10222 cef_focus_handler_t* self, 10223 cef_browser_t* browser, 10224 cef_focus_source_t source) nothrow on_set_focus; 10225 10226 /// 10227 /// Called when the browser component has received focus. 10228 /// 10229 extern(System) void function ( 10230 cef_focus_handler_t* self, 10231 cef_browser_t* browser) nothrow on_got_focus; 10232 } 10233 10234 10235 10236 // CEF_INCLUDE_CAPI_CEF_FOCUS_HANDLER_CAPI_H_ 10237 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 10238 // 10239 // Redistribution and use in source and binary forms, with or without 10240 // modification, are permitted provided that the following conditions are 10241 // met: 10242 // 10243 // * Redistributions of source code must retain the above copyright 10244 // notice, this list of conditions and the following disclaimer. 10245 // * Redistributions in binary form must reproduce the above 10246 // copyright notice, this list of conditions and the following disclaimer 10247 // in the documentation and/or other materials provided with the 10248 // distribution. 10249 // * Neither the name of Google Inc. nor the name Chromium Embedded 10250 // Framework nor the names of its contributors may be used to endorse 10251 // or promote products derived from this software without specific prior 10252 // written permission. 10253 // 10254 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 10255 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 10256 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 10257 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 10258 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 10259 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 10260 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 10261 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 10262 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 10263 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 10264 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 10265 // 10266 // --------------------------------------------------------------------------- 10267 // 10268 // This file was generated by the CEF translator tool and should not edited 10269 // by hand. See the translator.README.txt file in the tools directory for 10270 // more information. 10271 // 10272 // $hash=48bc345bb0971e3fcaaf839e9e4419b2aec0e33b$ 10273 // 10274 10275 extern (C): 10276 10277 10278 10279 10280 10281 10282 /// 10283 /// Structure used to represent a frame in the browser window. When used in the 10284 /// browser process the functions of this structure may be called on any thread 10285 /// unless otherwise indicated in the comments. When used in the render process 10286 /// the functions of this structure may only be called on the main thread. 10287 /// 10288 struct cef_frame_t 10289 { 10290 /// 10291 /// Base structure. 10292 /// 10293 cef_base_ref_counted_t base; 10294 10295 /// 10296 /// True if this object is currently attached to a valid frame. 10297 /// 10298 extern(System) int function (cef_frame_t* self) nothrow is_valid; 10299 10300 /// 10301 /// Execute undo in this frame. 10302 /// 10303 extern(System) void function (cef_frame_t* self) nothrow undo; 10304 10305 /// 10306 /// Execute redo in this frame. 10307 /// 10308 extern(System) void function (cef_frame_t* self) nothrow redo; 10309 10310 /// 10311 /// Execute cut in this frame. 10312 /// 10313 extern(System) void function (cef_frame_t* self) nothrow cut; 10314 10315 /// 10316 /// Execute copy in this frame. 10317 /// 10318 extern(System) void function (cef_frame_t* self) nothrow copy; 10319 10320 /// 10321 /// Execute paste in this frame. 10322 /// 10323 extern(System) void function (cef_frame_t* self) nothrow paste; 10324 10325 /// 10326 /// Execute delete in this frame. 10327 /// 10328 extern(System) void function (cef_frame_t* self) nothrow del; 10329 10330 /// 10331 /// Execute select all in this frame. 10332 /// 10333 extern(System) void function (cef_frame_t* self) nothrow select_all; 10334 10335 /// 10336 /// Save this frame's HTML source to a temporary file and open it in the 10337 /// default text viewing application. This function can only be called from 10338 /// the browser process. 10339 /// 10340 extern(System) void function (cef_frame_t* self) nothrow view_source; 10341 10342 /// 10343 /// Retrieve this frame's HTML source as a string sent to the specified 10344 /// visitor. 10345 /// 10346 extern(System) void function ( 10347 cef_frame_t* self, 10348 cef_string_visitor_t* visitor) nothrow get_source; 10349 10350 /// 10351 /// Retrieve this frame's display text as a string sent to the specified 10352 /// visitor. 10353 /// 10354 extern(System) void function ( 10355 cef_frame_t* self, 10356 cef_string_visitor_t* visitor) nothrow get_text; 10357 10358 /// 10359 /// Load the request represented by the |request| object. 10360 /// 10361 /// WARNING: This function will fail with "bad IPC message" reason 10362 /// INVALID_INITIATOR_ORIGIN (213) unless you first navigate to the request 10363 /// origin using some other mechanism (LoadURL, link click, etc). 10364 /// 10365 extern(System) void function (cef_frame_t* self, cef_request_t* request) nothrow load_request; 10366 10367 /// 10368 /// Load the specified |url|. 10369 /// 10370 extern(System) void function (cef_frame_t* self, const(cef_string_t)* url) nothrow load_url; 10371 10372 /// 10373 /// Execute a string of JavaScript code in this frame. The |script_url| 10374 /// parameter is the URL where the script in question can be found, if any. 10375 /// The renderer may request this URL to show the developer the source of the 10376 /// error. The |start_line| parameter is the base line number to use for 10377 /// error reporting. 10378 /// 10379 extern(System) void function ( 10380 cef_frame_t* self, 10381 const(cef_string_t)* code, 10382 const(cef_string_t)* script_url, 10383 int start_line) nothrow execute_java_script; 10384 10385 /// 10386 /// Returns true (1) if this is the main (top-level) frame. 10387 /// 10388 extern(System) int function (cef_frame_t* self) nothrow is_main; 10389 10390 /// 10391 /// Returns true (1) if this is the focused frame. 10392 /// 10393 extern(System) int function (cef_frame_t* self) nothrow is_focused; 10394 10395 /// 10396 /// Returns the name for this frame. If the frame has an assigned name (for 10397 /// example, set via the iframe "name" attribute) then that value will be 10398 /// returned. Otherwise a unique name will be constructed based on the frame 10399 /// parent hierarchy. The main (top-level) frame will always have an NULL name 10400 /// value. 10401 /// 10402 // The resulting string must be freed by calling cef_string_userfree_free(). 10403 extern(System) cef_string_userfree_t function (cef_frame_t* self) nothrow get_name; 10404 10405 /// 10406 /// Returns the globally unique identifier for this frame or < 0 if the 10407 /// underlying frame does not yet exist. 10408 /// 10409 extern(System) int64 function (cef_frame_t* self) nothrow get_identifier; 10410 10411 /// 10412 /// Returns the parent of this frame or NULL if this is the main (top-level) 10413 /// frame. 10414 /// 10415 extern(System) cef_frame_t* function (cef_frame_t* self) nothrow get_parent; 10416 10417 /// 10418 /// Returns the URL currently loaded in this frame. 10419 /// 10420 // The resulting string must be freed by calling cef_string_userfree_free(). 10421 extern(System) cef_string_userfree_t function (cef_frame_t* self) nothrow get_url; 10422 10423 /// 10424 /// Returns the browser that this frame belongs to. 10425 /// 10426 extern(System) cef_browser_t* function (cef_frame_t* self) nothrow get_browser; 10427 10428 /// 10429 /// Get the V8 context associated with the frame. This function can only be 10430 /// called from the render process. 10431 /// 10432 extern(System) cef_v8context_t* function (cef_frame_t* self) nothrow get_v8context; 10433 10434 /// 10435 /// Visit the DOM document. This function can only be called from the render 10436 /// process. 10437 /// 10438 extern(System) void function (cef_frame_t* self, cef_domvisitor_t* visitor) nothrow visit_dom; 10439 10440 /// 10441 /// Create a new URL request that will be treated as originating from this 10442 /// frame and the associated browser. This request may be intercepted by the 10443 /// client via cef_resource_request_handler_t or cef_scheme_handler_factory_t. 10444 /// Use cef_urlrequest_t::Create instead if you do not want the request to 10445 /// have this association, in which case it may be handled differently (see 10446 /// documentation on that function). Requests may originate from both the 10447 /// browser process and the render process. 10448 /// 10449 /// For requests originating from the browser process: 10450 /// - POST data may only contain a single element of type PDE_TYPE_FILE or 10451 /// PDE_TYPE_BYTES. 10452 /// 10453 /// For requests originating from the render process: 10454 /// - POST data may only contain a single element of type PDE_TYPE_BYTES. 10455 /// - If the response contains Content-Disposition or Mime-Type header 10456 /// values that would not normally be rendered then the response may 10457 /// receive special handling inside the browser (for example, via the 10458 /// file download code path instead of the URL request code path). 10459 /// 10460 /// The |request| object will be marked as read-only after calling this 10461 /// function. 10462 /// 10463 extern(System) cef_urlrequest_t* function ( 10464 cef_frame_t* self, 10465 cef_request_t* request, 10466 cef_urlrequest_client_t* client) nothrow create_urlrequest; 10467 10468 /// 10469 /// Send a message to the specified |target_process|. Ownership of the message 10470 /// contents will be transferred and the |message| reference will be 10471 /// invalidated. Message delivery is not guaranteed in all cases (for example, 10472 /// if the browser is closing, navigating, or if the target process crashes). 10473 /// Send an ACK message back from the target process if confirmation is 10474 /// required. 10475 /// 10476 extern(System) void function ( 10477 cef_frame_t* self, 10478 cef_process_id_t target_process, 10479 cef_process_message_t* message) nothrow send_process_message; 10480 } 10481 10482 10483 10484 // CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_ 10485 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 10486 // 10487 // Redistribution and use in source and binary forms, with or without 10488 // modification, are permitted provided that the following conditions are 10489 // met: 10490 // 10491 // * Redistributions of source code must retain the above copyright 10492 // notice, this list of conditions and the following disclaimer. 10493 // * Redistributions in binary form must reproduce the above 10494 // copyright notice, this list of conditions and the following disclaimer 10495 // in the documentation and/or other materials provided with the 10496 // distribution. 10497 // * Neither the name of Google Inc. nor the name Chromium Embedded 10498 // Framework nor the names of its contributors may be used to endorse 10499 // or promote products derived from this software without specific prior 10500 // written permission. 10501 // 10502 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 10503 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 10504 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 10505 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 10506 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 10507 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 10508 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 10509 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 10510 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 10511 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 10512 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 10513 // 10514 // --------------------------------------------------------------------------- 10515 // 10516 // This file was generated by the CEF translator tool and should not edited 10517 // by hand. See the translator.README.txt file in the tools directory for 10518 // more information. 10519 // 10520 // $hash=3d97135fef535cc94aca6cf1afa4a9461c388b4f$ 10521 // 10522 10523 extern (C): 10524 10525 /// 10526 /// Implement this structure to handle events related to cef_frame_t life span. 10527 /// The order of callbacks is: 10528 /// 10529 /// (1) During initial cef_browser_host_t creation and navigation of the main 10530 /// frame: - cef_frame_handler_t::OnFrameCreated => The initial main frame 10531 /// object has been 10532 /// created. Any commands will be queued until the frame is attached. 10533 /// - cef_frame_handler_t::OnMainFrameChanged => The initial main frame object 10534 /// has 10535 /// been assigned to the browser. 10536 /// - cef_life_span_handler_t::OnAfterCreated => The browser is now valid and 10537 /// can be 10538 /// used. 10539 /// - cef_frame_handler_t::OnFrameAttached => The initial main frame object is 10540 /// now 10541 /// connected to its peer in the renderer process. Commands can be routed. 10542 /// 10543 /// (2) During further cef_browser_host_t navigation/loading of the main frame 10544 /// and/or sub-frames: 10545 /// - cef_frame_handler_t::OnFrameCreated => A new main frame or sub-frame 10546 /// object 10547 /// has been created. Any commands will be queued until the frame is attached. 10548 /// - cef_frame_handler_t::OnFrameAttached => A new main frame or sub-frame 10549 /// object 10550 /// is now connected to its peer in the renderer process. Commands can be 10551 /// routed. 10552 /// - cef_frame_handler_t::OnFrameDetached => An existing main frame or sub- 10553 /// frame 10554 /// object has lost its connection to the renderer process. If multiple 10555 /// objects are detached at the same time then notifications will be sent for 10556 /// any sub-frame objects before the main frame object. Commands can no longer 10557 /// be routed and will be discarded. 10558 /// - cef_frame_handler_t::OnMainFrameChanged => A new main frame object has 10559 /// been 10560 /// assigned to the browser. This will only occur with cross-origin navigation 10561 /// or re-navigation after renderer process termination (due to crashes, etc). 10562 /// 10563 /// (3) During final cef_browser_host_t destruction of the main frame: - 10564 /// cef_frame_handler_t::OnFrameDetached => Any sub-frame objects have lost 10565 /// their 10566 /// connection to the renderer process. Commands can no longer be routed and 10567 /// will be discarded. 10568 /// - cef_life_span_handler_t::OnBeforeClose => The browser has been destroyed. 10569 /// - cef_frame_handler_t::OnFrameDetached => The main frame object have lost 10570 /// its 10571 /// connection to the renderer process. Notifications will be sent for any 10572 /// sub-frame objects before the main frame object. Commands can no longer be 10573 /// routed and will be discarded. 10574 /// - cef_frame_handler_t::OnMainFrameChanged => The final main frame object has 10575 /// been removed from the browser. 10576 /// 10577 /// Cross-origin navigation and/or loading receives special handling. 10578 /// 10579 /// When the main frame navigates to a different origin the OnMainFrameChanged 10580 /// callback (2) will be executed with the old and new main frame objects. 10581 /// 10582 /// When a new sub-frame is loaded in, or an existing sub-frame is navigated to, 10583 /// a different origin from the parent frame, a temporary sub-frame object will 10584 /// first be created in the parent's renderer process. That temporary sub-frame 10585 /// will then be discarded after the real cross-origin sub-frame is created in 10586 /// the new/target renderer process. The client will receive cross-origin 10587 /// navigation callbacks (2) for the transition from the temporary sub-frame to 10588 /// the real sub-frame. The temporary sub-frame will not recieve or execute 10589 /// commands during this transitional period (any sent commands will be 10590 /// discarded). 10591 /// 10592 /// When a new popup browser is created in a different origin from the parent 10593 /// browser, a temporary main frame object for the popup will first be created 10594 /// in the parent's renderer process. That temporary main frame will then be 10595 /// discarded after the real cross-origin main frame is created in the 10596 /// new/target renderer process. The client will recieve creation and initial 10597 /// navigation callbacks (1) for the temporary main frame, followed by cross- 10598 /// origin navigation callbacks (2) for the transition from the temporary main 10599 /// frame to the real main frame. The temporary main frame may receive and 10600 /// execute commands during this transitional period (any sent commands may be 10601 /// executed, but the behavior is potentially undesirable since they execute in 10602 /// the parent browser's renderer process and not the new/target renderer 10603 /// process). 10604 /// 10605 /// Callbacks will not be executed for placeholders that may be created during 10606 /// pre-commit navigation for sub-frames that do not yet exist in the renderer 10607 /// process. Placeholders will have cef_frame_t::get_identifier() == -4. 10608 /// 10609 /// The functions of this structure will be called on the UI thread unless 10610 /// otherwise indicated. 10611 /// 10612 struct cef_frame_handler_t 10613 { 10614 /// 10615 /// Base structure. 10616 /// 10617 cef_base_ref_counted_t base; 10618 10619 /// 10620 /// Called when a new frame is created. This will be the first notification 10621 /// that references |frame|. Any commands that require transport to the 10622 /// associated renderer process (LoadRequest, SendProcessMessage, GetSource, 10623 /// etc.) will be queued until OnFrameAttached is called for |frame|. 10624 /// 10625 extern(System) void function ( 10626 cef_frame_handler_t* self, 10627 cef_browser_t* browser, 10628 cef_frame_t* frame) nothrow on_frame_created; 10629 10630 /// 10631 /// Called when a frame can begin routing commands to/from the associated 10632 /// renderer process. |reattached| will be true (1) if the frame was re- 10633 /// attached after exiting the BackForwardCache. Any commands that were queued 10634 /// have now been dispatched. 10635 /// 10636 extern(System) void function ( 10637 cef_frame_handler_t* self, 10638 cef_browser_t* browser, 10639 cef_frame_t* frame, 10640 int reattached) nothrow on_frame_attached; 10641 10642 /// 10643 /// Called when a frame loses its connection to the renderer process and will 10644 /// be destroyed. Any pending or future commands will be discarded and 10645 /// cef_frame_t::is_valid() will now return false (0) for |frame|. If called 10646 /// after cef_life_span_handler_t::on_before_close() during browser 10647 /// destruction then cef_browser_t::is_valid() will return false (0) for 10648 /// |browser|. 10649 /// 10650 extern(System) void function ( 10651 cef_frame_handler_t* self, 10652 cef_browser_t* browser, 10653 cef_frame_t* frame) nothrow on_frame_detached; 10654 10655 /// 10656 /// Called when the main frame changes due to (a) initial browser creation, 10657 /// (b) final browser destruction, (c) cross-origin navigation or (d) re- 10658 /// navigation after renderer process termination (due to crashes, etc). 10659 /// |old_frame| will be NULL and |new_frame| will be non-NULL when a main 10660 /// frame is assigned to |browser| for the first time. |old_frame| will be 10661 /// non-NULL and |new_frame| will be NULL and when a main frame is removed 10662 /// from |browser| for the last time. Both |old_frame| and |new_frame| will be 10663 /// non-NULL for cross-origin navigations or re-navigation after renderer 10664 /// process termination. This function will be called after on_frame_created() 10665 /// for |new_frame| and/or after on_frame_detached() for |old_frame|. If 10666 /// called after cef_life_span_handler_t::on_before_close() during browser 10667 /// destruction then cef_browser_t::is_valid() will return false (0) for 10668 /// |browser|. 10669 /// 10670 extern(System) void function ( 10671 cef_frame_handler_t* self, 10672 cef_browser_t* browser, 10673 cef_frame_t* old_frame, 10674 cef_frame_t* new_frame) nothrow on_main_frame_changed; 10675 } 10676 10677 10678 10679 // CEF_INCLUDE_CAPI_CEF_FRAME_HANDLER_CAPI_H_ 10680 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 10681 // 10682 // Redistribution and use in source and binary forms, with or without 10683 // modification, are permitted provided that the following conditions are 10684 // met: 10685 // 10686 // * Redistributions of source code must retain the above copyright 10687 // notice, this list of conditions and the following disclaimer. 10688 // * Redistributions in binary form must reproduce the above 10689 // copyright notice, this list of conditions and the following disclaimer 10690 // in the documentation and/or other materials provided with the 10691 // distribution. 10692 // * Neither the name of Google Inc. nor the name Chromium Embedded 10693 // Framework nor the names of its contributors may be used to endorse 10694 // or promote products derived from this software without specific prior 10695 // written permission. 10696 // 10697 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 10698 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 10699 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 10700 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 10701 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 10702 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 10703 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 10704 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 10705 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 10706 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 10707 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 10708 // 10709 // --------------------------------------------------------------------------- 10710 // 10711 // This file was generated by the CEF translator tool and should not edited 10712 // by hand. See the translator.README.txt file in the tools directory for 10713 // more information. 10714 // 10715 // $hash=14f7f979f668fdae0f080daa39f3c1b2e92162f9$ 10716 // 10717 10718 extern (C): 10719 10720 /// 10721 /// Returns true (1) if the application text direction is right-to-left. 10722 /// 10723 int cef_is_rtl (); 10724 10725 // CEF_INCLUDE_CAPI_CEF_I18N_UTIL_CAPI_H_ 10726 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 10727 // 10728 // Redistribution and use in source and binary forms, with or without 10729 // modification, are permitted provided that the following conditions are 10730 // met: 10731 // 10732 // * Redistributions of source code must retain the above copyright 10733 // notice, this list of conditions and the following disclaimer. 10734 // * Redistributions in binary form must reproduce the above 10735 // copyright notice, this list of conditions and the following disclaimer 10736 // in the documentation and/or other materials provided with the 10737 // distribution. 10738 // * Neither the name of Google Inc. nor the name Chromium Embedded 10739 // Framework nor the names of its contributors may be used to endorse 10740 // or promote products derived from this software without specific prior 10741 // written permission. 10742 // 10743 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 10744 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 10745 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 10746 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 10747 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 10748 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 10749 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 10750 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 10751 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 10752 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 10753 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 10754 // 10755 // --------------------------------------------------------------------------- 10756 // 10757 // This file was generated by the CEF translator tool and should not edited 10758 // by hand. See the translator.README.txt file in the tools directory for 10759 // more information. 10760 // 10761 // $hash=f679dc1ec87e99bed6843d4f4dbbe04585a827bd$ 10762 // 10763 10764 extern (C): 10765 10766 /// 10767 /// Container for a single image represented at different scale factors. All 10768 /// image representations should be the same size in density independent pixel 10769 /// (DIP) units. For example, if the image at scale factor 1.0 is 100x100 pixels 10770 /// then the image at scale factor 2.0 should be 200x200 pixels -- both images 10771 /// will display with a DIP size of 100x100 units. The functions of this 10772 /// structure can be called on any browser process thread. 10773 /// 10774 struct cef_image_t 10775 { 10776 /// 10777 /// Base structure. 10778 /// 10779 cef_base_ref_counted_t base; 10780 10781 /// 10782 /// Returns true (1) if this Image is NULL. 10783 /// 10784 extern(System) int function (cef_image_t* self) nothrow is_empty; 10785 10786 /// 10787 /// Returns true (1) if this Image and |that| Image share the same underlying 10788 /// storage. Will also return true (1) if both images are NULL. 10789 /// 10790 extern(System) int function (cef_image_t* self, cef_image_t* that) nothrow is_same; 10791 10792 /// 10793 /// Add a bitmap image representation for |scale_factor|. Only 32-bit 10794 /// RGBA/BGRA formats are supported. |pixel_width| and |pixel_height| are the 10795 /// bitmap representation size in pixel coordinates. |pixel_data| is the array 10796 /// of pixel data and should be |pixel_width| x |pixel_height| x 4 bytes in 10797 /// size. |color_type| and |alpha_type| values specify the pixel format. 10798 /// 10799 extern(System) int function ( 10800 cef_image_t* self, 10801 float scale_factor, 10802 int pixel_width, 10803 int pixel_height, 10804 cef_color_type_t color_type, 10805 cef_alpha_type_t alpha_type, 10806 const(void)* pixel_data, 10807 size_t pixel_data_size) nothrow add_bitmap; 10808 10809 /// 10810 /// Add a PNG image representation for |scale_factor|. |png_data| is the image 10811 /// data of size |png_data_size|. Any alpha transparency in the PNG data will 10812 /// be maintained. 10813 /// 10814 extern(System) int function ( 10815 cef_image_t* self, 10816 float scale_factor, 10817 const(void)* png_data, 10818 size_t png_data_size) nothrow add_png; 10819 10820 /// 10821 /// Create a JPEG image representation for |scale_factor|. |jpeg_data| is the 10822 /// image data of size |jpeg_data_size|. The JPEG format does not support 10823 /// transparency so the alpha byte will be set to 0xFF for all pixels. 10824 /// 10825 extern(System) int function ( 10826 cef_image_t* self, 10827 float scale_factor, 10828 const(void)* jpeg_data, 10829 size_t jpeg_data_size) nothrow add_jpeg; 10830 10831 /// 10832 /// Returns the image width in density independent pixel (DIP) units. 10833 /// 10834 extern(System) size_t function (cef_image_t* self) nothrow get_width; 10835 10836 /// 10837 /// Returns the image height in density independent pixel (DIP) units. 10838 /// 10839 extern(System) size_t function (cef_image_t* self) nothrow get_height; 10840 10841 /// 10842 /// Returns true (1) if this image contains a representation for 10843 /// |scale_factor|. 10844 /// 10845 extern(System) int function (cef_image_t* self, float scale_factor) nothrow has_representation; 10846 10847 /// 10848 /// Removes the representation for |scale_factor|. Returns true (1) on 10849 /// success. 10850 /// 10851 extern(System) int function ( 10852 cef_image_t* self, 10853 float scale_factor) nothrow remove_representation; 10854 10855 /// 10856 /// Returns information for the representation that most closely matches 10857 /// |scale_factor|. |actual_scale_factor| is the actual scale factor for the 10858 /// representation. |pixel_width| and |pixel_height| are the representation 10859 /// size in pixel coordinates. Returns true (1) on success. 10860 /// 10861 extern(System) int function ( 10862 cef_image_t* self, 10863 float scale_factor, 10864 float* actual_scale_factor, 10865 int* pixel_width, 10866 int* pixel_height) nothrow get_representation_info; 10867 10868 /// 10869 /// Returns the bitmap representation that most closely matches 10870 /// |scale_factor|. Only 32-bit RGBA/BGRA formats are supported. |color_type| 10871 /// and |alpha_type| values specify the desired output pixel format. 10872 /// |pixel_width| and |pixel_height| are the output representation size in 10873 /// pixel coordinates. Returns a cef_binary_value_t containing the pixel data 10874 /// on success or NULL on failure. 10875 /// 10876 extern(System) cef_binary_value_t* function ( 10877 cef_image_t* self, 10878 float scale_factor, 10879 cef_color_type_t color_type, 10880 cef_alpha_type_t alpha_type, 10881 int* pixel_width, 10882 int* pixel_height) nothrow get_as_bitmap; 10883 10884 /// 10885 /// Returns the PNG representation that most closely matches |scale_factor|. 10886 /// If |with_transparency| is true (1) any alpha transparency in the image 10887 /// will be represented in the resulting PNG data. |pixel_width| and 10888 /// |pixel_height| are the output representation size in pixel coordinates. 10889 /// Returns a cef_binary_value_t containing the PNG image data on success or 10890 /// NULL on failure. 10891 /// 10892 extern(System) cef_binary_value_t* function ( 10893 cef_image_t* self, 10894 float scale_factor, 10895 int with_transparency, 10896 int* pixel_width, 10897 int* pixel_height) nothrow get_as_png; 10898 10899 /// 10900 /// Returns the JPEG representation that most closely matches |scale_factor|. 10901 /// |quality| determines the compression level with 0 == lowest and 100 == 10902 /// highest. The JPEG format does not support alpha transparency and the alpha 10903 /// channel, if any, will be discarded. |pixel_width| and |pixel_height| are 10904 /// the output representation size in pixel coordinates. Returns a 10905 /// cef_binary_value_t containing the JPEG image data on success or NULL on 10906 /// failure. 10907 /// 10908 extern(System) cef_binary_value_t* function ( 10909 cef_image_t* self, 10910 float scale_factor, 10911 int quality, 10912 int* pixel_width, 10913 int* pixel_height) nothrow get_as_jpeg; 10914 } 10915 10916 10917 10918 /// 10919 /// Create a new cef_image_t. It will initially be NULL. Use the Add*() 10920 /// functions to add representations at different scale factors. 10921 /// 10922 cef_image_t* cef_image_create (); 10923 10924 // CEF_INCLUDE_CAPI_CEF_IMAGE_CAPI_H_ 10925 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 10926 // 10927 // Redistribution and use in source and binary forms, with or without 10928 // modification, are permitted provided that the following conditions are 10929 // met: 10930 // 10931 // * Redistributions of source code must retain the above copyright 10932 // notice, this list of conditions and the following disclaimer. 10933 // * Redistributions in binary form must reproduce the above 10934 // copyright notice, this list of conditions and the following disclaimer 10935 // in the documentation and/or other materials provided with the 10936 // distribution. 10937 // * Neither the name of Google Inc. nor the name Chromium Embedded 10938 // Framework nor the names of its contributors may be used to endorse 10939 // or promote products derived from this software without specific prior 10940 // written permission. 10941 // 10942 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 10943 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 10944 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 10945 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 10946 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 10947 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 10948 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 10949 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 10950 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 10951 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 10952 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 10953 // 10954 // --------------------------------------------------------------------------- 10955 // 10956 // This file was generated by the CEF translator tool and should not edited 10957 // by hand. See the translator.README.txt file in the tools directory for 10958 // more information. 10959 // 10960 // $hash=523a692475e912e4ecad89842596c3d6eac6f4aa$ 10961 // 10962 10963 extern (C): 10964 10965 /// 10966 /// Callback structure used for asynchronous continuation of JavaScript dialog 10967 /// requests. 10968 /// 10969 struct cef_jsdialog_callback_t 10970 { 10971 /// 10972 /// Base structure. 10973 /// 10974 cef_base_ref_counted_t base; 10975 10976 /// 10977 /// Continue the JS dialog request. Set |success| to true (1) if the OK button 10978 /// was pressed. The |user_input| value should be specified for prompt 10979 /// dialogs. 10980 /// 10981 extern(System) void function ( 10982 cef_jsdialog_callback_t* self, 10983 int success, 10984 const(cef_string_t)* user_input) nothrow cont; 10985 } 10986 10987 10988 10989 /// 10990 /// Implement this structure to handle events related to JavaScript dialogs. The 10991 /// functions of this structure will be called on the UI thread. 10992 /// 10993 struct cef_jsdialog_handler_t 10994 { 10995 /// 10996 /// Base structure. 10997 /// 10998 cef_base_ref_counted_t base; 10999 11000 /// 11001 /// Called to run a JavaScript dialog. If |origin_url| is non-NULL it can be 11002 /// passed to the CefFormatUrlForSecurityDisplay function to retrieve a secure 11003 /// and user-friendly display string. The |default_prompt_text| value will be 11004 /// specified for prompt dialogs only. Set |suppress_message| to true (1) and 11005 /// return false (0) to suppress the message (suppressing messages is 11006 /// preferable to immediately executing the callback as this is used to detect 11007 /// presumably malicious behavior like spamming alert messages in 11008 /// onbeforeunload). Set |suppress_message| to false (0) and return false (0) 11009 /// to use the default implementation (the default implementation will show 11010 /// one modal dialog at a time and suppress any additional dialog requests 11011 /// until the displayed dialog is dismissed). Return true (1) if the 11012 /// application will use a custom dialog or if the callback has been executed 11013 /// immediately. Custom dialogs may be either modal or modeless. If a custom 11014 /// dialog is used the application must execute |callback| once the custom 11015 /// dialog is dismissed. 11016 /// 11017 extern(System) int function ( 11018 cef_jsdialog_handler_t* self, 11019 cef_browser_t* browser, 11020 const(cef_string_t)* origin_url, 11021 cef_jsdialog_type_t dialog_type, 11022 const(cef_string_t)* message_text, 11023 const(cef_string_t)* default_prompt_text, 11024 cef_jsdialog_callback_t* callback, 11025 int* suppress_message) nothrow on_jsdialog; 11026 11027 /// 11028 /// Called to run a dialog asking the user if they want to leave a page. 11029 /// Return false (0) to use the default dialog implementation. Return true (1) 11030 /// if the application will use a custom dialog or if the callback has been 11031 /// executed immediately. Custom dialogs may be either modal or modeless. If a 11032 /// custom dialog is used the application must execute |callback| once the 11033 /// custom dialog is dismissed. 11034 /// 11035 extern(System) int function ( 11036 cef_jsdialog_handler_t* self, 11037 cef_browser_t* browser, 11038 const(cef_string_t)* message_text, 11039 int is_reload, 11040 cef_jsdialog_callback_t* callback) nothrow on_before_unload_dialog; 11041 11042 /// 11043 /// Called to cancel any pending dialogs and reset any saved dialog state. 11044 /// Will be called due to events like page navigation irregardless of whether 11045 /// any dialogs are currently pending. 11046 /// 11047 extern(System) void function ( 11048 cef_jsdialog_handler_t* self, 11049 cef_browser_t* browser) nothrow on_reset_dialog_state; 11050 11051 /// 11052 /// Called when the dialog is closed. 11053 /// 11054 extern(System) void function ( 11055 cef_jsdialog_handler_t* self, 11056 cef_browser_t* browser) nothrow on_dialog_closed; 11057 } 11058 11059 11060 11061 // CEF_INCLUDE_CAPI_CEF_JSDIALOG_HANDLER_CAPI_H_ 11062 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 11063 // 11064 // Redistribution and use in source and binary forms, with or without 11065 // modification, are permitted provided that the following conditions are 11066 // met: 11067 // 11068 // * Redistributions of source code must retain the above copyright 11069 // notice, this list of conditions and the following disclaimer. 11070 // * Redistributions in binary form must reproduce the above 11071 // copyright notice, this list of conditions and the following disclaimer 11072 // in the documentation and/or other materials provided with the 11073 // distribution. 11074 // * Neither the name of Google Inc. nor the name Chromium Embedded 11075 // Framework nor the names of its contributors may be used to endorse 11076 // or promote products derived from this software without specific prior 11077 // written permission. 11078 // 11079 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 11080 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 11081 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 11082 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 11083 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 11084 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 11085 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 11086 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 11087 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 11088 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 11089 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11090 // 11091 // --------------------------------------------------------------------------- 11092 // 11093 // This file was generated by the CEF translator tool and should not edited 11094 // by hand. See the translator.README.txt file in the tools directory for 11095 // more information. 11096 // 11097 // $hash=01d7f86c1304efe8dc8758624b74bafccf159e96$ 11098 // 11099 11100 extern (C): 11101 11102 /// 11103 /// Implement this structure to handle events related to keyboard input. The 11104 /// functions of this structure will be called on the UI thread. 11105 /// 11106 struct cef_keyboard_handler_t 11107 { 11108 /// 11109 /// Base structure. 11110 /// 11111 cef_base_ref_counted_t base; 11112 11113 /// 11114 /// Called before a keyboard event is sent to the renderer. |event| contains 11115 /// information about the keyboard event. |os_event| is the operating system 11116 /// event message, if any. Return true (1) if the event was handled or false 11117 /// (0) otherwise. If the event will be handled in on_key_event() as a 11118 /// keyboard shortcut set |is_keyboard_shortcut| to true (1) and return false 11119 /// (0). 11120 /// 11121 extern(System) int function ( 11122 cef_keyboard_handler_t* self, 11123 cef_browser_t* browser, 11124 const(cef_key_event_t)* event, 11125 XEvent* os_event, 11126 int* is_keyboard_shortcut) nothrow on_pre_key_event; 11127 11128 /// 11129 /// Called after the renderer and JavaScript in the page has had a chance to 11130 /// handle the event. |event| contains information about the keyboard event. 11131 /// |os_event| is the operating system event message, if any. Return true (1) 11132 /// if the keyboard event was handled or false (0) otherwise. 11133 /// 11134 extern(System) int function ( 11135 cef_keyboard_handler_t* self, 11136 cef_browser_t* browser, 11137 const(cef_key_event_t)* event, 11138 XEvent* os_event) nothrow on_key_event; 11139 } 11140 11141 11142 11143 // CEF_INCLUDE_CAPI_CEF_KEYBOARD_HANDLER_CAPI_H_ 11144 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 11145 // 11146 // Redistribution and use in source and binary forms, with or without 11147 // modification, are permitted provided that the following conditions are 11148 // met: 11149 // 11150 // * Redistributions of source code must retain the above copyright 11151 // notice, this list of conditions and the following disclaimer. 11152 // * Redistributions in binary form must reproduce the above 11153 // copyright notice, this list of conditions and the following disclaimer 11154 // in the documentation and/or other materials provided with the 11155 // distribution. 11156 // * Neither the name of Google Inc. nor the name Chromium Embedded 11157 // Framework nor the names of its contributors may be used to endorse 11158 // or promote products derived from this software without specific prior 11159 // written permission. 11160 // 11161 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 11162 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 11163 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 11164 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 11165 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 11166 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 11167 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 11168 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 11169 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 11170 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 11171 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11172 // 11173 // --------------------------------------------------------------------------- 11174 // 11175 // This file was generated by the CEF translator tool and should not edited 11176 // by hand. See the translator.README.txt file in the tools directory for 11177 // more information. 11178 // 11179 // $hash=44555ceece9989dabfa57a520168fa874dcfe2df$ 11180 // 11181 11182 extern (C): 11183 11184 11185 11186 /// 11187 /// Implement this structure to handle events related to browser life span. The 11188 /// functions of this structure will be called on the UI thread unless otherwise 11189 /// indicated. 11190 /// 11191 struct cef_life_span_handler_t 11192 { 11193 /// 11194 /// Base structure. 11195 /// 11196 cef_base_ref_counted_t base; 11197 11198 /// 11199 /// Called on the UI thread before a new popup browser is created. The 11200 /// |browser| and |frame| values represent the source of the popup request. 11201 /// The |target_url| and |target_frame_name| values indicate where the popup 11202 /// browser should navigate and may be NULL if not specified with the request. 11203 /// The |target_disposition| value indicates where the user intended to open 11204 /// the popup (e.g. current tab, new tab, etc). The |user_gesture| value will 11205 /// be true (1) if the popup was opened via explicit user gesture (e.g. 11206 /// clicking a link) or false (0) if the popup opened automatically (e.g. via 11207 /// the DomContentLoaded event). The |popupFeatures| structure contains 11208 /// additional information about the requested popup window. To allow creation 11209 /// of the popup browser optionally modify |windowInfo|, |client|, |settings| 11210 /// and |no_javascript_access| and return false (0). To cancel creation of the 11211 /// popup browser return true (1). The |client| and |settings| values will 11212 /// default to the source browser's values. If the |no_javascript_access| 11213 /// value is set to false (0) the new browser will not be scriptable and may 11214 /// not be hosted in the same renderer process as the source browser. Any 11215 /// modifications to |windowInfo| will be ignored if the parent browser is 11216 /// wrapped in a cef_browser_view_t. Popup browser creation will be canceled 11217 /// if the parent browser is destroyed before the popup browser creation 11218 /// completes (indicated by a call to OnAfterCreated for the popup browser). 11219 /// The |extra_info| parameter provides an opportunity to specify extra 11220 /// information specific to the created popup browser that will be passed to 11221 /// cef_render_process_handler_t::on_browser_created() in the render process. 11222 /// 11223 extern(System) int function ( 11224 cef_life_span_handler_t* self, 11225 cef_browser_t* browser, 11226 cef_frame_t* frame, 11227 const(cef_string_t)* target_url, 11228 const(cef_string_t)* target_frame_name, 11229 cef_window_open_disposition_t target_disposition, 11230 int user_gesture, 11231 const(cef_popup_features_t)* popupFeatures, 11232 cef_window_info_t* windowInfo, 11233 cef_client_t** client, 11234 cef_browser_settings_t* settings, 11235 cef_dictionary_value_t** extra_info, 11236 int* no_javascript_access) nothrow on_before_popup; 11237 11238 /// 11239 /// Called after a new browser is created. It is now safe to begin performing 11240 /// actions with |browser|. cef_frame_handler_t callbacks related to initial 11241 /// main frame creation will arrive before this callback. See 11242 /// cef_frame_handler_t documentation for additional usage information. 11243 /// 11244 extern(System) void function ( 11245 cef_life_span_handler_t* self, 11246 cef_browser_t* browser) nothrow on_after_created; 11247 11248 /// 11249 /// Called when a browser has recieved a request to close. This may result 11250 /// directly from a call to cef_browser_host_t::*close_browser() or indirectly 11251 /// if the browser is parented to a top-level window created by CEF and the 11252 /// user attempts to close that window (by clicking the 'X', for example). The 11253 /// do_close() function will be called after the JavaScript 'onunload' event 11254 /// has been fired. 11255 /// 11256 /// An application should handle top-level owner window close notifications by 11257 /// calling cef_browser_host_t::try_close_browser() or 11258 /// cef_browser_host_t::CloseBrowser(false (0)) instead of allowing the window 11259 /// to close immediately (see the examples below). This gives CEF an 11260 /// opportunity to process the 'onbeforeunload' event and optionally cancel 11261 /// the close before do_close() is called. 11262 /// 11263 /// When windowed rendering is enabled CEF will internally create a window or 11264 /// view to host the browser. In that case returning false (0) from do_close() 11265 /// will send the standard close notification to the browser's top-level owner 11266 /// window (e.g. WM_CLOSE on Windows, performClose: on OS X, "delete_event" on 11267 /// Linux or cef_window_delegate_t::can_close() callback from Views). If the 11268 /// browser's host window/view has already been destroyed (via view hierarchy 11269 /// tear-down, for example) then do_close() will not be called for that 11270 /// browser since is no longer possible to cancel the close. 11271 /// 11272 /// When windowed rendering is disabled returning false (0) from do_close() 11273 /// will cause the browser object to be destroyed immediately. 11274 /// 11275 /// If the browser's top-level owner window requires a non-standard close 11276 /// notification then send that notification from do_close() and return true 11277 /// (1). 11278 /// 11279 /// The cef_life_span_handler_t::on_before_close() function will be called 11280 /// after do_close() (if do_close() is called) and immediately before the 11281 /// browser object is destroyed. The application should only exit after 11282 /// on_before_close() has been called for all existing browsers. 11283 /// 11284 /// The below examples describe what should happen during window close when 11285 /// the browser is parented to an application-provided top-level window. 11286 /// 11287 /// Example 1: Using cef_browser_host_t::try_close_browser(). This is 11288 /// recommended for clients using standard close handling and windows created 11289 /// on the browser process UI thread. 1. User clicks the window close button 11290 /// which sends a close notification 11291 /// to the application's top-level window. 11292 /// 2. Application's top-level window receives the close notification and 11293 /// calls TryCloseBrowser() (which internally calls CloseBrowser(false)). 11294 /// TryCloseBrowser() returns false so the client cancels the window 11295 /// close. 11296 /// 3. JavaScript 'onbeforeunload' handler executes and shows the close 11297 /// confirmation dialog (which can be overridden via 11298 /// CefJSDialogHandler::OnBeforeUnloadDialog()). 11299 /// 4. User approves the close. 5. JavaScript 'onunload' handler executes. 11300 /// 6. CEF sends a close notification to the application's top-level window 11301 /// (because DoClose() returned false by default). 11302 /// 7. Application's top-level window receives the close notification and 11303 /// calls TryCloseBrowser(). TryCloseBrowser() returns true so the client 11304 /// allows the window close. 11305 /// 8. Application's top-level window is destroyed. 9. Application's 11306 /// on_before_close() handler is called and the browser object 11307 /// is destroyed. 11308 /// 10. Application exits by calling cef_quit_message_loop() if no other 11309 /// browsers 11310 /// exist. 11311 /// 11312 /// Example 2: Using cef_browser_host_t::CloseBrowser(false (0)) and 11313 /// implementing the do_close() callback. This is recommended for clients 11314 /// using non-standard close handling or windows that were not created on the 11315 /// browser process UI thread. 1. User clicks the window close button which 11316 /// sends a close notification 11317 /// to the application's top-level window. 11318 /// 2. Application's top-level window receives the close notification and: 11319 /// A. Calls CefBrowserHost::CloseBrowser(false). 11320 /// B. Cancels the window close. 11321 /// 3. JavaScript 'onbeforeunload' handler executes and shows the close 11322 /// confirmation dialog (which can be overridden via 11323 /// CefJSDialogHandler::OnBeforeUnloadDialog()). 11324 /// 4. User approves the close. 5. JavaScript 'onunload' handler executes. 11325 /// 6. Application's do_close() handler is called. Application will: 11326 /// A. Set a flag to indicate that the next close attempt will be allowed. 11327 /// B. Return false. 11328 /// 7. CEF sends an close notification to the application's top-level window. 11329 /// 8. Application's top-level window receives the close notification and 11330 /// allows the window to close based on the flag from #6B. 11331 /// 9. Application's top-level window is destroyed. 10. Application's 11332 /// on_before_close() handler is called and the browser object 11333 /// is destroyed. 11334 /// 11. Application exits by calling cef_quit_message_loop() if no other 11335 /// browsers 11336 /// exist. 11337 /// 11338 extern(System) int function ( 11339 cef_life_span_handler_t* self, 11340 cef_browser_t* browser) nothrow do_close; 11341 11342 /// 11343 /// Called just before a browser is destroyed. Release all references to the 11344 /// browser object and do not attempt to execute any functions on the browser 11345 /// object (other than IsValid, GetIdentifier or IsSame) after this callback 11346 /// returns. cef_frame_handler_t callbacks related to final main frame 11347 /// destruction will arrive after this callback and cef_browser_t::IsValid 11348 /// will return false (0) at that time. Any in-progress network requests 11349 /// associated with |browser| will be aborted when the browser is destroyed, 11350 /// and cef_resource_request_handler_t callbacks related to those requests may 11351 /// still arrive on the IO thread after this callback. See cef_frame_handler_t 11352 /// and do_close() documentation for additional usage information. 11353 /// 11354 extern(System) void function ( 11355 cef_life_span_handler_t* self, 11356 cef_browser_t* browser) nothrow on_before_close; 11357 } 11358 11359 11360 11361 // CEF_INCLUDE_CAPI_CEF_LIFE_SPAN_HANDLER_CAPI_H_ 11362 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 11363 // 11364 // Redistribution and use in source and binary forms, with or without 11365 // modification, are permitted provided that the following conditions are 11366 // met: 11367 // 11368 // * Redistributions of source code must retain the above copyright 11369 // notice, this list of conditions and the following disclaimer. 11370 // * Redistributions in binary form must reproduce the above 11371 // copyright notice, this list of conditions and the following disclaimer 11372 // in the documentation and/or other materials provided with the 11373 // distribution. 11374 // * Neither the name of Google Inc. nor the name Chromium Embedded 11375 // Framework nor the names of its contributors may be used to endorse 11376 // or promote products derived from this software without specific prior 11377 // written permission. 11378 // 11379 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 11380 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 11381 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 11382 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 11383 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 11384 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 11385 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 11386 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 11387 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 11388 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 11389 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11390 // 11391 // --------------------------------------------------------------------------- 11392 // 11393 // This file was generated by the CEF translator tool and should not edited 11394 // by hand. See the translator.README.txt file in the tools directory for 11395 // more information. 11396 // 11397 // $hash=2713381c9969d7039e6c1a1ed2527e5aeb5425ce$ 11398 // 11399 11400 extern (C): 11401 11402 /// 11403 /// Implement this structure to handle events related to browser load status. 11404 /// The functions of this structure will be called on the browser process UI 11405 /// thread or render process main thread (TID_RENDERER). 11406 /// 11407 struct cef_load_handler_t 11408 { 11409 /// 11410 /// Base structure. 11411 /// 11412 cef_base_ref_counted_t base; 11413 11414 /// 11415 /// Called when the loading state has changed. This callback will be executed 11416 /// twice -- once when loading is initiated either programmatically or by user 11417 /// action, and once when loading is terminated due to completion, 11418 /// cancellation of failure. It will be called before any calls to OnLoadStart 11419 /// and after all calls to OnLoadError and/or OnLoadEnd. 11420 /// 11421 extern(System) void function ( 11422 cef_load_handler_t* self, 11423 cef_browser_t* browser, 11424 int isLoading, 11425 int canGoBack, 11426 int canGoForward) nothrow on_loading_state_change; 11427 11428 /// 11429 /// Called after a navigation has been committed and before the browser begins 11430 /// loading contents in the frame. The |frame| value will never be NULL -- 11431 /// call the is_main() function to check if this frame is the main frame. 11432 /// |transition_type| provides information about the source of the navigation 11433 /// and an accurate value is only available in the browser process. Multiple 11434 /// frames may be loading at the same time. Sub-frames may start or continue 11435 /// loading after the main frame load has ended. This function will not be 11436 /// called for same page navigations (fragments, history state, etc.) or for 11437 /// navigations that fail or are canceled before commit. For notification of 11438 /// overall browser load status use OnLoadingStateChange instead. 11439 /// 11440 extern(System) void function ( 11441 cef_load_handler_t* self, 11442 cef_browser_t* browser, 11443 cef_frame_t* frame, 11444 cef_transition_type_t transition_type) nothrow on_load_start; 11445 11446 /// 11447 /// Called when the browser is done loading a frame. The |frame| value will 11448 /// never be NULL -- call the is_main() function to check if this frame is the 11449 /// main frame. Multiple frames may be loading at the same time. Sub-frames 11450 /// may start or continue loading after the main frame load has ended. This 11451 /// function will not be called for same page navigations (fragments, history 11452 /// state, etc.) or for navigations that fail or are canceled before commit. 11453 /// For notification of overall browser load status use OnLoadingStateChange 11454 /// instead. 11455 /// 11456 extern(System) void function ( 11457 cef_load_handler_t* self, 11458 cef_browser_t* browser, 11459 cef_frame_t* frame, 11460 int httpStatusCode) nothrow on_load_end; 11461 11462 /// 11463 /// Called when a navigation fails or is canceled. This function may be called 11464 /// by itself if before commit or in combination with OnLoadStart/OnLoadEnd if 11465 /// after commit. |errorCode| is the error code number, |errorText| is the 11466 /// error text and |failedUrl| is the URL that failed to load. See 11467 /// net\base\net_error_list.h for complete descriptions of the error codes. 11468 /// 11469 extern(System) void function ( 11470 cef_load_handler_t* self, 11471 cef_browser_t* browser, 11472 cef_frame_t* frame, 11473 cef_errorcode_t errorCode, 11474 const(cef_string_t)* errorText, 11475 const(cef_string_t)* failedUrl) nothrow on_load_error; 11476 } 11477 11478 11479 11480 // CEF_INCLUDE_CAPI_CEF_LOAD_HANDLER_CAPI_H_ 11481 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 11482 // 11483 // Redistribution and use in source and binary forms, with or without 11484 // modification, are permitted provided that the following conditions are 11485 // met: 11486 // 11487 // * Redistributions of source code must retain the above copyright 11488 // notice, this list of conditions and the following disclaimer. 11489 // * Redistributions in binary form must reproduce the above 11490 // copyright notice, this list of conditions and the following disclaimer 11491 // in the documentation and/or other materials provided with the 11492 // distribution. 11493 // * Neither the name of Google Inc. nor the name Chromium Embedded 11494 // Framework nor the names of its contributors may be used to endorse 11495 // or promote products derived from this software without specific prior 11496 // written permission. 11497 // 11498 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 11499 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 11500 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 11501 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 11502 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 11503 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 11504 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 11505 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 11506 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 11507 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 11508 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11509 // 11510 // --------------------------------------------------------------------------- 11511 // 11512 // This file was generated by the CEF translator tool and should not edited 11513 // by hand. See the translator.README.txt file in the tools directory for 11514 // more information. 11515 // 11516 // $hash=77920892e7d9e8b98106e0bc8dfcf4b4c52a24e6$ 11517 // 11518 11519 extern (C): 11520 11521 /// 11522 /// Supports discovery of and communication with media devices on the local 11523 /// network via the Cast and DIAL protocols. The functions of this structure may 11524 /// be called on any browser process thread unless otherwise indicated. 11525 /// 11526 struct cef_media_router_t 11527 { 11528 /// 11529 /// Base structure. 11530 /// 11531 cef_base_ref_counted_t base; 11532 11533 /// 11534 /// Add an observer for MediaRouter events. The observer will remain 11535 /// registered until the returned Registration object is destroyed. 11536 /// 11537 extern(System) cef_registration_t* function ( 11538 cef_media_router_t* self, 11539 cef_media_observer_t* observer) nothrow add_observer; 11540 11541 /// 11542 /// Returns a MediaSource object for the specified media source URN. Supported 11543 /// URN schemes include "cast:" and "dial:", and will be already known by the 11544 /// client application (e.g. "cast:<appId>?clientId=<clientId>"). 11545 /// 11546 extern(System) cef_media_source_t* function ( 11547 cef_media_router_t* self, 11548 const(cef_string_t)* urn) nothrow get_source; 11549 11550 /// 11551 /// Trigger an asynchronous call to cef_media_observer_t::OnSinks on all 11552 /// registered observers. 11553 /// 11554 extern(System) void function (cef_media_router_t* self) nothrow notify_current_sinks; 11555 11556 /// 11557 /// Create a new route between |source| and |sink|. Source and sink must be 11558 /// valid, compatible (as reported by cef_media_sink_t::IsCompatibleWith), and 11559 /// a route between them must not already exist. |callback| will be executed 11560 /// on success or failure. If route creation succeeds it will also trigger an 11561 /// asynchronous call to cef_media_observer_t::OnRoutes on all registered 11562 /// observers. 11563 /// 11564 extern(System) void function ( 11565 cef_media_router_t* self, 11566 cef_media_source_t* source, 11567 cef_media_sink_t* sink, 11568 cef_media_route_create_callback_t* callback) nothrow create_route; 11569 11570 /// 11571 /// Trigger an asynchronous call to cef_media_observer_t::OnRoutes on all 11572 /// registered observers. 11573 /// 11574 extern(System) void function (cef_media_router_t* self) nothrow notify_current_routes; 11575 } 11576 11577 11578 11579 /// 11580 /// Returns the MediaRouter object associated with the global request context. 11581 /// If |callback| is non-NULL it will be executed asnychronously on the UI 11582 /// thread after the manager's storage has been initialized. Equivalent to 11583 /// calling cef_request_context_t::cef_request_context_get_global_context()->get 11584 /// _media_router(). 11585 /// 11586 cef_media_router_t* cef_media_router_get_global ( 11587 cef_completion_callback_t* callback); 11588 11589 /// 11590 /// Implemented by the client to observe MediaRouter events and registered via 11591 /// cef_media_router_t::AddObserver. The functions of this structure will be 11592 /// called on the browser process UI thread. 11593 /// 11594 struct cef_media_observer_t 11595 { 11596 /// 11597 /// Base structure. 11598 /// 11599 cef_base_ref_counted_t base; 11600 11601 /// 11602 /// The list of available media sinks has changed or 11603 /// cef_media_router_t::NotifyCurrentSinks was called. 11604 /// 11605 extern(System) void function ( 11606 cef_media_observer_t* self, 11607 size_t sinksCount, 11608 cef_media_sink_t** sinks) nothrow on_sinks; 11609 11610 /// 11611 /// The list of available media routes has changed or 11612 /// cef_media_router_t::NotifyCurrentRoutes was called. 11613 /// 11614 extern(System) void function ( 11615 cef_media_observer_t* self, 11616 size_t routesCount, 11617 cef_media_route_t** routes) nothrow on_routes; 11618 11619 /// 11620 /// The connection state of |route| has changed. 11621 /// 11622 extern(System) void function ( 11623 cef_media_observer_t* self, 11624 cef_media_route_t* route, 11625 cef_media_route_connection_state_t state) nothrow on_route_state_changed; 11626 11627 /// 11628 /// A message was recieved over |route|. |message| is only valid for the scope 11629 /// of this callback and should be copied if necessary. 11630 /// 11631 extern(System) void function ( 11632 cef_media_observer_t* self, 11633 cef_media_route_t* route, 11634 const(void)* message, 11635 size_t message_size) nothrow on_route_message_received; 11636 } 11637 11638 11639 11640 /// 11641 /// Represents the route between a media source and sink. Instances of this 11642 /// object are created via cef_media_router_t::CreateRoute and retrieved via 11643 /// cef_media_observer_t::OnRoutes. Contains the status and metadata of a 11644 /// routing operation. The functions of this structure may be called on any 11645 /// browser process thread unless otherwise indicated. 11646 /// 11647 struct cef_media_route_t 11648 { 11649 /// 11650 /// Base structure. 11651 /// 11652 cef_base_ref_counted_t base; 11653 11654 /// 11655 /// Returns the ID for this route. 11656 /// 11657 // The resulting string must be freed by calling cef_string_userfree_free(). 11658 extern(System) cef_string_userfree_t function (cef_media_route_t* self) nothrow get_id; 11659 11660 /// 11661 /// Returns the source associated with this route. 11662 /// 11663 extern(System) cef_media_source_t* function (cef_media_route_t* self) nothrow get_source; 11664 11665 /// 11666 /// Returns the sink associated with this route. 11667 /// 11668 extern(System) cef_media_sink_t* function (cef_media_route_t* self) nothrow get_sink; 11669 11670 /// 11671 /// Send a message over this route. |message| will be copied if necessary. 11672 /// 11673 extern(System) void function ( 11674 cef_media_route_t* self, 11675 const(void)* message, 11676 size_t message_size) nothrow send_route_message; 11677 11678 /// 11679 /// Terminate this route. Will result in an asynchronous call to 11680 /// cef_media_observer_t::OnRoutes on all registered observers. 11681 /// 11682 extern(System) void function (cef_media_route_t* self) nothrow terminate; 11683 } 11684 11685 11686 11687 /// 11688 /// Callback structure for cef_media_router_t::CreateRoute. The functions of 11689 /// this structure will be called on the browser process UI thread. 11690 /// 11691 struct cef_media_route_create_callback_t 11692 { 11693 /// 11694 /// Base structure. 11695 /// 11696 cef_base_ref_counted_t base; 11697 11698 /// 11699 /// Method that will be executed when the route creation has finished. 11700 /// |result| will be CEF_MRCR_OK if the route creation succeeded. |error| will 11701 /// be a description of the error if the route creation failed. |route| is the 11702 /// resulting route, or NULL if the route creation failed. 11703 /// 11704 extern(System) void function ( 11705 cef_media_route_create_callback_t* self, 11706 cef_media_route_create_result_t result, 11707 const(cef_string_t)* error, 11708 cef_media_route_t* route) nothrow on_media_route_create_finished; 11709 } 11710 11711 11712 11713 /// 11714 /// Represents a sink to which media can be routed. Instances of this object are 11715 /// retrieved via cef_media_observer_t::OnSinks. The functions of this structure 11716 /// may be called on any browser process thread unless otherwise indicated. 11717 /// 11718 struct cef_media_sink_t 11719 { 11720 /// 11721 /// Base structure. 11722 /// 11723 cef_base_ref_counted_t base; 11724 11725 /// 11726 /// Returns the ID for this sink. 11727 /// 11728 // The resulting string must be freed by calling cef_string_userfree_free(). 11729 extern(System) cef_string_userfree_t function (cef_media_sink_t* self) nothrow get_id; 11730 11731 /// 11732 /// Returns the name of this sink. 11733 /// 11734 // The resulting string must be freed by calling cef_string_userfree_free(). 11735 extern(System) cef_string_userfree_t function (cef_media_sink_t* self) nothrow get_name; 11736 11737 /// 11738 /// Returns the description of this sink. 11739 /// 11740 // The resulting string must be freed by calling cef_string_userfree_free(). 11741 extern(System) cef_string_userfree_t function (cef_media_sink_t* self) nothrow get_description; 11742 11743 /// 11744 /// Returns the icon type for this sink. 11745 /// 11746 extern(System) cef_media_sink_icon_type_t function ( 11747 cef_media_sink_t* self) nothrow get_icon_type; 11748 11749 /// 11750 /// Asynchronously retrieves device info. 11751 /// 11752 extern(System) void function ( 11753 cef_media_sink_t* self, 11754 cef_media_sink_device_info_callback_t* callback) nothrow get_device_info; 11755 11756 /// 11757 /// Returns true (1) if this sink accepts content via Cast. 11758 /// 11759 extern(System) int function (cef_media_sink_t* self) nothrow is_cast_sink; 11760 11761 /// 11762 /// Returns true (1) if this sink accepts content via DIAL. 11763 /// 11764 extern(System) int function (cef_media_sink_t* self) nothrow is_dial_sink; 11765 11766 /// 11767 /// Returns true (1) if this sink is compatible with |source|. 11768 /// 11769 extern(System) int function ( 11770 cef_media_sink_t* self, 11771 cef_media_source_t* source) nothrow is_compatible_with; 11772 } 11773 11774 11775 11776 /// 11777 /// Callback structure for cef_media_sink_t::GetDeviceInfo. The functions of 11778 /// this structure will be called on the browser process UI thread. 11779 /// 11780 struct cef_media_sink_device_info_callback_t 11781 { 11782 /// 11783 /// Base structure. 11784 /// 11785 cef_base_ref_counted_t base; 11786 11787 /// 11788 /// Method that will be executed asyncronously once device information has 11789 /// been retrieved. 11790 /// 11791 extern(System) void function ( 11792 cef_media_sink_device_info_callback_t* self, 11793 const(cef_media_sink_device_info_t)* device_info) nothrow on_media_sink_device_info; 11794 } 11795 11796 11797 11798 /// 11799 /// Represents a source from which media can be routed. Instances of this object 11800 /// are retrieved via cef_media_router_t::GetSource. The functions of this 11801 /// structure may be called on any browser process thread unless otherwise 11802 /// indicated. 11803 /// 11804 struct cef_media_source_t 11805 { 11806 /// 11807 /// Base structure. 11808 /// 11809 cef_base_ref_counted_t base; 11810 11811 /// 11812 /// Returns the ID (media source URN or URL) for this source. 11813 /// 11814 // The resulting string must be freed by calling cef_string_userfree_free(). 11815 extern(System) cef_string_userfree_t function (cef_media_source_t* self) nothrow get_id; 11816 11817 /// 11818 /// Returns true (1) if this source outputs its content via Cast. 11819 /// 11820 extern(System) int function (cef_media_source_t* self) nothrow is_cast_source; 11821 11822 /// 11823 /// Returns true (1) if this source outputs its content via DIAL. 11824 /// 11825 extern(System) int function (cef_media_source_t* self) nothrow is_dial_source; 11826 } 11827 11828 11829 11830 // CEF_INCLUDE_CAPI_CEF_MEDIA_ROUTER_CAPI_H_ 11831 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 11832 // 11833 // Redistribution and use in source and binary forms, with or without 11834 // modification, are permitted provided that the following conditions are 11835 // met: 11836 // 11837 // * Redistributions of source code must retain the above copyright 11838 // notice, this list of conditions and the following disclaimer. 11839 // * Redistributions in binary form must reproduce the above 11840 // copyright notice, this list of conditions and the following disclaimer 11841 // in the documentation and/or other materials provided with the 11842 // distribution. 11843 // * Neither the name of Google Inc. nor the name Chromium Embedded 11844 // Framework nor the names of its contributors may be used to endorse 11845 // or promote products derived from this software without specific prior 11846 // written permission. 11847 // 11848 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 11849 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 11850 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 11851 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 11852 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 11853 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 11854 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 11855 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 11856 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 11857 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 11858 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11859 // 11860 // --------------------------------------------------------------------------- 11861 // 11862 // This file was generated by the CEF translator tool and should not edited 11863 // by hand. See the translator.README.txt file in the tools directory for 11864 // more information. 11865 // 11866 // $hash=4bf9250599e3ba26e7f74ec22338548492202625$ 11867 // 11868 11869 extern (C): 11870 11871 /// 11872 /// Supports creation and modification of menus. See cef_menu_id_t for the 11873 /// command ids that have default implementations. All user-defined command ids 11874 /// should be between MENU_ID_USER_FIRST and MENU_ID_USER_LAST. The functions of 11875 /// this structure can only be accessed on the browser process the UI thread. 11876 /// 11877 struct cef_menu_model_t 11878 { 11879 /// 11880 /// Base structure. 11881 /// 11882 cef_base_ref_counted_t base; 11883 11884 /// 11885 /// Returns true (1) if this menu is a submenu. 11886 /// 11887 extern(System) int function (cef_menu_model_t* self) nothrow is_sub_menu; 11888 11889 /// 11890 /// Clears the menu. Returns true (1) on success. 11891 /// 11892 extern(System) int function (cef_menu_model_t* self) nothrow clear; 11893 11894 /// 11895 /// Returns the number of items in this menu. 11896 /// 11897 extern(System) size_t function (cef_menu_model_t* self) nothrow get_count; 11898 11899 /// 11900 /// Add a separator to the menu. Returns true (1) on success. 11901 /// 11902 extern(System) int function (cef_menu_model_t* self) nothrow add_separator; 11903 11904 /// 11905 /// Add an item to the menu. Returns true (1) on success. 11906 /// 11907 extern(System) int function ( 11908 cef_menu_model_t* self, 11909 int command_id, 11910 const(cef_string_t)* label) nothrow add_item; 11911 11912 /// 11913 /// Add a check item to the menu. Returns true (1) on success. 11914 /// 11915 extern(System) int function ( 11916 cef_menu_model_t* self, 11917 int command_id, 11918 const(cef_string_t)* label) nothrow add_check_item; 11919 11920 /// 11921 /// Add a radio item to the menu. Only a single item with the specified 11922 /// |group_id| can be checked at a time. Returns true (1) on success. 11923 /// 11924 extern(System) int function ( 11925 cef_menu_model_t* self, 11926 int command_id, 11927 const(cef_string_t)* label, 11928 int group_id) nothrow add_radio_item; 11929 11930 /// 11931 /// Add a sub-menu to the menu. The new sub-menu is returned. 11932 /// 11933 extern(System) cef_menu_model_t* function ( 11934 cef_menu_model_t* self, 11935 int command_id, 11936 const(cef_string_t)* label) nothrow add_sub_menu; 11937 11938 /// 11939 /// Insert a separator in the menu at the specified |index|. Returns true (1) 11940 /// on success. 11941 /// 11942 extern(System) int function (cef_menu_model_t* self, size_t index) nothrow insert_separator_at; 11943 11944 /// 11945 /// Insert an item in the menu at the specified |index|. Returns true (1) on 11946 /// success. 11947 /// 11948 extern(System) int function ( 11949 cef_menu_model_t* self, 11950 size_t index, 11951 int command_id, 11952 const(cef_string_t)* label) nothrow insert_item_at; 11953 11954 /// 11955 /// Insert a check item in the menu at the specified |index|. Returns true (1) 11956 /// on success. 11957 /// 11958 extern(System) int function ( 11959 cef_menu_model_t* self, 11960 size_t index, 11961 int command_id, 11962 const(cef_string_t)* label) nothrow insert_check_item_at; 11963 11964 /// 11965 /// Insert a radio item in the menu at the specified |index|. Only a single 11966 /// item with the specified |group_id| can be checked at a time. Returns true 11967 /// (1) on success. 11968 /// 11969 extern(System) int function ( 11970 cef_menu_model_t* self, 11971 size_t index, 11972 int command_id, 11973 const(cef_string_t)* label, 11974 int group_id) nothrow insert_radio_item_at; 11975 11976 /// 11977 /// Insert a sub-menu in the menu at the specified |index|. The new sub-menu 11978 /// is returned. 11979 /// 11980 extern(System) cef_menu_model_t* function ( 11981 cef_menu_model_t* self, 11982 size_t index, 11983 int command_id, 11984 const(cef_string_t)* label) nothrow insert_sub_menu_at; 11985 11986 /// 11987 /// Removes the item with the specified |command_id|. Returns true (1) on 11988 /// success. 11989 /// 11990 extern(System) int function (cef_menu_model_t* self, int command_id) nothrow remove; 11991 11992 /// 11993 /// Removes the item at the specified |index|. Returns true (1) on success. 11994 /// 11995 extern(System) int function (cef_menu_model_t* self, size_t index) nothrow remove_at; 11996 11997 /// 11998 /// Returns the index associated with the specified |command_id| or -1 if not 11999 /// found due to the command id not existing in the menu. 12000 /// 12001 extern(System) int function (cef_menu_model_t* self, int command_id) nothrow get_index_of; 12002 12003 /// 12004 /// Returns the command id at the specified |index| or -1 if not found due to 12005 /// invalid range or the index being a separator. 12006 /// 12007 extern(System) int function (cef_menu_model_t* self, size_t index) nothrow get_command_id_at; 12008 12009 /// 12010 /// Sets the command id at the specified |index|. Returns true (1) on success. 12011 /// 12012 extern(System) int function ( 12013 cef_menu_model_t* self, 12014 size_t index, 12015 int command_id) nothrow set_command_id_at; 12016 12017 /// 12018 /// Returns the label for the specified |command_id| or NULL if not found. 12019 /// 12020 // The resulting string must be freed by calling cef_string_userfree_free(). 12021 extern(System) cef_string_userfree_t function ( 12022 cef_menu_model_t* self, 12023 int command_id) nothrow get_label; 12024 12025 /// 12026 /// Returns the label at the specified |index| or NULL if not found due to 12027 /// invalid range or the index being a separator. 12028 /// 12029 // The resulting string must be freed by calling cef_string_userfree_free(). 12030 extern(System) cef_string_userfree_t function ( 12031 cef_menu_model_t* self, 12032 size_t index) nothrow get_label_at; 12033 12034 /// 12035 /// Sets the label for the specified |command_id|. Returns true (1) on 12036 /// success. 12037 /// 12038 extern(System) int function ( 12039 cef_menu_model_t* self, 12040 int command_id, 12041 const(cef_string_t)* label) nothrow set_label; 12042 12043 /// 12044 /// Set the label at the specified |index|. Returns true (1) on success. 12045 /// 12046 extern(System) int function ( 12047 cef_menu_model_t* self, 12048 size_t index, 12049 const(cef_string_t)* label) nothrow set_label_at; 12050 12051 /// 12052 /// Returns the item type for the specified |command_id|. 12053 /// 12054 extern(System) cef_menu_item_type_t function ( 12055 cef_menu_model_t* self, 12056 int command_id) nothrow get_type; 12057 12058 /// 12059 /// Returns the item type at the specified |index|. 12060 /// 12061 extern(System) cef_menu_item_type_t function ( 12062 cef_menu_model_t* self, 12063 size_t index) nothrow get_type_at; 12064 12065 /// 12066 /// Returns the group id for the specified |command_id| or -1 if invalid. 12067 /// 12068 extern(System) int function (cef_menu_model_t* self, int command_id) nothrow get_group_id; 12069 12070 /// 12071 /// Returns the group id at the specified |index| or -1 if invalid. 12072 /// 12073 extern(System) int function (cef_menu_model_t* self, size_t index) nothrow get_group_id_at; 12074 12075 /// 12076 /// Sets the group id for the specified |command_id|. Returns true (1) on 12077 /// success. 12078 /// 12079 extern(System) int function ( 12080 cef_menu_model_t* self, 12081 int command_id, 12082 int group_id) nothrow set_group_id; 12083 12084 /// 12085 /// Sets the group id at the specified |index|. Returns true (1) on success. 12086 /// 12087 extern(System) int function ( 12088 cef_menu_model_t* self, 12089 size_t index, 12090 int group_id) nothrow set_group_id_at; 12091 12092 /// 12093 /// Returns the submenu for the specified |command_id| or NULL if invalid. 12094 /// 12095 extern(System) cef_menu_model_t* function ( 12096 cef_menu_model_t* self, 12097 int command_id) nothrow get_sub_menu; 12098 12099 /// 12100 /// Returns the submenu at the specified |index| or NULL if invalid. 12101 /// 12102 extern(System) cef_menu_model_t* function ( 12103 cef_menu_model_t* self, 12104 size_t index) nothrow get_sub_menu_at; 12105 12106 /// 12107 /// Returns true (1) if the specified |command_id| is visible. 12108 /// 12109 extern(System) int function (cef_menu_model_t* self, int command_id) nothrow is_visible; 12110 12111 /// 12112 /// Returns true (1) if the specified |index| is visible. 12113 /// 12114 extern(System) int function (cef_menu_model_t* self, size_t index) nothrow is_visible_at; 12115 12116 /// 12117 /// Change the visibility of the specified |command_id|. Returns true (1) on 12118 /// success. 12119 /// 12120 extern(System) int function ( 12121 cef_menu_model_t* self, 12122 int command_id, 12123 int visible) nothrow set_visible; 12124 12125 /// 12126 /// Change the visibility at the specified |index|. Returns true (1) on 12127 /// success. 12128 /// 12129 extern(System) int function ( 12130 cef_menu_model_t* self, 12131 size_t index, 12132 int visible) nothrow set_visible_at; 12133 12134 /// 12135 /// Returns true (1) if the specified |command_id| is enabled. 12136 /// 12137 extern(System) int function (cef_menu_model_t* self, int command_id) nothrow is_enabled; 12138 12139 /// 12140 /// Returns true (1) if the specified |index| is enabled. 12141 /// 12142 extern(System) int function (cef_menu_model_t* self, size_t index) nothrow is_enabled_at; 12143 12144 /// 12145 /// Change the enabled status of the specified |command_id|. Returns true (1) 12146 /// on success. 12147 /// 12148 extern(System) int function ( 12149 cef_menu_model_t* self, 12150 int command_id, 12151 int enabled) nothrow set_enabled; 12152 12153 /// 12154 /// Change the enabled status at the specified |index|. Returns true (1) on 12155 /// success. 12156 /// 12157 extern(System) int function ( 12158 cef_menu_model_t* self, 12159 size_t index, 12160 int enabled) nothrow set_enabled_at; 12161 12162 /// 12163 /// Returns true (1) if the specified |command_id| is checked. Only applies to 12164 /// check and radio items. 12165 /// 12166 extern(System) int function (cef_menu_model_t* self, int command_id) nothrow is_checked; 12167 12168 /// 12169 /// Returns true (1) if the specified |index| is checked. Only applies to 12170 /// check and radio items. 12171 /// 12172 extern(System) int function (cef_menu_model_t* self, size_t index) nothrow is_checked_at; 12173 12174 /// 12175 /// Check the specified |command_id|. Only applies to check and radio items. 12176 /// Returns true (1) on success. 12177 /// 12178 extern(System) int function ( 12179 cef_menu_model_t* self, 12180 int command_id, 12181 int checked) nothrow set_checked; 12182 12183 /// 12184 /// Check the specified |index|. Only applies to check and radio items. 12185 /// Returns true (1) on success. 12186 /// 12187 extern(System) int function ( 12188 cef_menu_model_t* self, 12189 size_t index, 12190 int checked) nothrow set_checked_at; 12191 12192 /// 12193 /// Returns true (1) if the specified |command_id| has a keyboard accelerator 12194 /// assigned. 12195 /// 12196 extern(System) int function (cef_menu_model_t* self, int command_id) nothrow has_accelerator; 12197 12198 /// 12199 /// Returns true (1) if the specified |index| has a keyboard accelerator 12200 /// assigned. 12201 /// 12202 extern(System) int function (cef_menu_model_t* self, size_t index) nothrow has_accelerator_at; 12203 12204 /// 12205 /// Set the keyboard accelerator for the specified |command_id|. |key_code| 12206 /// can be any virtual key or character value. Returns true (1) on success. 12207 /// 12208 extern(System) int function ( 12209 cef_menu_model_t* self, 12210 int command_id, 12211 int key_code, 12212 int shift_pressed, 12213 int ctrl_pressed, 12214 int alt_pressed) nothrow set_accelerator; 12215 12216 /// 12217 /// Set the keyboard accelerator at the specified |index|. |key_code| can be 12218 /// any virtual key or character value. Returns true (1) on success. 12219 /// 12220 extern(System) int function ( 12221 cef_menu_model_t* self, 12222 size_t index, 12223 int key_code, 12224 int shift_pressed, 12225 int ctrl_pressed, 12226 int alt_pressed) nothrow set_accelerator_at; 12227 12228 /// 12229 /// Remove the keyboard accelerator for the specified |command_id|. Returns 12230 /// true (1) on success. 12231 /// 12232 extern(System) int function (cef_menu_model_t* self, int command_id) nothrow remove_accelerator; 12233 12234 /// 12235 /// Remove the keyboard accelerator at the specified |index|. Returns true (1) 12236 /// on success. 12237 /// 12238 extern(System) int function (cef_menu_model_t* self, size_t index) nothrow remove_accelerator_at; 12239 12240 /// 12241 /// Retrieves the keyboard accelerator for the specified |command_id|. Returns 12242 /// true (1) on success. 12243 /// 12244 extern(System) int function ( 12245 cef_menu_model_t* self, 12246 int command_id, 12247 int* key_code, 12248 int* shift_pressed, 12249 int* ctrl_pressed, 12250 int* alt_pressed) nothrow get_accelerator; 12251 12252 /// 12253 /// Retrieves the keyboard accelerator for the specified |index|. Returns true 12254 /// (1) on success. 12255 /// 12256 extern(System) int function ( 12257 cef_menu_model_t* self, 12258 size_t index, 12259 int* key_code, 12260 int* shift_pressed, 12261 int* ctrl_pressed, 12262 int* alt_pressed) nothrow get_accelerator_at; 12263 12264 /// 12265 /// Set the explicit color for |command_id| and |color_type| to |color|. 12266 /// Specify a |color| value of 0 to remove the explicit color. If no explicit 12267 /// color or default color is set for |color_type| then the system color will 12268 /// be used. Returns true (1) on success. 12269 /// 12270 extern(System) int function ( 12271 cef_menu_model_t* self, 12272 int command_id, 12273 cef_menu_color_type_t color_type, 12274 cef_color_t color) nothrow set_color; 12275 12276 /// 12277 /// Set the explicit color for |command_id| and |index| to |color|. Specify a 12278 /// |color| value of 0 to remove the explicit color. Specify an |index| value 12279 /// of -1 to set the default color for items that do not have an explicit 12280 /// color set. If no explicit color or default color is set for |color_type| 12281 /// then the system color will be used. Returns true (1) on success. 12282 /// 12283 extern(System) int function ( 12284 cef_menu_model_t* self, 12285 int index, 12286 cef_menu_color_type_t color_type, 12287 cef_color_t color) nothrow set_color_at; 12288 12289 /// 12290 /// Returns in |color| the color that was explicitly set for |command_id| and 12291 /// |color_type|. If a color was not set then 0 will be returned in |color|. 12292 /// Returns true (1) on success. 12293 /// 12294 extern(System) int function ( 12295 cef_menu_model_t* self, 12296 int command_id, 12297 cef_menu_color_type_t color_type, 12298 cef_color_t* color) nothrow get_color; 12299 12300 /// 12301 /// Returns in |color| the color that was explicitly set for |command_id| and 12302 /// |color_type|. Specify an |index| value of -1 to return the default color 12303 /// in |color|. If a color was not set then 0 will be returned in |color|. 12304 /// Returns true (1) on success. 12305 /// 12306 extern(System) int function ( 12307 cef_menu_model_t* self, 12308 int index, 12309 cef_menu_color_type_t color_type, 12310 cef_color_t* color) nothrow get_color_at; 12311 12312 /// 12313 /// Sets the font list for the specified |command_id|. If |font_list| is NULL 12314 /// the system font will be used. Returns true (1) on success. The format is 12315 /// "<FONT_FAMILY_LIST>,[STYLES] <SIZE>", where: - FONT_FAMILY_LIST is a 12316 /// comma-separated list of font family names, - STYLES is an optional space- 12317 /// separated list of style names 12318 /// (case-sensitive "Bold" and "Italic" are supported), and 12319 /// - SIZE is an integer font size in pixels with the suffix "px". 12320 /// 12321 /// Here are examples of valid font description strings: - "Arial, Helvetica, 12322 /// Bold Italic 14px" - "Arial, 14px" 12323 /// 12324 extern(System) int function ( 12325 cef_menu_model_t* self, 12326 int command_id, 12327 const(cef_string_t)* font_list) nothrow set_font_list; 12328 12329 /// 12330 /// Sets the font list for the specified |index|. Specify an |index| value of 12331 /// -1 to set the default font. If |font_list| is NULL the system font will be 12332 /// used. Returns true (1) on success. The format is 12333 /// "<FONT_FAMILY_LIST>,[STYLES] <SIZE>", where: - FONT_FAMILY_LIST is a 12334 /// comma-separated list of font family names, - STYLES is an optional space- 12335 /// separated list of style names 12336 /// (case-sensitive "Bold" and "Italic" are supported), and 12337 /// - SIZE is an integer font size in pixels with the suffix "px". 12338 /// 12339 /// Here are examples of valid font description strings: - "Arial, Helvetica, 12340 /// Bold Italic 14px" - "Arial, 14px" 12341 /// 12342 extern(System) int function ( 12343 cef_menu_model_t* self, 12344 int index, 12345 const(cef_string_t)* font_list) nothrow set_font_list_at; 12346 } 12347 12348 12349 12350 /// 12351 /// Create a new MenuModel with the specified |delegate|. 12352 /// 12353 cef_menu_model_t* cef_menu_model_create (cef_menu_model_delegate_t* delegate_); 12354 12355 // CEF_INCLUDE_CAPI_CEF_MENU_MODEL_CAPI_H_ 12356 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 12357 // 12358 // Redistribution and use in source and binary forms, with or without 12359 // modification, are permitted provided that the following conditions are 12360 // met: 12361 // 12362 // * Redistributions of source code must retain the above copyright 12363 // notice, this list of conditions and the following disclaimer. 12364 // * Redistributions in binary form must reproduce the above 12365 // copyright notice, this list of conditions and the following disclaimer 12366 // in the documentation and/or other materials provided with the 12367 // distribution. 12368 // * Neither the name of Google Inc. nor the name Chromium Embedded 12369 // Framework nor the names of its contributors may be used to endorse 12370 // or promote products derived from this software without specific prior 12371 // written permission. 12372 // 12373 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 12374 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 12375 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 12376 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 12377 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 12378 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 12379 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 12380 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 12381 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 12382 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 12383 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12384 // 12385 // --------------------------------------------------------------------------- 12386 // 12387 // This file was generated by the CEF translator tool and should not edited 12388 // by hand. See the translator.README.txt file in the tools directory for 12389 // more information. 12390 // 12391 // $hash=8254165498a527d40517c1bc8ec413ad7a0ed259$ 12392 // 12393 12394 extern (C): 12395 12396 12397 12398 /// 12399 /// Implement this structure to handle menu model events. The functions of this 12400 /// structure will be called on the browser process UI thread unless otherwise 12401 /// indicated. 12402 /// 12403 struct cef_menu_model_delegate_t 12404 { 12405 /// 12406 /// Base structure. 12407 /// 12408 cef_base_ref_counted_t base; 12409 12410 /// 12411 /// Perform the action associated with the specified |command_id| and optional 12412 /// |event_flags|. 12413 /// 12414 extern(System) void function ( 12415 cef_menu_model_delegate_t* self, 12416 cef_menu_model_t* menu_model, 12417 int command_id, 12418 cef_event_flags_t event_flags) nothrow execute_command; 12419 12420 /// 12421 /// Called when the user moves the mouse outside the menu and over the owning 12422 /// window. 12423 /// 12424 extern(System) void function ( 12425 cef_menu_model_delegate_t* self, 12426 cef_menu_model_t* menu_model, 12427 const(cef_point_t)* screen_point) nothrow mouse_outside_menu; 12428 12429 /// 12430 /// Called on unhandled open submenu keyboard commands. |is_rtl| will be true 12431 /// (1) if the menu is displaying a right-to-left language. 12432 /// 12433 extern(System) void function ( 12434 cef_menu_model_delegate_t* self, 12435 cef_menu_model_t* menu_model, 12436 int is_rtl) nothrow unhandled_open_submenu; 12437 12438 /// 12439 /// Called on unhandled close submenu keyboard commands. |is_rtl| will be true 12440 /// (1) if the menu is displaying a right-to-left language. 12441 /// 12442 extern(System) void function ( 12443 cef_menu_model_delegate_t* self, 12444 cef_menu_model_t* menu_model, 12445 int is_rtl) nothrow unhandled_close_submenu; 12446 12447 /// 12448 /// The menu is about to show. 12449 /// 12450 extern(System) void function ( 12451 cef_menu_model_delegate_t* self, 12452 cef_menu_model_t* menu_model) nothrow menu_will_show; 12453 12454 /// 12455 /// The menu has closed. 12456 /// 12457 extern(System) void function ( 12458 cef_menu_model_delegate_t* self, 12459 cef_menu_model_t* menu_model) nothrow menu_closed; 12460 12461 /// 12462 /// Optionally modify a menu item label. Return true (1) if |label| was 12463 /// modified. 12464 /// 12465 extern(System) int function ( 12466 cef_menu_model_delegate_t* self, 12467 cef_menu_model_t* menu_model, 12468 cef_string_t* label) nothrow format_label; 12469 } 12470 12471 12472 12473 // CEF_INCLUDE_CAPI_CEF_MENU_MODEL_DELEGATE_CAPI_H_ 12474 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 12475 // 12476 // Redistribution and use in source and binary forms, with or without 12477 // modification, are permitted provided that the following conditions are 12478 // met: 12479 // 12480 // * Redistributions of source code must retain the above copyright 12481 // notice, this list of conditions and the following disclaimer. 12482 // * Redistributions in binary form must reproduce the above 12483 // copyright notice, this list of conditions and the following disclaimer 12484 // in the documentation and/or other materials provided with the 12485 // distribution. 12486 // * Neither the name of Google Inc. nor the name Chromium Embedded 12487 // Framework nor the names of its contributors may be used to endorse 12488 // or promote products derived from this software without specific prior 12489 // written permission. 12490 // 12491 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 12492 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 12493 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 12494 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 12495 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 12496 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 12497 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 12498 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 12499 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 12500 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 12501 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12502 // 12503 // --------------------------------------------------------------------------- 12504 // 12505 // This file was generated by the CEF translator tool and should not edited 12506 // by hand. See the translator.README.txt file in the tools directory for 12507 // more information. 12508 // 12509 // $hash=2822d96d72b7df816c0fefb4ce1cbba18add50ac$ 12510 // 12511 12512 extern (C): 12513 12514 /// 12515 /// Structure used to represent an entry in navigation history. 12516 /// 12517 struct cef_navigation_entry_t 12518 { 12519 /// 12520 /// Base structure. 12521 /// 12522 cef_base_ref_counted_t base; 12523 12524 /// 12525 /// Returns true (1) if this object is valid. Do not call any other functions 12526 /// if this function returns false (0). 12527 /// 12528 extern(System) int function (cef_navigation_entry_t* self) nothrow is_valid; 12529 12530 /// 12531 /// Returns the actual URL of the page. For some pages this may be data: URL 12532 /// or similar. Use get_display_url() to return a display-friendly version. 12533 /// 12534 // The resulting string must be freed by calling cef_string_userfree_free(). 12535 extern(System) cef_string_userfree_t function (cef_navigation_entry_t* self) nothrow get_url; 12536 12537 /// 12538 /// Returns a display-friendly version of the URL. 12539 /// 12540 // The resulting string must be freed by calling cef_string_userfree_free(). 12541 extern(System) cef_string_userfree_t function ( 12542 cef_navigation_entry_t* self) nothrow get_display_url; 12543 12544 /// 12545 /// Returns the original URL that was entered by the user before any 12546 /// redirects. 12547 /// 12548 // The resulting string must be freed by calling cef_string_userfree_free(). 12549 extern(System) cef_string_userfree_t function ( 12550 cef_navigation_entry_t* self) nothrow get_original_url; 12551 12552 /// 12553 /// Returns the title set by the page. This value may be NULL. 12554 /// 12555 // The resulting string must be freed by calling cef_string_userfree_free(). 12556 extern(System) cef_string_userfree_t function (cef_navigation_entry_t* self) nothrow get_title; 12557 12558 /// 12559 /// Returns the transition type which indicates what the user did to move to 12560 /// this page from the previous page. 12561 /// 12562 extern(System) cef_transition_type_t function ( 12563 cef_navigation_entry_t* self) nothrow get_transition_type; 12564 12565 /// 12566 /// Returns true (1) if this navigation includes post data. 12567 /// 12568 extern(System) int function (cef_navigation_entry_t* self) nothrow has_post_data; 12569 12570 /// 12571 /// Returns the time for the last known successful navigation completion. A 12572 /// navigation may be completed more than once if the page is reloaded. May be 12573 /// 0 if the navigation has not yet completed. 12574 /// 12575 extern(System) cef_basetime_t function ( 12576 cef_navigation_entry_t* self) nothrow get_completion_time; 12577 12578 /// 12579 /// Returns the HTTP status code for the last known successful navigation 12580 /// response. May be 0 if the response has not yet been received or if the 12581 /// navigation has not yet completed. 12582 /// 12583 extern(System) int function (cef_navigation_entry_t* self) nothrow get_http_status_code; 12584 12585 /// 12586 /// Returns the SSL information for this navigation entry. 12587 /// 12588 extern(System) cef_sslstatus_t* function (cef_navigation_entry_t* self) nothrow get_sslstatus; 12589 } 12590 12591 12592 12593 // CEF_INCLUDE_CAPI_CEF_NAVIGATION_ENTRY_CAPI_H_ 12594 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 12595 // 12596 // Redistribution and use in source and binary forms, with or without 12597 // modification, are permitted provided that the following conditions are 12598 // met: 12599 // 12600 // * Redistributions of source code must retain the above copyright 12601 // notice, this list of conditions and the following disclaimer. 12602 // * Redistributions in binary form must reproduce the above 12603 // copyright notice, this list of conditions and the following disclaimer 12604 // in the documentation and/or other materials provided with the 12605 // distribution. 12606 // * Neither the name of Google Inc. nor the name Chromium Embedded 12607 // Framework nor the names of its contributors may be used to endorse 12608 // or promote products derived from this software without specific prior 12609 // written permission. 12610 // 12611 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 12612 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 12613 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 12614 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 12615 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 12616 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 12617 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 12618 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 12619 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 12620 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 12621 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12622 // 12623 // --------------------------------------------------------------------------- 12624 // 12625 // This file was generated by the CEF translator tool and should not edited 12626 // by hand. See the translator.README.txt file in the tools directory for 12627 // more information. 12628 // 12629 // $hash=a40860835e6e693ed2f85eab5fa7990b7f2c7bbe$ 12630 // 12631 12632 extern (C): 12633 12634 /// 12635 /// Add an entry to the cross-origin access whitelist. 12636 /// 12637 /// The same-origin policy restricts how scripts hosted from different origins 12638 /// (scheme + domain + port) can communicate. By default, scripts can only 12639 /// access resources with the same origin. Scripts hosted on the HTTP and HTTPS 12640 /// schemes (but no other schemes) can use the "Access-Control-Allow-Origin" 12641 /// header to allow cross-origin requests. For example, 12642 /// https://source.example.com can make XMLHttpRequest requests on 12643 /// http://target.example.com if the http://target.example.com request returns 12644 /// an "Access-Control-Allow-Origin: https://source.example.com" response 12645 /// header. 12646 /// 12647 /// Scripts in separate frames or iframes and hosted from the same protocol and 12648 /// domain suffix can execute cross-origin JavaScript if both pages set the 12649 /// document.domain value to the same domain suffix. For example, 12650 /// scheme://foo.example.com and scheme://bar.example.com can communicate using 12651 /// JavaScript if both domains set document.domain="example.com". 12652 /// 12653 /// This function is used to allow access to origins that would otherwise 12654 /// violate the same-origin policy. Scripts hosted underneath the fully 12655 /// qualified |source_origin| URL (like http://www.example.com) will be allowed 12656 /// access to all resources hosted on the specified |target_protocol| and 12657 /// |target_domain|. If |target_domain| is non-NULL and 12658 /// |allow_target_subdomains| if false (0) only exact domain matches will be 12659 /// allowed. If |target_domain| contains a top- level domain component (like 12660 /// "example.com") and |allow_target_subdomains| is true (1) sub-domain matches 12661 /// will be allowed. If |target_domain| is NULL and |allow_target_subdomains| if 12662 /// true (1) all domains and IP addresses will be allowed. 12663 /// 12664 /// This function cannot be used to bypass the restrictions on local or display 12665 /// isolated schemes. See the comments on CefRegisterCustomScheme for more 12666 /// information. 12667 /// 12668 /// This function may be called on any thread. Returns false (0) if 12669 /// |source_origin| is invalid or the whitelist cannot be accessed. 12670 /// 12671 int cef_add_cross_origin_whitelist_entry ( 12672 const(cef_string_t)* source_origin, 12673 const(cef_string_t)* target_protocol, 12674 const(cef_string_t)* target_domain, 12675 int allow_target_subdomains); 12676 12677 /// 12678 /// Remove an entry from the cross-origin access whitelist. Returns false (0) if 12679 /// |source_origin| is invalid or the whitelist cannot be accessed. 12680 /// 12681 int cef_remove_cross_origin_whitelist_entry ( 12682 const(cef_string_t)* source_origin, 12683 const(cef_string_t)* target_protocol, 12684 const(cef_string_t)* target_domain, 12685 int allow_target_subdomains); 12686 12687 /// 12688 /// Remove all entries from the cross-origin access whitelist. Returns false (0) 12689 /// if the whitelist cannot be accessed. 12690 /// 12691 int cef_clear_cross_origin_whitelist (); 12692 12693 // CEF_INCLUDE_CAPI_CEF_ORIGIN_WHITELIST_CAPI_H_ 12694 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 12695 // 12696 // Redistribution and use in source and binary forms, with or without 12697 // modification, are permitted provided that the following conditions are 12698 // met: 12699 // 12700 // * Redistributions of source code must retain the above copyright 12701 // notice, this list of conditions and the following disclaimer. 12702 // * Redistributions in binary form must reproduce the above 12703 // copyright notice, this list of conditions and the following disclaimer 12704 // in the documentation and/or other materials provided with the 12705 // distribution. 12706 // * Neither the name of Google Inc. nor the name Chromium Embedded 12707 // Framework nor the names of its contributors may be used to endorse 12708 // or promote products derived from this software without specific prior 12709 // written permission. 12710 // 12711 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 12712 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 12713 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 12714 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 12715 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 12716 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 12717 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 12718 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 12719 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 12720 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 12721 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12722 // 12723 // --------------------------------------------------------------------------- 12724 // 12725 // This file was generated by the CEF translator tool and should not edited 12726 // by hand. See the translator.README.txt file in the tools directory for 12727 // more information. 12728 // 12729 // $hash=a6cb0abd77320cfd9ddfa3f16ca0a6ff3987521a$ 12730 // 12731 12732 extern (C): 12733 12734 /// 12735 /// Parse the specified |url| into its component parts. Returns false (0) if the 12736 /// URL is NULL or invalid. 12737 /// 12738 int cef_parse_url (const(cef_string_t)* url, cef_urlparts_t* parts); 12739 12740 /// 12741 /// Creates a URL from the specified |parts|, which must contain a non-NULL spec 12742 /// or a non-NULL host and path (at a minimum), but not both. Returns false (0) 12743 /// if |parts| isn't initialized as described. 12744 /// 12745 int cef_create_url (const(cef_urlparts_t)* parts, cef_string_t* url); 12746 12747 /// 12748 /// This is a convenience function for formatting a URL in a concise and human- 12749 /// friendly way to help users make security-related decisions (or in other 12750 /// circumstances when people need to distinguish sites, origins, or otherwise- 12751 /// simplified URLs from each other). Internationalized domain names (IDN) may 12752 /// be presented in Unicode if the conversion is considered safe. The returned 12753 /// value will (a) omit the path for standard schemes, excepting file and 12754 /// filesystem, and (b) omit the port if it is the default for the scheme. Do 12755 /// not use this for URLs which will be parsed or sent to other applications. 12756 /// 12757 // The resulting string must be freed by calling cef_string_userfree_free(). 12758 cef_string_userfree_t cef_format_url_for_security_display ( 12759 const(cef_string_t)* origin_url); 12760 12761 /// 12762 /// Returns the mime type for the specified file extension or an NULL string if 12763 /// unknown. 12764 /// 12765 // The resulting string must be freed by calling cef_string_userfree_free(). 12766 cef_string_userfree_t cef_get_mime_type (const(cef_string_t)* extension); 12767 12768 /// 12769 /// Get the extensions associated with the given mime type. This should be 12770 /// passed in lower case. There could be multiple extensions for a given mime 12771 /// type, like "html,htm" for "text/html", or "txt,text,html,..." for "text/*". 12772 /// Any existing elements in the provided vector will not be erased. 12773 /// 12774 void cef_get_extensions_for_mime_type ( 12775 const(cef_string_t)* mime_type, 12776 cef_string_list_t extensions); 12777 12778 /// 12779 /// Encodes |data| as a base64 string. 12780 /// 12781 // The resulting string must be freed by calling cef_string_userfree_free(). 12782 cef_string_userfree_t cef_base64encode (const(void)* data, size_t data_size); 12783 12784 /// 12785 /// Decodes the base64 encoded string |data|. The returned value will be NULL if 12786 /// the decoding fails. 12787 /// 12788 12789 cef_binary_value_t* cef_base64decode (const(cef_string_t)* data); 12790 12791 /// 12792 /// Escapes characters in |text| which are unsuitable for use as a query 12793 /// parameter value. Everything except alphanumerics and -_.!~*'() will be 12794 /// converted to "%XX". If |use_plus| is true (1) spaces will change to "+". The 12795 /// result is basically the same as encodeURIComponent in Javacript. 12796 /// 12797 // The resulting string must be freed by calling cef_string_userfree_free(). 12798 cef_string_userfree_t cef_uriencode (const(cef_string_t)* text, int use_plus); 12799 12800 /// 12801 /// Unescapes |text| and returns the result. Unescaping consists of looking for 12802 /// the exact pattern "%XX" where each X is a hex digit and converting to the 12803 /// character with the numerical value of those digits (e.g. "i%20=%203%3b" 12804 /// unescapes to "i = 3;"). If |convert_to_utf8| is true (1) this function will 12805 /// attempt to interpret the initial decoded result as UTF-8. If the result is 12806 /// convertable into UTF-8 it will be returned as converted. Otherwise the 12807 /// initial decoded result will be returned. The |unescape_rule| parameter 12808 /// supports further customization the decoding process. 12809 /// 12810 // The resulting string must be freed by calling cef_string_userfree_free(). 12811 cef_string_userfree_t cef_uridecode ( 12812 const(cef_string_t)* text, 12813 int convert_to_utf8, 12814 cef_uri_unescape_rule_t unescape_rule); 12815 12816 /// 12817 /// Parses the specified |json_string| and returns a dictionary or list 12818 /// representation. If JSON parsing fails this function returns NULL. 12819 /// 12820 12821 cef_value_t* cef_parse_json ( 12822 const(cef_string_t)* json_string, 12823 cef_json_parser_options_t options); 12824 12825 /// 12826 /// Parses the specified UTF8-encoded |json| buffer of size |json_size| and 12827 /// returns a dictionary or list representation. If JSON parsing fails this 12828 /// function returns NULL. 12829 /// 12830 cef_value_t* cef_parse_json_buffer ( 12831 const(void)* json, 12832 size_t json_size, 12833 cef_json_parser_options_t options); 12834 12835 /// 12836 /// Parses the specified |json_string| and returns a dictionary or list 12837 /// representation. If JSON parsing fails this function returns NULL and 12838 /// populates |error_msg_out| with a formatted error message. 12839 /// 12840 cef_value_t* cef_parse_jsonand_return_error ( 12841 const(cef_string_t)* json_string, 12842 cef_json_parser_options_t options, 12843 cef_string_t* error_msg_out); 12844 12845 /// 12846 /// Generates a JSON string from the specified root |node| which should be a 12847 /// dictionary or list value. Returns an NULL string on failure. This function 12848 /// requires exclusive access to |node| including any underlying data. 12849 /// 12850 // The resulting string must be freed by calling cef_string_userfree_free(). 12851 cef_string_userfree_t cef_write_json ( 12852 cef_value_t* node, 12853 cef_json_writer_options_t options); 12854 12855 // CEF_INCLUDE_CAPI_CEF_PARSER_CAPI_H_ 12856 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 12857 // 12858 // Redistribution and use in source and binary forms, with or without 12859 // modification, are permitted provided that the following conditions are 12860 // met: 12861 // 12862 // * Redistributions of source code must retain the above copyright 12863 // notice, this list of conditions and the following disclaimer. 12864 // * Redistributions in binary form must reproduce the above 12865 // copyright notice, this list of conditions and the following disclaimer 12866 // in the documentation and/or other materials provided with the 12867 // distribution. 12868 // * Neither the name of Google Inc. nor the name Chromium Embedded 12869 // Framework nor the names of its contributors may be used to endorse 12870 // or promote products derived from this software without specific prior 12871 // written permission. 12872 // 12873 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 12874 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 12875 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 12876 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 12877 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 12878 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 12879 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 12880 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 12881 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 12882 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 12883 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12884 // 12885 // --------------------------------------------------------------------------- 12886 // 12887 // This file was generated by the CEF translator tool and should not edited 12888 // by hand. See the translator.README.txt file in the tools directory for 12889 // more information. 12890 // 12891 // $hash=0b3af613a60e4c74ec83c0bb8f5280464cbe7f48$ 12892 // 12893 12894 extern (C): 12895 12896 /// 12897 /// Retrieve the path associated with the specified |key|. Returns true (1) on 12898 /// success. Can be called on any thread in the browser process. 12899 /// 12900 int cef_get_path (cef_path_key_t key, cef_string_t* path); 12901 12902 // CEF_INCLUDE_CAPI_CEF_PATH_UTIL_CAPI_H_ 12903 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 12904 // 12905 // Redistribution and use in source and binary forms, with or without 12906 // modification, are permitted provided that the following conditions are 12907 // met: 12908 // 12909 // * Redistributions of source code must retain the above copyright 12910 // notice, this list of conditions and the following disclaimer. 12911 // * Redistributions in binary form must reproduce the above 12912 // copyright notice, this list of conditions and the following disclaimer 12913 // in the documentation and/or other materials provided with the 12914 // distribution. 12915 // * Neither the name of Google Inc. nor the name Chromium Embedded 12916 // Framework nor the names of its contributors may be used to endorse 12917 // or promote products derived from this software without specific prior 12918 // written permission. 12919 // 12920 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 12921 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 12922 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 12923 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 12924 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 12925 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 12926 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 12927 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 12928 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 12929 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 12930 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12931 // 12932 // --------------------------------------------------------------------------- 12933 // 12934 // This file was generated by the CEF translator tool and should not edited 12935 // by hand. See the translator.README.txt file in the tools directory for 12936 // more information. 12937 // 12938 // $hash=8f2ae563306d1e4ba5fa84a5f9a60712c6fc585f$ 12939 // 12940 12941 extern (C): 12942 12943 /// 12944 /// Callback structure used for asynchronous continuation of media access 12945 /// permission requests. 12946 /// 12947 struct cef_media_access_callback_t 12948 { 12949 /// 12950 /// Base structure. 12951 /// 12952 cef_base_ref_counted_t base; 12953 12954 /// 12955 /// Call to allow or deny media access. If this callback was initiated in 12956 /// response to a getUserMedia (indicated by 12957 /// CEF_MEDIA_PERMISSION_DEVICE_AUDIO_CAPTURE and/or 12958 /// CEF_MEDIA_PERMISSION_DEVICE_VIDEO_CAPTURE being set) then 12959 /// |allowed_permissions| must match |required_permissions| passed to 12960 /// OnRequestMediaAccessPermission. 12961 /// 12962 extern(System) void function ( 12963 cef_media_access_callback_t* self, 12964 uint32 allowed_permissions) nothrow cont; 12965 12966 /// 12967 /// Cancel the media access request. 12968 /// 12969 extern(System) void function (cef_media_access_callback_t* self) nothrow cancel; 12970 } 12971 12972 12973 12974 /// 12975 /// Callback structure used for asynchronous continuation of permission prompts. 12976 /// 12977 struct cef_permission_prompt_callback_t 12978 { 12979 /// 12980 /// Base structure. 12981 /// 12982 cef_base_ref_counted_t base; 12983 12984 /// 12985 /// Complete the permissions request with the specified |result|. 12986 /// 12987 extern(System) void function ( 12988 cef_permission_prompt_callback_t* self, 12989 cef_permission_request_result_t result) nothrow cont; 12990 } 12991 12992 12993 12994 /// 12995 /// Implement this structure to handle events related to permission requests. 12996 /// The functions of this structure will be called on the browser process UI 12997 /// thread. 12998 /// 12999 struct cef_permission_handler_t 13000 { 13001 /// 13002 /// Base structure. 13003 /// 13004 cef_base_ref_counted_t base; 13005 13006 /// 13007 /// Called when a page requests permission to access media. 13008 /// |requesting_origin| is the URL origin requesting permission. 13009 /// |requested_permissions| is a combination of values from 13010 /// cef_media_access_permission_types_t that represent the requested 13011 /// permissions. Return true (1) and call cef_media_access_callback_t 13012 /// functions either in this function or at a later time to continue or cancel 13013 /// the request. Return false (0) to proceed with default handling. With the 13014 /// Chrome runtime, default handling will display the permission request UI. 13015 /// With the Alloy runtime, default handling will deny the request. This 13016 /// function will not be called if the "--enable-media-stream" command-line 13017 /// switch is used to grant all permissions. 13018 /// 13019 extern(System) int function ( 13020 cef_permission_handler_t* self, 13021 cef_browser_t* browser, 13022 cef_frame_t* frame, 13023 const(cef_string_t)* requesting_origin, 13024 uint32 requested_permissions, 13025 cef_media_access_callback_t* callback) nothrow on_request_media_access_permission; 13026 13027 /// 13028 /// Called when a page should show a permission prompt. |prompt_id| uniquely 13029 /// identifies the prompt. |requesting_origin| is the URL origin requesting 13030 /// permission. |requested_permissions| is a combination of values from 13031 /// cef_permission_request_types_t that represent the requested permissions. 13032 /// Return true (1) and call cef_permission_prompt_callback_t::Continue either 13033 /// in this function or at a later time to continue or cancel the request. 13034 /// Return false (0) to proceed with default handling. With the Chrome 13035 /// runtime, default handling will display the permission prompt UI. With the 13036 /// Alloy runtime, default handling is CEF_PERMISSION_RESULT_IGNORE. 13037 /// 13038 extern(System) int function ( 13039 cef_permission_handler_t* self, 13040 cef_browser_t* browser, 13041 uint64 prompt_id, 13042 const(cef_string_t)* requesting_origin, 13043 uint32 requested_permissions, 13044 cef_permission_prompt_callback_t* callback) nothrow on_show_permission_prompt; 13045 13046 /// 13047 /// Called when a permission prompt handled via OnShowPermissionPrompt is 13048 /// dismissed. |prompt_id| will match the value that was passed to 13049 /// OnShowPermissionPrompt. |result| will be the value passed to 13050 /// cef_permission_prompt_callback_t::Continue or CEF_PERMISSION_RESULT_IGNORE 13051 /// if the dialog was dismissed for other reasons such as navigation, browser 13052 /// closure, etc. This function will not be called if OnShowPermissionPrompt 13053 /// returned false (0) for |prompt_id|. 13054 /// 13055 extern(System) void function ( 13056 cef_permission_handler_t* self, 13057 cef_browser_t* browser, 13058 uint64 prompt_id, 13059 cef_permission_request_result_t result) nothrow on_dismiss_permission_prompt; 13060 } 13061 13062 13063 13064 // CEF_INCLUDE_CAPI_CEF_PERMISSION_HANDLER_CAPI_H_ 13065 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 13066 // 13067 // Redistribution and use in source and binary forms, with or without 13068 // modification, are permitted provided that the following conditions are 13069 // met: 13070 // 13071 // * Redistributions of source code must retain the above copyright 13072 // notice, this list of conditions and the following disclaimer. 13073 // * Redistributions in binary form must reproduce the above 13074 // copyright notice, this list of conditions and the following disclaimer 13075 // in the documentation and/or other materials provided with the 13076 // distribution. 13077 // * Neither the name of Google Inc. nor the name Chromium Embedded 13078 // Framework nor the names of its contributors may be used to endorse 13079 // or promote products derived from this software without specific prior 13080 // written permission. 13081 // 13082 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 13083 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 13084 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 13085 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 13086 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 13087 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 13088 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 13089 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 13090 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 13091 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 13092 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 13093 // 13094 // --------------------------------------------------------------------------- 13095 // 13096 // This file was generated by the CEF translator tool and should not edited 13097 // by hand. See the translator.README.txt file in the tools directory for 13098 // more information. 13099 // 13100 // $hash=0621c349d0ef1e5befe0dc653a5b8ba49e51a54e$ 13101 // 13102 13103 extern (C): 13104 13105 /// 13106 /// Callback structure for asynchronous continuation of print dialog requests. 13107 /// 13108 struct cef_print_dialog_callback_t 13109 { 13110 /// 13111 /// Base structure. 13112 /// 13113 cef_base_ref_counted_t base; 13114 13115 /// 13116 /// Continue printing with the specified |settings|. 13117 /// 13118 extern(System) void function ( 13119 cef_print_dialog_callback_t* self, 13120 cef_print_settings_t* settings) nothrow cont; 13121 13122 /// 13123 /// Cancel the printing. 13124 /// 13125 extern(System) void function (cef_print_dialog_callback_t* self) nothrow cancel; 13126 } 13127 13128 13129 13130 /// 13131 /// Callback structure for asynchronous continuation of print job requests. 13132 /// 13133 struct cef_print_job_callback_t 13134 { 13135 /// 13136 /// Base structure. 13137 /// 13138 cef_base_ref_counted_t base; 13139 13140 /// 13141 /// Indicate completion of the print job. 13142 /// 13143 extern(System) void function (cef_print_job_callback_t* self) nothrow cont; 13144 } 13145 13146 13147 13148 /// 13149 /// Implement this structure to handle printing on Linux. Each browser will have 13150 /// only one print job in progress at a time. The functions of this structure 13151 /// will be called on the browser process UI thread. 13152 /// 13153 struct cef_print_handler_t 13154 { 13155 /// 13156 /// Base structure. 13157 /// 13158 cef_base_ref_counted_t base; 13159 13160 /// 13161 /// Called when printing has started for the specified |browser|. This 13162 /// function will be called before the other OnPrint*() functions and 13163 /// irrespective of how printing was initiated (e.g. 13164 /// cef_browser_host_t::print(), JavaScript window.print() or PDF extension 13165 /// print button). 13166 /// 13167 extern(System) void function ( 13168 cef_print_handler_t* self, 13169 cef_browser_t* browser) nothrow on_print_start; 13170 13171 /// 13172 /// Synchronize |settings| with client state. If |get_defaults| is true (1) 13173 /// then populate |settings| with the default print settings. Do not keep a 13174 /// reference to |settings| outside of this callback. 13175 /// 13176 extern(System) void function ( 13177 cef_print_handler_t* self, 13178 cef_browser_t* browser, 13179 cef_print_settings_t* settings, 13180 int get_defaults) nothrow on_print_settings; 13181 13182 /// 13183 /// Show the print dialog. Execute |callback| once the dialog is dismissed. 13184 /// Return true (1) if the dialog will be displayed or false (0) to cancel the 13185 /// printing immediately. 13186 /// 13187 extern(System) int function ( 13188 cef_print_handler_t* self, 13189 cef_browser_t* browser, 13190 int has_selection, 13191 cef_print_dialog_callback_t* callback) nothrow on_print_dialog; 13192 13193 /// 13194 /// Send the print job to the printer. Execute |callback| once the job is 13195 /// completed. Return true (1) if the job will proceed or false (0) to cancel 13196 /// the job immediately. 13197 /// 13198 extern(System) int function ( 13199 cef_print_handler_t* self, 13200 cef_browser_t* browser, 13201 const(cef_string_t)* document_name, 13202 const(cef_string_t)* pdf_file_path, 13203 cef_print_job_callback_t* callback) nothrow on_print_job; 13204 13205 /// 13206 /// Reset client state related to printing. 13207 /// 13208 extern(System) void function ( 13209 cef_print_handler_t* self, 13210 cef_browser_t* browser) nothrow on_print_reset; 13211 13212 /// 13213 /// Return the PDF paper size in device units. Used in combination with 13214 /// cef_browser_host_t::print_to_pdf(). 13215 /// 13216 extern(System) cef_size_t function ( 13217 cef_print_handler_t* self, 13218 cef_browser_t* browser, 13219 int device_units_per_inch) nothrow get_pdf_paper_size; 13220 } 13221 13222 13223 13224 // CEF_INCLUDE_CAPI_CEF_PRINT_HANDLER_CAPI_H_ 13225 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 13226 // 13227 // Redistribution and use in source and binary forms, with or without 13228 // modification, are permitted provided that the following conditions are 13229 // met: 13230 // 13231 // * Redistributions of source code must retain the above copyright 13232 // notice, this list of conditions and the following disclaimer. 13233 // * Redistributions in binary form must reproduce the above 13234 // copyright notice, this list of conditions and the following disclaimer 13235 // in the documentation and/or other materials provided with the 13236 // distribution. 13237 // * Neither the name of Google Inc. nor the name Chromium Embedded 13238 // Framework nor the names of its contributors may be used to endorse 13239 // or promote products derived from this software without specific prior 13240 // written permission. 13241 // 13242 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 13243 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 13244 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 13245 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 13246 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 13247 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 13248 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 13249 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 13250 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 13251 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 13252 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 13253 // 13254 // --------------------------------------------------------------------------- 13255 // 13256 // This file was generated by the CEF translator tool and should not edited 13257 // by hand. See the translator.README.txt file in the tools directory for 13258 // more information. 13259 // 13260 // $hash=22959da4d5a2c94edc7647334507e38c44d40250$ 13261 // 13262 13263 extern (C): 13264 13265 /// 13266 /// Structure representing print settings. 13267 /// 13268 struct cef_print_settings_t 13269 { 13270 /// 13271 /// Base structure. 13272 /// 13273 cef_base_ref_counted_t base; 13274 13275 /// 13276 /// Returns true (1) if this object is valid. Do not call any other functions 13277 /// if this function returns false (0). 13278 /// 13279 extern(System) int function (cef_print_settings_t* self) nothrow is_valid; 13280 13281 /// 13282 /// Returns true (1) if the values of this object are read-only. Some APIs may 13283 /// expose read-only objects. 13284 /// 13285 extern(System) int function (cef_print_settings_t* self) nothrow is_read_only; 13286 13287 /// 13288 /// Set the page orientation. 13289 /// 13290 extern(System) void function (cef_print_settings_t* self, int landscape) nothrow set_orientation; 13291 13292 /// 13293 /// Returns true (1) if the orientation is landscape. 13294 /// 13295 extern(System) int function (cef_print_settings_t* self) nothrow is_landscape; 13296 13297 /// 13298 /// Set the printer printable area in device units. Some platforms already 13299 /// provide flipped area. Set |landscape_needs_flip| to false (0) on those 13300 /// platforms to avoid double flipping. 13301 /// 13302 extern(System) void function ( 13303 cef_print_settings_t* self, 13304 const(cef_size_t)* physical_size_device_units, 13305 const(cef_rect_t)* printable_area_device_units, 13306 int landscape_needs_flip) nothrow set_printer_printable_area; 13307 13308 /// 13309 /// Set the device name. 13310 /// 13311 extern(System) void function ( 13312 cef_print_settings_t* self, 13313 const(cef_string_t)* name) nothrow set_device_name; 13314 13315 /// 13316 /// Get the device name. 13317 /// 13318 // The resulting string must be freed by calling cef_string_userfree_free(). 13319 extern(System) cef_string_userfree_t function ( 13320 cef_print_settings_t* self) nothrow get_device_name; 13321 13322 /// 13323 /// Set the DPI (dots per inch). 13324 /// 13325 extern(System) void function (cef_print_settings_t* self, int dpi) nothrow set_dpi; 13326 13327 /// 13328 /// Get the DPI (dots per inch). 13329 /// 13330 extern(System) int function (cef_print_settings_t* self) nothrow get_dpi; 13331 13332 /// 13333 /// Set the page ranges. 13334 /// 13335 extern(System) void function ( 13336 cef_print_settings_t* self, 13337 size_t rangesCount, 13338 const(cef_range_t)* ranges) nothrow set_page_ranges; 13339 13340 /// 13341 /// Returns the number of page ranges that currently exist. 13342 /// 13343 extern(System) size_t function (cef_print_settings_t* self) nothrow get_page_ranges_count; 13344 13345 /// 13346 /// Retrieve the page ranges. 13347 /// 13348 extern(System) void function ( 13349 cef_print_settings_t* self, 13350 size_t* rangesCount, 13351 cef_range_t* ranges) nothrow get_page_ranges; 13352 13353 /// 13354 /// Set whether only the selection will be printed. 13355 /// 13356 extern(System) void function ( 13357 cef_print_settings_t* self, 13358 int selection_only) nothrow set_selection_only; 13359 13360 /// 13361 /// Returns true (1) if only the selection will be printed. 13362 /// 13363 extern(System) int function (cef_print_settings_t* self) nothrow is_selection_only; 13364 13365 /// 13366 /// Set whether pages will be collated. 13367 /// 13368 extern(System) void function (cef_print_settings_t* self, int collate) nothrow set_collate; 13369 13370 /// 13371 /// Returns true (1) if pages will be collated. 13372 /// 13373 extern(System) int function (cef_print_settings_t* self) nothrow will_collate; 13374 13375 /// 13376 /// Set the color model. 13377 /// 13378 extern(System) void function ( 13379 cef_print_settings_t* self, 13380 cef_color_model_t model) nothrow set_color_model; 13381 13382 /// 13383 /// Get the color model. 13384 /// 13385 extern(System) cef_color_model_t function (cef_print_settings_t* self) nothrow get_color_model; 13386 13387 /// 13388 /// Set the number of copies. 13389 /// 13390 extern(System) void function (cef_print_settings_t* self, int copies) nothrow set_copies; 13391 13392 /// 13393 /// Get the number of copies. 13394 /// 13395 extern(System) int function (cef_print_settings_t* self) nothrow get_copies; 13396 13397 /// 13398 /// Set the duplex mode. 13399 /// 13400 extern(System) void function ( 13401 cef_print_settings_t* self, 13402 cef_duplex_mode_t mode) nothrow set_duplex_mode; 13403 13404 /// 13405 /// Get the duplex mode. 13406 /// 13407 extern(System) cef_duplex_mode_t function (cef_print_settings_t* self) nothrow get_duplex_mode; 13408 } 13409 13410 13411 13412 /// 13413 /// Create a new cef_print_settings_t object. 13414 /// 13415 cef_print_settings_t* cef_print_settings_create (); 13416 13417 // CEF_INCLUDE_CAPI_CEF_PRINT_SETTINGS_CAPI_H_ 13418 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 13419 // 13420 // Redistribution and use in source and binary forms, with or without 13421 // modification, are permitted provided that the following conditions are 13422 // met: 13423 // 13424 // * Redistributions of source code must retain the above copyright 13425 // notice, this list of conditions and the following disclaimer. 13426 // * Redistributions in binary form must reproduce the above 13427 // copyright notice, this list of conditions and the following disclaimer 13428 // in the documentation and/or other materials provided with the 13429 // distribution. 13430 // * Neither the name of Google Inc. nor the name Chromium Embedded 13431 // Framework nor the names of its contributors may be used to endorse 13432 // or promote products derived from this software without specific prior 13433 // written permission. 13434 // 13435 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 13436 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 13437 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 13438 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 13439 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 13440 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 13441 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 13442 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 13443 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 13444 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 13445 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 13446 // 13447 // --------------------------------------------------------------------------- 13448 // 13449 // This file was generated by the CEF translator tool and should not edited 13450 // by hand. See the translator.README.txt file in the tools directory for 13451 // more information. 13452 // 13453 // $hash=7b8bbe145aa8d54d868b9d9e4ce6ff2e6a596e53$ 13454 // 13455 13456 extern (C): 13457 13458 /// 13459 /// Structure representing a message. Can be used on any process and thread. 13460 /// 13461 struct cef_process_message_t 13462 { 13463 /// 13464 /// Base structure. 13465 /// 13466 cef_base_ref_counted_t base; 13467 13468 /// 13469 /// Returns true (1) if this object is valid. Do not call any other functions 13470 /// if this function returns false (0). 13471 /// 13472 extern(System) int function (cef_process_message_t* self) nothrow is_valid; 13473 13474 /// 13475 /// Returns true (1) if the values of this object are read-only. Some APIs may 13476 /// expose read-only objects. 13477 /// 13478 extern(System) int function (cef_process_message_t* self) nothrow is_read_only; 13479 13480 /// 13481 /// Returns a writable copy of this object. Returns nullptr when message 13482 /// contains a shared memory region. 13483 /// 13484 extern(System) cef_process_message_t* function (cef_process_message_t* self) nothrow copy; 13485 13486 /// 13487 /// Returns the message name. 13488 /// 13489 // The resulting string must be freed by calling cef_string_userfree_free(). 13490 extern(System) cef_string_userfree_t function (cef_process_message_t* self) nothrow get_name; 13491 13492 /// 13493 /// Returns the list of arguments. Returns nullptr when message contains a 13494 /// shared memory region. 13495 /// 13496 extern(System) cef_list_value_t* function ( 13497 cef_process_message_t* self) nothrow get_argument_list; 13498 13499 /// 13500 /// Returns the shared memory region. Returns nullptr when message contains an 13501 /// argument list. 13502 /// 13503 extern(System) cef_shared_memory_region_t* function ( 13504 cef_process_message_t* self) nothrow get_shared_memory_region; 13505 } 13506 13507 13508 13509 /// 13510 /// Create a new cef_process_message_t object with the specified name. 13511 /// 13512 cef_process_message_t* cef_process_message_create (const(cef_string_t)* name); 13513 13514 // CEF_INCLUDE_CAPI_CEF_PROCESS_MESSAGE_CAPI_H_ 13515 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 13516 // 13517 // Redistribution and use in source and binary forms, with or without 13518 // modification, are permitted provided that the following conditions are 13519 // met: 13520 // 13521 // * Redistributions of source code must retain the above copyright 13522 // notice, this list of conditions and the following disclaimer. 13523 // * Redistributions in binary form must reproduce the above 13524 // copyright notice, this list of conditions and the following disclaimer 13525 // in the documentation and/or other materials provided with the 13526 // distribution. 13527 // * Neither the name of Google Inc. nor the name Chromium Embedded 13528 // Framework nor the names of its contributors may be used to endorse 13529 // or promote products derived from this software without specific prior 13530 // written permission. 13531 // 13532 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 13533 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 13534 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 13535 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 13536 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 13537 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 13538 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 13539 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 13540 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 13541 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 13542 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 13543 // 13544 // --------------------------------------------------------------------------- 13545 // 13546 // This file was generated by the CEF translator tool and should not edited 13547 // by hand. See the translator.README.txt file in the tools directory for 13548 // more information. 13549 // 13550 // $hash=f6b215445a54f565a26f1a62d2671156635d6d46$ 13551 // 13552 13553 extern (C): 13554 13555 /// 13556 /// Launches the process specified via |command_line|. Returns true (1) upon 13557 /// success. Must be called on the browser process TID_PROCESS_LAUNCHER thread. 13558 /// 13559 /// Unix-specific notes: - All file descriptors open in the parent process will 13560 /// be closed in the 13561 /// child process except for stdin, stdout, and stderr. 13562 /// - If the first argument on the command line does not contain a slash, 13563 /// PATH will be searched. (See man execvp.) 13564 /// 13565 int cef_launch_process (cef_command_line_t* command_line); 13566 13567 // CEF_INCLUDE_CAPI_CEF_PROCESS_UTIL_CAPI_H_ 13568 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 13569 // 13570 // Redistribution and use in source and binary forms, with or without 13571 // modification, are permitted provided that the following conditions are 13572 // met: 13573 // 13574 // * Redistributions of source code must retain the above copyright 13575 // notice, this list of conditions and the following disclaimer. 13576 // * Redistributions in binary form must reproduce the above 13577 // copyright notice, this list of conditions and the following disclaimer 13578 // in the documentation and/or other materials provided with the 13579 // distribution. 13580 // * Neither the name of Google Inc. nor the name Chromium Embedded 13581 // Framework nor the names of its contributors may be used to endorse 13582 // or promote products derived from this software without specific prior 13583 // written permission. 13584 // 13585 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 13586 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 13587 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 13588 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 13589 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 13590 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 13591 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 13592 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 13593 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 13594 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 13595 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 13596 // 13597 // --------------------------------------------------------------------------- 13598 // 13599 // This file was generated by the CEF translator tool and should not edited 13600 // by hand. See the translator.README.txt file in the tools directory for 13601 // more information. 13602 // 13603 // $hash=28371116427e9457ea366c9f0546cd5eefd8f08a$ 13604 // 13605 13606 extern (C): 13607 13608 /// 13609 /// Generic callback structure used for managing the lifespan of a registration. 13610 /// 13611 struct cef_registration_t 13612 { 13613 /// 13614 /// Base structure. 13615 /// 13616 cef_base_ref_counted_t base; 13617 } 13618 13619 13620 13621 // CEF_INCLUDE_CAPI_CEF_REGISTRATION_CAPI_H_ 13622 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 13623 // 13624 // Redistribution and use in source and binary forms, with or without 13625 // modification, are permitted provided that the following conditions are 13626 // met: 13627 // 13628 // * Redistributions of source code must retain the above copyright 13629 // notice, this list of conditions and the following disclaimer. 13630 // * Redistributions in binary form must reproduce the above 13631 // copyright notice, this list of conditions and the following disclaimer 13632 // in the documentation and/or other materials provided with the 13633 // distribution. 13634 // * Neither the name of Google Inc. nor the name Chromium Embedded 13635 // Framework nor the names of its contributors may be used to endorse 13636 // or promote products derived from this software without specific prior 13637 // written permission. 13638 // 13639 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 13640 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 13641 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 13642 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 13643 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 13644 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 13645 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 13646 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 13647 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 13648 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 13649 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 13650 // 13651 // --------------------------------------------------------------------------- 13652 // 13653 // This file was generated by the CEF translator tool and should not edited 13654 // by hand. See the translator.README.txt file in the tools directory for 13655 // more information. 13656 // 13657 // $hash=931b329d62ea6461485b62b79f98165d7185b6e7$ 13658 // 13659 13660 extern (C): 13661 13662 /// 13663 /// Implement this structure to handle events when window rendering is disabled. 13664 /// The functions of this structure will be called on the UI thread. 13665 /// 13666 struct cef_render_handler_t 13667 { 13668 /// 13669 /// Base structure. 13670 /// 13671 cef_base_ref_counted_t base; 13672 13673 /// 13674 /// Return the handler for accessibility notifications. If no handler is 13675 /// provided the default implementation will be used. 13676 /// 13677 extern(System) cef_accessibility_handler_t* function ( 13678 cef_render_handler_t* self) nothrow get_accessibility_handler; 13679 13680 /// 13681 /// Called to retrieve the root window rectangle in screen DIP coordinates. 13682 /// Return true (1) if the rectangle was provided. If this function returns 13683 /// false (0) the rectangle from GetViewRect will be used. 13684 /// 13685 extern(System) int function ( 13686 cef_render_handler_t* self, 13687 cef_browser_t* browser, 13688 cef_rect_t* rect) nothrow get_root_screen_rect; 13689 13690 /// 13691 /// Called to retrieve the view rectangle in screen DIP coordinates. This 13692 /// function must always provide a non-NULL rectangle. 13693 /// 13694 extern(System) void function ( 13695 cef_render_handler_t* self, 13696 cef_browser_t* browser, 13697 cef_rect_t* rect) nothrow get_view_rect; 13698 13699 /// 13700 /// Called to retrieve the translation from view DIP coordinates to screen 13701 /// coordinates. Windows/Linux should provide screen device (pixel) 13702 /// coordinates and MacOS should provide screen DIP coordinates. Return true 13703 /// (1) if the requested coordinates were provided. 13704 /// 13705 extern(System) int function ( 13706 cef_render_handler_t* self, 13707 cef_browser_t* browser, 13708 int viewX, 13709 int viewY, 13710 int* screenX, 13711 int* screenY) nothrow get_screen_point; 13712 13713 /// 13714 /// Called to allow the client to fill in the CefScreenInfo object with 13715 /// appropriate values. Return true (1) if the |screen_info| structure has 13716 /// been modified. 13717 /// 13718 /// If the screen info rectangle is left NULL the rectangle from GetViewRect 13719 /// will be used. If the rectangle is still NULL or invalid popups may not be 13720 /// drawn correctly. 13721 /// 13722 extern(System) int function ( 13723 cef_render_handler_t* self, 13724 cef_browser_t* browser, 13725 cef_screen_info_t* screen_info) nothrow get_screen_info; 13726 13727 /// 13728 /// Called when the browser wants to show or hide the popup widget. The popup 13729 /// should be shown if |show| is true (1) and hidden if |show| is false (0). 13730 /// 13731 extern(System) void function ( 13732 cef_render_handler_t* self, 13733 cef_browser_t* browser, 13734 int show) nothrow on_popup_show; 13735 13736 /// 13737 /// Called when the browser wants to move or resize the popup widget. |rect| 13738 /// contains the new location and size in view coordinates. 13739 /// 13740 extern(System) void function ( 13741 cef_render_handler_t* self, 13742 cef_browser_t* browser, 13743 const(cef_rect_t)* rect) nothrow on_popup_size; 13744 13745 /// 13746 /// Called when an element should be painted. Pixel values passed to this 13747 /// function are scaled relative to view coordinates based on the value of 13748 /// CefScreenInfo.device_scale_factor returned from GetScreenInfo. |type| 13749 /// indicates whether the element is the view or the popup widget. |buffer| 13750 /// contains the pixel data for the whole image. |dirtyRects| contains the set 13751 /// of rectangles in pixel coordinates that need to be repainted. |buffer| 13752 /// will be |width|*|height|*4 bytes in size and represents a BGRA image with 13753 /// an upper-left origin. This function is only called when 13754 /// cef_window_tInfo::shared_texture_enabled is set to false (0). 13755 /// 13756 extern(System) void function ( 13757 cef_render_handler_t* self, 13758 cef_browser_t* browser, 13759 cef_paint_element_type_t type, 13760 size_t dirtyRectsCount, 13761 const(cef_rect_t)* dirtyRects, 13762 const(void)* buffer, 13763 int width, 13764 int height) nothrow on_paint; 13765 13766 /// 13767 /// Called when an element has been rendered to the shared texture handle. 13768 /// |type| indicates whether the element is the view or the popup widget. 13769 /// |dirtyRects| contains the set of rectangles in pixel coordinates that need 13770 /// to be repainted. |shared_handle| is the handle for a D3D11 Texture2D that 13771 /// can be accessed via ID3D11Device using the OpenSharedResource function. 13772 /// This function is only called when cef_window_tInfo::shared_texture_enabled 13773 /// is set to true (1), and is currently only supported on Windows. 13774 /// 13775 extern(System) void function ( 13776 cef_render_handler_t* self, 13777 cef_browser_t* browser, 13778 cef_paint_element_type_t type, 13779 size_t dirtyRectsCount, 13780 const(cef_rect_t)* dirtyRects, 13781 void* shared_handle) nothrow on_accelerated_paint; 13782 13783 /// 13784 /// Called to retrieve the size of the touch handle for the specified 13785 /// |orientation|. 13786 /// 13787 extern(System) void function ( 13788 cef_render_handler_t* self, 13789 cef_browser_t* browser, 13790 cef_horizontal_alignment_t orientation, 13791 cef_size_t* size) nothrow get_touch_handle_size; 13792 13793 /// 13794 /// Called when touch handle state is updated. The client is responsible for 13795 /// rendering the touch handles. 13796 /// 13797 extern(System) void function ( 13798 cef_render_handler_t* self, 13799 cef_browser_t* browser, 13800 const(cef_touch_handle_state_t)* state) nothrow on_touch_handle_state_changed; 13801 13802 /// 13803 /// Called when the user starts dragging content in the web view. Contextual 13804 /// information about the dragged content is supplied by |drag_data|. (|x|, 13805 /// |y|) is the drag start location in screen coordinates. OS APIs that run a 13806 /// system message loop may be used within the StartDragging call. 13807 /// 13808 /// Return false (0) to abort the drag operation. Don't call any of 13809 /// cef_browser_host_t::DragSource*Ended* functions after returning false (0). 13810 /// 13811 /// Return true (1) to handle the drag operation. Call 13812 /// cef_browser_host_t::DragSourceEndedAt and DragSourceSystemDragEnded either 13813 /// synchronously or asynchronously to inform the web view that the drag 13814 /// operation has ended. 13815 /// 13816 extern(System) int function ( 13817 cef_render_handler_t* self, 13818 cef_browser_t* browser, 13819 cef_drag_data_t* drag_data, 13820 cef_drag_operations_mask_t allowed_ops, 13821 int x, 13822 int y) nothrow start_dragging; 13823 13824 /// 13825 /// Called when the web view wants to update the mouse cursor during a drag & 13826 /// drop operation. |operation| describes the allowed operation (none, move, 13827 /// copy, link). 13828 /// 13829 extern(System) void function ( 13830 cef_render_handler_t* self, 13831 cef_browser_t* browser, 13832 cef_drag_operations_mask_t operation) nothrow update_drag_cursor; 13833 13834 /// 13835 /// Called when the scroll offset has changed. 13836 /// 13837 extern(System) void function ( 13838 cef_render_handler_t* self, 13839 cef_browser_t* browser, 13840 double x, 13841 double y) nothrow on_scroll_offset_changed; 13842 13843 /// 13844 /// Called when the IME composition range has changed. |selected_range| is the 13845 /// range of characters that have been selected. |character_bounds| is the 13846 /// bounds of each character in view coordinates. 13847 /// 13848 extern(System) void function ( 13849 cef_render_handler_t* self, 13850 cef_browser_t* browser, 13851 const(cef_range_t)* selected_range, 13852 size_t character_boundsCount, 13853 const(cef_rect_t)* character_bounds) nothrow on_ime_composition_range_changed; 13854 13855 /// 13856 /// Called when text selection has changed for the specified |browser|. 13857 /// |selected_text| is the currently selected text and |selected_range| is the 13858 /// character range. 13859 /// 13860 extern(System) void function ( 13861 cef_render_handler_t* self, 13862 cef_browser_t* browser, 13863 const(cef_string_t)* selected_text, 13864 const(cef_range_t)* selected_range) nothrow on_text_selection_changed; 13865 13866 /// 13867 /// Called when an on-screen keyboard should be shown or hidden for the 13868 /// specified |browser|. |input_mode| specifies what kind of keyboard should 13869 /// be opened. If |input_mode| is CEF_TEXT_INPUT_MODE_NONE, any existing 13870 /// keyboard for this browser should be hidden. 13871 /// 13872 extern(System) void function ( 13873 cef_render_handler_t* self, 13874 cef_browser_t* browser, 13875 cef_text_input_mode_t input_mode) nothrow on_virtual_keyboard_requested; 13876 } 13877 13878 13879 13880 // CEF_INCLUDE_CAPI_CEF_RENDER_HANDLER_CAPI_H_ 13881 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 13882 // 13883 // Redistribution and use in source and binary forms, with or without 13884 // modification, are permitted provided that the following conditions are 13885 // met: 13886 // 13887 // * Redistributions of source code must retain the above copyright 13888 // notice, this list of conditions and the following disclaimer. 13889 // * Redistributions in binary form must reproduce the above 13890 // copyright notice, this list of conditions and the following disclaimer 13891 // in the documentation and/or other materials provided with the 13892 // distribution. 13893 // * Neither the name of Google Inc. nor the name Chromium Embedded 13894 // Framework nor the names of its contributors may be used to endorse 13895 // or promote products derived from this software without specific prior 13896 // written permission. 13897 // 13898 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 13899 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 13900 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 13901 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 13902 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 13903 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 13904 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 13905 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 13906 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 13907 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 13908 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 13909 // 13910 // --------------------------------------------------------------------------- 13911 // 13912 // This file was generated by the CEF translator tool and should not edited 13913 // by hand. See the translator.README.txt file in the tools directory for 13914 // more information. 13915 // 13916 // $hash=b74afb6f8003ed24256ce7359ea377596b4406d9$ 13917 // 13918 13919 extern (C): 13920 13921 /// 13922 /// Structure used to implement render process callbacks. The functions of this 13923 /// structure will be called on the render process main thread (TID_RENDERER) 13924 /// unless otherwise indicated. 13925 /// 13926 struct cef_render_process_handler_t 13927 { 13928 /// 13929 /// Base structure. 13930 /// 13931 cef_base_ref_counted_t base; 13932 13933 /// 13934 /// Called after WebKit has been initialized. 13935 /// 13936 extern(System) void function (cef_render_process_handler_t* self) nothrow on_web_kit_initialized; 13937 13938 /// 13939 /// Called after a browser has been created. When browsing cross-origin a new 13940 /// browser will be created before the old browser with the same identifier is 13941 /// destroyed. |extra_info| is an optional read-only value originating from 13942 /// cef_browser_host_t::cef_browser_host_create_browser(), 13943 /// cef_browser_host_t::cef_browser_host_create_browser_sync(), 13944 /// cef_life_span_handler_t::on_before_popup() or 13945 /// cef_browser_view_t::cef_browser_view_create(). 13946 /// 13947 extern(System) void function ( 13948 cef_render_process_handler_t* self, 13949 cef_browser_t* browser, 13950 cef_dictionary_value_t* extra_info) nothrow on_browser_created; 13951 13952 /// 13953 /// Called before a browser is destroyed. 13954 /// 13955 extern(System) void function ( 13956 cef_render_process_handler_t* self, 13957 cef_browser_t* browser) nothrow on_browser_destroyed; 13958 13959 /// 13960 /// Return the handler for browser load status events. 13961 /// 13962 extern(System) cef_load_handler_t* function ( 13963 cef_render_process_handler_t* self) nothrow get_load_handler; 13964 13965 /// 13966 /// Called immediately after the V8 context for a frame has been created. To 13967 /// retrieve the JavaScript 'window' object use the 13968 /// cef_v8context_t::get_global() function. V8 handles can only be accessed 13969 /// from the thread on which they are created. A task runner for posting tasks 13970 /// on the associated thread can be retrieved via the 13971 /// cef_v8context_t::get_task_runner() function. 13972 /// 13973 extern(System) void function ( 13974 cef_render_process_handler_t* self, 13975 cef_browser_t* browser, 13976 cef_frame_t* frame, 13977 cef_v8context_t* context) nothrow on_context_created; 13978 13979 /// 13980 /// Called immediately before the V8 context for a frame is released. No 13981 /// references to the context should be kept after this function is called. 13982 /// 13983 extern(System) void function ( 13984 cef_render_process_handler_t* self, 13985 cef_browser_t* browser, 13986 cef_frame_t* frame, 13987 cef_v8context_t* context) nothrow on_context_released; 13988 13989 /// 13990 /// Called for global uncaught exceptions in a frame. Execution of this 13991 /// callback is disabled by default. To enable set 13992 /// cef_settings_t.uncaught_exception_stack_size > 0. 13993 /// 13994 extern(System) void function ( 13995 cef_render_process_handler_t* self, 13996 cef_browser_t* browser, 13997 cef_frame_t* frame, 13998 cef_v8context_t* context, 13999 cef_v8exception_t* exception, 14000 cef_v8stack_trace_t* stackTrace) nothrow on_uncaught_exception; 14001 14002 /// 14003 /// Called when a new node in the the browser gets focus. The |node| value may 14004 /// be NULL if no specific node has gained focus. The node object passed to 14005 /// this function represents a snapshot of the DOM at the time this function 14006 /// is executed. DOM objects are only valid for the scope of this function. Do 14007 /// not keep references to or attempt to access any DOM objects outside the 14008 /// scope of this function. 14009 /// 14010 extern(System) void function ( 14011 cef_render_process_handler_t* self, 14012 cef_browser_t* browser, 14013 cef_frame_t* frame, 14014 cef_domnode_t* node) nothrow on_focused_node_changed; 14015 14016 /// 14017 /// Called when a new message is received from a different process. Return 14018 /// true (1) if the message was handled or false (0) otherwise. It is safe to 14019 /// keep a reference to |message| outside of this callback. 14020 /// 14021 extern(System) int function ( 14022 cef_render_process_handler_t* self, 14023 cef_browser_t* browser, 14024 cef_frame_t* frame, 14025 cef_process_id_t source_process, 14026 cef_process_message_t* message) nothrow on_process_message_received; 14027 } 14028 14029 14030 14031 // CEF_INCLUDE_CAPI_CEF_RENDER_PROCESS_HANDLER_CAPI_H_ 14032 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 14033 // 14034 // Redistribution and use in source and binary forms, with or without 14035 // modification, are permitted provided that the following conditions are 14036 // met: 14037 // 14038 // * Redistributions of source code must retain the above copyright 14039 // notice, this list of conditions and the following disclaimer. 14040 // * Redistributions in binary form must reproduce the above 14041 // copyright notice, this list of conditions and the following disclaimer 14042 // in the documentation and/or other materials provided with the 14043 // distribution. 14044 // * Neither the name of Google Inc. nor the name Chromium Embedded 14045 // Framework nor the names of its contributors may be used to endorse 14046 // or promote products derived from this software without specific prior 14047 // written permission. 14048 // 14049 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 14050 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 14051 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 14052 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 14053 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 14054 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 14055 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 14056 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 14057 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 14058 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 14059 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 14060 // 14061 // --------------------------------------------------------------------------- 14062 // 14063 // This file was generated by the CEF translator tool and should not edited 14064 // by hand. See the translator.README.txt file in the tools directory for 14065 // more information. 14066 // 14067 // $hash=041c1b4e6e57987ad547daff56f96c6ff7ab15c9$ 14068 // 14069 14070 extern (C): 14071 14072 /// 14073 /// Structure used to represent a web request. The functions of this structure 14074 /// may be called on any thread. 14075 /// 14076 struct cef_request_t 14077 { 14078 /// 14079 /// Base structure. 14080 /// 14081 cef_base_ref_counted_t base; 14082 14083 /// 14084 /// Returns true (1) if this object is read-only. 14085 /// 14086 extern(System) int function (cef_request_t* self) nothrow is_read_only; 14087 14088 /// 14089 /// Get the fully qualified URL. 14090 /// 14091 // The resulting string must be freed by calling cef_string_userfree_free(). 14092 extern(System) cef_string_userfree_t function (cef_request_t* self) nothrow get_url; 14093 14094 /// 14095 /// Set the fully qualified URL. 14096 /// 14097 extern(System) void function (cef_request_t* self, const(cef_string_t)* url) nothrow set_url; 14098 14099 /// 14100 /// Get the request function type. The value will default to POST if post data 14101 /// is provided and GET otherwise. 14102 /// 14103 // The resulting string must be freed by calling cef_string_userfree_free(). 14104 extern(System) cef_string_userfree_t function (cef_request_t* self) nothrow get_method; 14105 14106 /// 14107 /// Set the request function type. 14108 /// 14109 extern(System) void function ( 14110 cef_request_t* self, 14111 const(cef_string_t)* method) nothrow set_method; 14112 14113 /// 14114 /// Set the referrer URL and policy. If non-NULL the referrer URL must be 14115 /// fully qualified with an HTTP or HTTPS scheme component. Any username, 14116 /// password or ref component will be removed. 14117 /// 14118 extern(System) void function ( 14119 cef_request_t* self, 14120 const(cef_string_t)* referrer_url, 14121 cef_referrer_policy_t policy) nothrow set_referrer; 14122 14123 /// 14124 /// Get the referrer URL. 14125 /// 14126 // The resulting string must be freed by calling cef_string_userfree_free(). 14127 extern(System) cef_string_userfree_t function (cef_request_t* self) nothrow get_referrer_url; 14128 14129 /// 14130 /// Get the referrer policy. 14131 /// 14132 extern(System) cef_referrer_policy_t function (cef_request_t* self) nothrow get_referrer_policy; 14133 14134 /// 14135 /// Get the post data. 14136 /// 14137 extern(System) cef_post_data_t* function (cef_request_t* self) nothrow get_post_data; 14138 14139 /// 14140 /// Set the post data. 14141 /// 14142 extern(System) void function ( 14143 cef_request_t* self, 14144 cef_post_data_t* postData) nothrow set_post_data; 14145 14146 /// 14147 /// Get the header values. Will not include the Referer value if any. 14148 /// 14149 extern(System) void function ( 14150 cef_request_t* self, 14151 cef_string_multimap_t headerMap) nothrow get_header_map; 14152 14153 /// 14154 /// Set the header values. If a Referer value exists in the header map it will 14155 /// be removed and ignored. 14156 /// 14157 extern(System) void function ( 14158 cef_request_t* self, 14159 cef_string_multimap_t headerMap) nothrow set_header_map; 14160 14161 /// 14162 /// Returns the first header value for |name| or an NULL string if not found. 14163 /// Will not return the Referer value if any. Use GetHeaderMap instead if 14164 /// |name| might have multiple values. 14165 /// 14166 // The resulting string must be freed by calling cef_string_userfree_free(). 14167 extern(System) cef_string_userfree_t function ( 14168 cef_request_t* self, 14169 const(cef_string_t)* name) nothrow get_header_by_name; 14170 14171 /// 14172 /// Set the header |name| to |value|. If |overwrite| is true (1) any existing 14173 /// values will be replaced with the new value. If |overwrite| is false (0) 14174 /// any existing values will not be overwritten. The Referer value cannot be 14175 /// set using this function. 14176 /// 14177 extern(System) void function ( 14178 cef_request_t* self, 14179 const(cef_string_t)* name, 14180 const(cef_string_t)* value, 14181 int overwrite) nothrow set_header_by_name; 14182 14183 /// 14184 /// Set all values at one time. 14185 /// 14186 extern(System) void function ( 14187 cef_request_t* self, 14188 const(cef_string_t)* url, 14189 const(cef_string_t)* method, 14190 cef_post_data_t* postData, 14191 cef_string_multimap_t headerMap) nothrow set; 14192 14193 /// 14194 /// Get the flags used in combination with cef_urlrequest_t. See 14195 /// cef_urlrequest_flags_t for supported values. 14196 /// 14197 extern(System) int function (cef_request_t* self) nothrow get_flags; 14198 14199 /// 14200 /// Set the flags used in combination with cef_urlrequest_t. See 14201 /// cef_urlrequest_flags_t for supported values. 14202 /// 14203 extern(System) void function (cef_request_t* self, int flags) nothrow set_flags; 14204 14205 /// 14206 /// Get the URL to the first party for cookies used in combination with 14207 /// cef_urlrequest_t. 14208 /// 14209 // The resulting string must be freed by calling cef_string_userfree_free(). 14210 extern(System) cef_string_userfree_t function ( 14211 cef_request_t* self) nothrow get_first_party_for_cookies; 14212 14213 /// 14214 /// Set the URL to the first party for cookies used in combination with 14215 /// cef_urlrequest_t. 14216 /// 14217 extern(System) void function ( 14218 cef_request_t* self, 14219 const(cef_string_t)* url) nothrow set_first_party_for_cookies; 14220 14221 /// 14222 /// Get the resource type for this request. Only available in the browser 14223 /// process. 14224 /// 14225 extern(System) cef_resource_type_t function (cef_request_t* self) nothrow get_resource_type; 14226 14227 /// 14228 /// Get the transition type for this request. Only available in the browser 14229 /// process and only applies to requests that represent a main frame or sub- 14230 /// frame navigation. 14231 /// 14232 extern(System) cef_transition_type_t function (cef_request_t* self) nothrow get_transition_type; 14233 14234 /// 14235 /// Returns the globally unique identifier for this request or 0 if not 14236 /// specified. Can be used by cef_resource_request_handler_t implementations 14237 /// in the browser process to track a single request across multiple 14238 /// callbacks. 14239 /// 14240 extern(System) uint64 function (cef_request_t* self) nothrow get_identifier; 14241 } 14242 14243 14244 14245 /// 14246 /// Create a new cef_request_t object. 14247 /// 14248 cef_request_t* cef_request_create (); 14249 14250 /// 14251 /// Structure used to represent post data for a web request. The functions of 14252 /// this structure may be called on any thread. 14253 /// 14254 struct cef_post_data_t 14255 { 14256 /// 14257 /// Base structure. 14258 /// 14259 cef_base_ref_counted_t base; 14260 14261 /// 14262 /// Returns true (1) if this object is read-only. 14263 /// 14264 extern(System) int function (cef_post_data_t* self) nothrow is_read_only; 14265 14266 /// 14267 /// Returns true (1) if the underlying POST data includes elements that are 14268 /// not represented by this cef_post_data_t object (for example, multi-part 14269 /// file upload data). Modifying cef_post_data_t objects with excluded 14270 /// elements may result in the request failing. 14271 /// 14272 extern(System) int function (cef_post_data_t* self) nothrow has_excluded_elements; 14273 14274 /// 14275 /// Returns the number of existing post data elements. 14276 /// 14277 extern(System) size_t function (cef_post_data_t* self) nothrow get_element_count; 14278 14279 /// 14280 /// Retrieve the post data elements. 14281 /// 14282 extern(System) void function ( 14283 cef_post_data_t* self, 14284 size_t* elementsCount, 14285 cef_post_data_element_t** elements) nothrow get_elements; 14286 14287 /// 14288 /// Remove the specified post data element. Returns true (1) if the removal 14289 /// succeeds. 14290 /// 14291 extern(System) int function ( 14292 cef_post_data_t* self, 14293 cef_post_data_element_t* element) nothrow remove_element; 14294 14295 /// 14296 /// Add the specified post data element. Returns true (1) if the add 14297 /// succeeds. 14298 /// 14299 extern(System) int function ( 14300 cef_post_data_t* self, 14301 cef_post_data_element_t* element) nothrow add_element; 14302 14303 /// 14304 /// Remove all existing post data elements. 14305 /// 14306 extern(System) void function (cef_post_data_t* self) nothrow remove_elements; 14307 } 14308 14309 14310 14311 /// 14312 /// Create a new cef_post_data_t object. 14313 /// 14314 cef_post_data_t* cef_post_data_create (); 14315 14316 /// 14317 /// Structure used to represent a single element in the request post data. The 14318 /// functions of this structure may be called on any thread. 14319 /// 14320 struct cef_post_data_element_t 14321 { 14322 /// 14323 /// Base structure. 14324 /// 14325 cef_base_ref_counted_t base; 14326 14327 /// 14328 /// Returns true (1) if this object is read-only. 14329 /// 14330 extern(System) int function (cef_post_data_element_t* self) nothrow is_read_only; 14331 14332 /// 14333 /// Remove all contents from the post data element. 14334 /// 14335 extern(System) void function (cef_post_data_element_t* self) nothrow set_to_empty; 14336 14337 /// 14338 /// The post data element will represent a file. 14339 /// 14340 extern(System) void function ( 14341 cef_post_data_element_t* self, 14342 const(cef_string_t)* fileName) nothrow set_to_file; 14343 14344 /// 14345 /// The post data element will represent bytes. The bytes passed in will be 14346 /// copied. 14347 /// 14348 extern(System) void function ( 14349 cef_post_data_element_t* self, 14350 size_t size, 14351 const(void)* bytes) nothrow set_to_bytes; 14352 14353 /// 14354 /// Return the type of this post data element. 14355 /// 14356 extern(System) cef_postdataelement_type_t function ( 14357 cef_post_data_element_t* self) nothrow get_type; 14358 14359 /// 14360 /// Return the file name. 14361 /// 14362 // The resulting string must be freed by calling cef_string_userfree_free(). 14363 extern(System) cef_string_userfree_t function (cef_post_data_element_t* self) nothrow get_file; 14364 14365 /// 14366 /// Return the number of bytes. 14367 /// 14368 extern(System) size_t function (cef_post_data_element_t* self) nothrow get_bytes_count; 14369 14370 /// 14371 /// Read up to |size| bytes into |bytes| and return the number of bytes 14372 /// actually read. 14373 /// 14374 extern(System) size_t function ( 14375 cef_post_data_element_t* self, 14376 size_t size, 14377 void* bytes) nothrow get_bytes; 14378 } 14379 14380 14381 14382 /// 14383 /// Create a new cef_post_data_element_t object. 14384 /// 14385 cef_post_data_element_t* cef_post_data_element_create (); 14386 14387 // CEF_INCLUDE_CAPI_CEF_REQUEST_CAPI_H_ 14388 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 14389 // 14390 // Redistribution and use in source and binary forms, with or without 14391 // modification, are permitted provided that the following conditions are 14392 // met: 14393 // 14394 // * Redistributions of source code must retain the above copyright 14395 // notice, this list of conditions and the following disclaimer. 14396 // * Redistributions in binary form must reproduce the above 14397 // copyright notice, this list of conditions and the following disclaimer 14398 // in the documentation and/or other materials provided with the 14399 // distribution. 14400 // * Neither the name of Google Inc. nor the name Chromium Embedded 14401 // Framework nor the names of its contributors may be used to endorse 14402 // or promote products derived from this software without specific prior 14403 // written permission. 14404 // 14405 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 14406 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 14407 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 14408 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 14409 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 14410 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 14411 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 14412 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 14413 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 14414 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 14415 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 14416 // 14417 // --------------------------------------------------------------------------- 14418 // 14419 // This file was generated by the CEF translator tool and should not edited 14420 // by hand. See the translator.README.txt file in the tools directory for 14421 // more information. 14422 // 14423 // $hash=0c12192146d0ecf006c1f3f294a4c2fd4bec484b$ 14424 // 14425 14426 extern (C): 14427 14428 14429 14430 14431 /// 14432 /// Callback structure for cef_request_context_t::ResolveHost. 14433 /// 14434 struct cef_resolve_callback_t 14435 { 14436 /// 14437 /// Base structure. 14438 /// 14439 cef_base_ref_counted_t base; 14440 14441 /// 14442 /// Called on the UI thread after the ResolveHost request has completed. 14443 /// |result| will be the result code. |resolved_ips| will be the list of 14444 /// resolved IP addresses or NULL if the resolution failed. 14445 /// 14446 extern(System) void function ( 14447 cef_resolve_callback_t* self, 14448 cef_errorcode_t result, 14449 cef_string_list_t resolved_ips) nothrow on_resolve_completed; 14450 } 14451 14452 14453 14454 /// 14455 /// A request context provides request handling for a set of related browser or 14456 /// URL request objects. A request context can be specified when creating a new 14457 /// browser via the cef_browser_host_t static factory functions or when creating 14458 /// a new URL request via the cef_urlrequest_t static factory functions. Browser 14459 /// objects with different request contexts will never be hosted in the same 14460 /// render process. Browser objects with the same request context may or may not 14461 /// be hosted in the same render process depending on the process model. Browser 14462 /// objects created indirectly via the JavaScript window.open function or 14463 /// targeted links will share the same render process and the same request 14464 /// context as the source browser. When running in single-process mode there is 14465 /// only a single render process (the main process) and so all browsers created 14466 /// in single-process mode will share the same request context. This will be the 14467 /// first request context passed into a cef_browser_host_t static factory 14468 /// function and all other request context objects will be ignored. 14469 /// 14470 struct cef_request_context_t 14471 { 14472 /// 14473 /// Base structure. 14474 /// 14475 cef_base_ref_counted_t base; 14476 14477 /// 14478 /// Returns true (1) if this object is pointing to the same context as |that| 14479 /// object. 14480 /// 14481 extern(System) int function ( 14482 cef_request_context_t* self, 14483 cef_request_context_t* other) nothrow is_same; 14484 14485 /// 14486 /// Returns true (1) if this object is sharing the same storage as |that| 14487 /// object. 14488 /// 14489 extern(System) int function ( 14490 cef_request_context_t* self, 14491 cef_request_context_t* other) nothrow is_sharing_with; 14492 14493 /// 14494 /// Returns true (1) if this object is the global context. The global context 14495 /// is used by default when creating a browser or URL request with a NULL 14496 /// context argument. 14497 /// 14498 extern(System) int function (cef_request_context_t* self) nothrow is_global; 14499 14500 /// 14501 /// Returns the handler for this context if any. 14502 /// 14503 extern(System) cef_request_context_handler_t* function ( 14504 cef_request_context_t* self) nothrow get_handler; 14505 14506 /// 14507 /// Returns the cache path for this object. If NULL an "incognito mode" in- 14508 /// memory cache is being used. 14509 /// 14510 // The resulting string must be freed by calling cef_string_userfree_free(). 14511 extern(System) cef_string_userfree_t function ( 14512 cef_request_context_t* self) nothrow get_cache_path; 14513 14514 /// 14515 /// Returns the cookie manager for this object. If |callback| is non-NULL it 14516 /// will be executed asnychronously on the UI thread after the manager's 14517 /// storage has been initialized. 14518 /// 14519 extern(System) cef_cookie_manager_t* function ( 14520 cef_request_context_t* self, 14521 cef_completion_callback_t* callback) nothrow get_cookie_manager; 14522 14523 /// 14524 /// Register a scheme handler factory for the specified |scheme_name| and 14525 /// optional |domain_name|. An NULL |domain_name| value for a standard scheme 14526 /// will cause the factory to match all domain names. The |domain_name| value 14527 /// will be ignored for non-standard schemes. If |scheme_name| is a built-in 14528 /// scheme and no handler is returned by |factory| then the built-in scheme 14529 /// handler factory will be called. If |scheme_name| is a custom scheme then 14530 /// you must also implement the cef_app_t::on_register_custom_schemes() 14531 /// function in all processes. This function may be called multiple times to 14532 /// change or remove the factory that matches the specified |scheme_name| and 14533 /// optional |domain_name|. Returns false (0) if an error occurs. This 14534 /// function may be called on any thread in the browser process. 14535 /// 14536 extern(System) int function ( 14537 cef_request_context_t* self, 14538 const(cef_string_t)* scheme_name, 14539 const(cef_string_t)* domain_name, 14540 cef_scheme_handler_factory_t* factory) nothrow register_scheme_handler_factory; 14541 14542 /// 14543 /// Clear all registered scheme handler factories. Returns false (0) on error. 14544 /// This function may be called on any thread in the browser process. 14545 /// 14546 extern(System) int function (cef_request_context_t* self) nothrow clear_scheme_handler_factories; 14547 14548 /// 14549 /// Returns true (1) if a preference with the specified |name| exists. This 14550 /// function must be called on the browser process UI thread. 14551 /// 14552 extern(System) int function ( 14553 cef_request_context_t* self, 14554 const(cef_string_t)* name) nothrow has_preference; 14555 14556 /// 14557 /// Returns the value for the preference with the specified |name|. Returns 14558 /// NULL if the preference does not exist. The returned object contains a copy 14559 /// of the underlying preference value and modifications to the returned 14560 /// object will not modify the underlying preference value. This function must 14561 /// be called on the browser process UI thread. 14562 /// 14563 extern(System) cef_value_t* function ( 14564 cef_request_context_t* self, 14565 const(cef_string_t)* name) nothrow get_preference; 14566 14567 /// 14568 /// Returns all preferences as a dictionary. If |include_defaults| is true (1) 14569 /// then preferences currently at their default value will be included. The 14570 /// returned object contains a copy of the underlying preference values and 14571 /// modifications to the returned object will not modify the underlying 14572 /// preference values. This function must be called on the browser process UI 14573 /// thread. 14574 /// 14575 extern(System) cef_dictionary_value_t* function ( 14576 cef_request_context_t* self, 14577 int include_defaults) nothrow get_all_preferences; 14578 14579 /// 14580 /// Returns true (1) if the preference with the specified |name| can be 14581 /// modified using SetPreference. As one example preferences set via the 14582 /// command-line usually cannot be modified. This function must be called on 14583 /// the browser process UI thread. 14584 /// 14585 extern(System) int function ( 14586 cef_request_context_t* self, 14587 const(cef_string_t)* name) nothrow can_set_preference; 14588 14589 /// 14590 /// Set the |value| associated with preference |name|. Returns true (1) if the 14591 /// value is set successfully and false (0) otherwise. If |value| is NULL the 14592 /// preference will be restored to its default value. If setting the 14593 /// preference fails then |error| will be populated with a detailed 14594 /// description of the problem. This function must be called on the browser 14595 /// process UI thread. 14596 /// 14597 extern(System) int function ( 14598 cef_request_context_t* self, 14599 const(cef_string_t)* name, 14600 cef_value_t* value, 14601 cef_string_t* error) nothrow set_preference; 14602 14603 /// 14604 /// Clears all certificate exceptions that were added as part of handling 14605 /// cef_request_handler_t::on_certificate_error(). If you call this it is 14606 /// recommended that you also call close_all_connections() or you risk not 14607 /// being prompted again for server certificates if you reconnect quickly. If 14608 /// |callback| is non-NULL it will be executed on the UI thread after 14609 /// completion. 14610 /// 14611 extern(System) void function ( 14612 cef_request_context_t* self, 14613 cef_completion_callback_t* callback) nothrow clear_certificate_exceptions; 14614 14615 /// 14616 /// Clears all HTTP authentication credentials that were added as part of 14617 /// handling GetAuthCredentials. If |callback| is non-NULL it will be executed 14618 /// on the UI thread after completion. 14619 /// 14620 extern(System) void function ( 14621 cef_request_context_t* self, 14622 cef_completion_callback_t* callback) nothrow clear_http_auth_credentials; 14623 14624 /// 14625 /// Clears all active and idle connections that Chromium currently has. This 14626 /// is only recommended if you have released all other CEF objects but don't 14627 /// yet want to call cef_shutdown(). If |callback| is non-NULL it will be 14628 /// executed on the UI thread after completion. 14629 /// 14630 extern(System) void function ( 14631 cef_request_context_t* self, 14632 cef_completion_callback_t* callback) nothrow close_all_connections; 14633 14634 /// 14635 /// Attempts to resolve |origin| to a list of associated IP addresses. 14636 /// |callback| will be executed on the UI thread after completion. 14637 /// 14638 extern(System) void function ( 14639 cef_request_context_t* self, 14640 const(cef_string_t)* origin, 14641 cef_resolve_callback_t* callback) nothrow resolve_host; 14642 14643 /// 14644 /// Load an extension. 14645 /// 14646 /// If extension resources will be read from disk using the default load 14647 /// implementation then |root_directory| should be the absolute path to the 14648 /// extension resources directory and |manifest| should be NULL. If extension 14649 /// resources will be provided by the client (e.g. via cef_request_handler_t 14650 /// and/or cef_extension_handler_t) then |root_directory| should be a path 14651 /// component unique to the extension (if not absolute this will be internally 14652 /// prefixed with the PK_DIR_RESOURCES path) and |manifest| should contain the 14653 /// contents that would otherwise be read from the "manifest.json" file on 14654 /// disk. 14655 /// 14656 /// The loaded extension will be accessible in all contexts sharing the same 14657 /// storage (HasExtension returns true (1)). However, only the context on 14658 /// which this function was called is considered the loader (DidLoadExtension 14659 /// returns true (1)) and only the loader will receive 14660 /// cef_request_context_handler_t callbacks for the extension. 14661 /// 14662 /// cef_extension_handler_t::OnExtensionLoaded will be called on load success 14663 /// or cef_extension_handler_t::OnExtensionLoadFailed will be called on load 14664 /// failure. 14665 /// 14666 /// If the extension specifies a background script via the "background" 14667 /// manifest key then cef_extension_handler_t::OnBeforeBackgroundBrowser will 14668 /// be called to create the background browser. See that function for 14669 /// additional information about background scripts. 14670 /// 14671 /// For visible extension views the client application should evaluate the 14672 /// manifest to determine the correct extension URL to load and then pass that 14673 /// URL to the cef_browser_host_t::CreateBrowser* function after the extension 14674 /// has loaded. For example, the client can look for the "browser_action" 14675 /// manifest key as documented at 14676 /// https://developer.chrome.com/extensions/browserAction. Extension URLs take 14677 /// the form "chrome-extension://<extension_id>/<path>". 14678 /// 14679 /// Browsers that host extensions differ from normal browsers as follows: 14680 /// - Can access chrome.* JavaScript APIs if allowed by the manifest. Visit 14681 /// chrome://extensions-support for the list of extension APIs currently 14682 /// supported by CEF. 14683 /// - Main frame navigation to non-extension content is blocked. 14684 /// - Pinch-zooming is disabled. 14685 /// - CefBrowserHost::GetExtension returns the hosted extension. 14686 /// - CefBrowserHost::IsBackgroundHost returns true for background hosts. 14687 /// 14688 /// See https://developer.chrome.com/extensions for extension implementation 14689 /// and usage documentation. 14690 /// 14691 extern(System) void function ( 14692 cef_request_context_t* self, 14693 const(cef_string_t)* root_directory, 14694 cef_dictionary_value_t* manifest, 14695 cef_extension_handler_t* handler) nothrow load_extension; 14696 14697 /// 14698 /// Returns true (1) if this context was used to load the extension identified 14699 /// by |extension_id|. Other contexts sharing the same storage will also have 14700 /// access to the extension (see HasExtension). This function must be called 14701 /// on the browser process UI thread. 14702 /// 14703 extern(System) int function ( 14704 cef_request_context_t* self, 14705 const(cef_string_t)* extension_id) nothrow did_load_extension; 14706 14707 /// 14708 /// Returns true (1) if this context has access to the extension identified by 14709 /// |extension_id|. This may not be the context that was used to load the 14710 /// extension (see DidLoadExtension). This function must be called on the 14711 /// browser process UI thread. 14712 /// 14713 extern(System) int function ( 14714 cef_request_context_t* self, 14715 const(cef_string_t)* extension_id) nothrow has_extension; 14716 14717 /// 14718 /// Retrieve the list of all extensions that this context has access to (see 14719 /// HasExtension). |extension_ids| will be populated with the list of 14720 /// extension ID values. Returns true (1) on success. This function must be 14721 /// called on the browser process UI thread. 14722 /// 14723 extern(System) int function ( 14724 cef_request_context_t* self, 14725 cef_string_list_t extension_ids) nothrow get_extensions; 14726 14727 /// 14728 /// Returns the extension matching |extension_id| or NULL if no matching 14729 /// extension is accessible in this context (see HasExtension). This function 14730 /// must be called on the browser process UI thread. 14731 /// 14732 extern(System) cef_extension_t* function ( 14733 cef_request_context_t* self, 14734 const(cef_string_t)* extension_id) nothrow get_extension; 14735 14736 /// 14737 /// Returns the MediaRouter object associated with this context. If 14738 /// |callback| is non-NULL it will be executed asnychronously on the UI thread 14739 /// after the manager's context has been initialized. 14740 /// 14741 extern(System) cef_media_router_t* function ( 14742 cef_request_context_t* self, 14743 cef_completion_callback_t* callback) nothrow get_media_router; 14744 } 14745 14746 14747 14748 /// 14749 /// Returns the global context object. 14750 /// 14751 cef_request_context_t* cef_request_context_get_global_context (); 14752 14753 /// 14754 /// Creates a new context object with the specified |settings| and optional 14755 /// |handler|. 14756 /// 14757 cef_request_context_t* cef_request_context_create_context ( 14758 const(cef_request_context_settings_t)* settings, 14759 cef_request_context_handler_t* handler); 14760 14761 /// 14762 /// Creates a new context object that shares storage with |other| and uses an 14763 /// optional |handler|. 14764 /// 14765 cef_request_context_t* cef_create_context_shared ( 14766 cef_request_context_t* other, 14767 cef_request_context_handler_t* handler); 14768 14769 // CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_CAPI_H_ 14770 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 14771 // 14772 // Redistribution and use in source and binary forms, with or without 14773 // modification, are permitted provided that the following conditions are 14774 // met: 14775 // 14776 // * Redistributions of source code must retain the above copyright 14777 // notice, this list of conditions and the following disclaimer. 14778 // * Redistributions in binary form must reproduce the above 14779 // copyright notice, this list of conditions and the following disclaimer 14780 // in the documentation and/or other materials provided with the 14781 // distribution. 14782 // * Neither the name of Google Inc. nor the name Chromium Embedded 14783 // Framework nor the names of its contributors may be used to endorse 14784 // or promote products derived from this software without specific prior 14785 // written permission. 14786 // 14787 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 14788 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 14789 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 14790 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 14791 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 14792 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 14793 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 14794 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 14795 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 14796 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 14797 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 14798 // 14799 // --------------------------------------------------------------------------- 14800 // 14801 // This file was generated by the CEF translator tool and should not edited 14802 // by hand. See the translator.README.txt file in the tools directory for 14803 // more information. 14804 // 14805 // $hash=e2a1abf4d73bb90fb077cc5642d7b95ac5c11c14$ 14806 // 14807 14808 extern (C): 14809 14810 /// 14811 /// Implement this structure to provide handler implementations. The handler 14812 /// instance will not be released until all objects related to the context have 14813 /// been destroyed. 14814 /// 14815 struct cef_request_context_handler_t 14816 { 14817 /// 14818 /// Base structure. 14819 /// 14820 cef_base_ref_counted_t base; 14821 14822 /// 14823 /// Called on the browser process UI thread immediately after the request 14824 /// context has been initialized. 14825 /// 14826 extern(System) void function ( 14827 cef_request_context_handler_t* self, 14828 cef_request_context_t* request_context) nothrow on_request_context_initialized; 14829 14830 /// 14831 /// Called on the browser process IO thread before a resource request is 14832 /// initiated. The |browser| and |frame| values represent the source of the 14833 /// request, and may be NULL for requests originating from service workers or 14834 /// cef_urlrequest_t. |request| represents the request contents and cannot be 14835 /// modified in this callback. |is_navigation| will be true (1) if the 14836 /// resource request is a navigation. |is_download| will be true (1) if the 14837 /// resource request is a download. |request_initiator| is the origin (scheme 14838 /// + domain) of the page that initiated the request. Set 14839 /// |disable_default_handling| to true (1) to disable default handling of the 14840 /// request, in which case it will need to be handled via 14841 /// cef_resource_request_handler_t::GetResourceHandler or it will be canceled. 14842 /// To allow the resource load to proceed with default handling return NULL. 14843 /// To specify a handler for the resource return a 14844 /// cef_resource_request_handler_t object. This function will not be called if 14845 /// the client associated with |browser| returns a non-NULL value from 14846 /// cef_request_handler_t::GetResourceRequestHandler for the same request 14847 /// (identified by cef_request_t::GetIdentifier). 14848 /// 14849 extern(System) cef_resource_request_handler_t* function ( 14850 cef_request_context_handler_t* self, 14851 cef_browser_t* browser, 14852 cef_frame_t* frame, 14853 cef_request_t* request, 14854 int is_navigation, 14855 int is_download, 14856 const(cef_string_t)* request_initiator, 14857 int* disable_default_handling) nothrow get_resource_request_handler; 14858 } 14859 14860 14861 14862 // CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_HANDLER_CAPI_H_ 14863 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 14864 // 14865 // Redistribution and use in source and binary forms, with or without 14866 // modification, are permitted provided that the following conditions are 14867 // met: 14868 // 14869 // * Redistributions of source code must retain the above copyright 14870 // notice, this list of conditions and the following disclaimer. 14871 // * Redistributions in binary form must reproduce the above 14872 // copyright notice, this list of conditions and the following disclaimer 14873 // in the documentation and/or other materials provided with the 14874 // distribution. 14875 // * Neither the name of Google Inc. nor the name Chromium Embedded 14876 // Framework nor the names of its contributors may be used to endorse 14877 // or promote products derived from this software without specific prior 14878 // written permission. 14879 // 14880 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 14881 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 14882 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 14883 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 14884 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 14885 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 14886 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 14887 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 14888 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 14889 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 14890 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 14891 // 14892 // --------------------------------------------------------------------------- 14893 // 14894 // This file was generated by the CEF translator tool and should not edited 14895 // by hand. See the translator.README.txt file in the tools directory for 14896 // more information. 14897 // 14898 // $hash=0524a218f8cb54cfde70f2ec475520b11923c2f7$ 14899 // 14900 14901 extern (C): 14902 14903 /// 14904 /// Callback structure used to select a client certificate for authentication. 14905 /// 14906 struct cef_select_client_certificate_callback_t 14907 { 14908 /// 14909 /// Base structure. 14910 /// 14911 cef_base_ref_counted_t base; 14912 14913 /// 14914 /// Chooses the specified certificate for client certificate authentication. 14915 /// NULL value means that no client certificate should be used. 14916 /// 14917 extern(System) void function ( 14918 cef_select_client_certificate_callback_t* self, 14919 cef_x509certificate_t* cert) nothrow select; 14920 } 14921 14922 14923 14924 /// 14925 /// Implement this structure to handle events related to browser requests. The 14926 /// functions of this structure will be called on the thread indicated. 14927 /// 14928 struct cef_request_handler_t 14929 { 14930 /// 14931 /// Base structure. 14932 /// 14933 cef_base_ref_counted_t base; 14934 14935 /// 14936 /// Called on the UI thread before browser navigation. Return true (1) to 14937 /// cancel the navigation or false (0) to allow the navigation to proceed. The 14938 /// |request| object cannot be modified in this callback. 14939 /// cef_load_handler_t::OnLoadingStateChange will be called twice in all 14940 /// cases. If the navigation is allowed cef_load_handler_t::OnLoadStart and 14941 /// cef_load_handler_t::OnLoadEnd will be called. If the navigation is 14942 /// canceled cef_load_handler_t::OnLoadError will be called with an 14943 /// |errorCode| value of ERR_ABORTED. The |user_gesture| value will be true 14944 /// (1) if the browser navigated via explicit user gesture (e.g. clicking a 14945 /// link) or false (0) if it navigated automatically (e.g. via the 14946 /// DomContentLoaded event). 14947 /// 14948 extern(System) int function ( 14949 cef_request_handler_t* self, 14950 cef_browser_t* browser, 14951 cef_frame_t* frame, 14952 cef_request_t* request, 14953 int user_gesture, 14954 int is_redirect) nothrow on_before_browse; 14955 14956 /// 14957 /// Called on the UI thread before OnBeforeBrowse in certain limited cases 14958 /// where navigating a new or different browser might be desirable. This 14959 /// includes user-initiated navigation that might open in a special way (e.g. 14960 /// links clicked via middle-click or ctrl + left-click) and certain types of 14961 /// cross-origin navigation initiated from the renderer process (e.g. 14962 /// navigating the top-level frame to/from a file URL). The |browser| and 14963 /// |frame| values represent the source of the navigation. The 14964 /// |target_disposition| value indicates where the user intended to navigate 14965 /// the browser based on standard Chromium behaviors (e.g. current tab, new 14966 /// tab, etc). The |user_gesture| value will be true (1) if the browser 14967 /// navigated via explicit user gesture (e.g. clicking a link) or false (0) if 14968 /// it navigated automatically (e.g. via the DomContentLoaded event). Return 14969 /// true (1) to cancel the navigation or false (0) to allow the navigation to 14970 /// proceed in the source browser's top-level frame. 14971 /// 14972 extern(System) int function ( 14973 cef_request_handler_t* self, 14974 cef_browser_t* browser, 14975 cef_frame_t* frame, 14976 const(cef_string_t)* target_url, 14977 cef_window_open_disposition_t target_disposition, 14978 int user_gesture) nothrow on_open_urlfrom_tab; 14979 14980 /// 14981 /// Called on the browser process IO thread before a resource request is 14982 /// initiated. The |browser| and |frame| values represent the source of the 14983 /// request. |request| represents the request contents and cannot be modified 14984 /// in this callback. |is_navigation| will be true (1) if the resource request 14985 /// is a navigation. |is_download| will be true (1) if the resource request is 14986 /// a download. |request_initiator| is the origin (scheme + domain) of the 14987 /// page that initiated the request. Set |disable_default_handling| to true 14988 /// (1) to disable default handling of the request, in which case it will need 14989 /// to be handled via cef_resource_request_handler_t::GetResourceHandler or it 14990 /// will be canceled. To allow the resource load to proceed with default 14991 /// handling return NULL. To specify a handler for the resource return a 14992 /// cef_resource_request_handler_t object. If this callback returns NULL the 14993 /// same function will be called on the associated 14994 /// cef_request_context_handler_t, if any. 14995 /// 14996 extern(System) cef_resource_request_handler_t* function ( 14997 cef_request_handler_t* self, 14998 cef_browser_t* browser, 14999 cef_frame_t* frame, 15000 cef_request_t* request, 15001 int is_navigation, 15002 int is_download, 15003 const(cef_string_t)* request_initiator, 15004 int* disable_default_handling) nothrow get_resource_request_handler; 15005 15006 /// 15007 /// Called on the IO thread when the browser needs credentials from the user. 15008 /// |origin_url| is the origin making this authentication request. |isProxy| 15009 /// indicates whether the host is a proxy server. |host| contains the hostname 15010 /// and |port| contains the port number. |realm| is the realm of the challenge 15011 /// and may be NULL. |scheme| is the authentication scheme used, such as 15012 /// "basic" or "digest", and will be NULL if the source of the request is an 15013 /// FTP server. Return true (1) to continue the request and call 15014 /// cef_auth_callback_t::cont() either in this function or at a later time 15015 /// when the authentication information is available. Return false (0) to 15016 /// cancel the request immediately. 15017 /// 15018 extern(System) int function ( 15019 cef_request_handler_t* self, 15020 cef_browser_t* browser, 15021 const(cef_string_t)* origin_url, 15022 int isProxy, 15023 const(cef_string_t)* host, 15024 int port, 15025 const(cef_string_t)* realm, 15026 const(cef_string_t)* scheme, 15027 cef_auth_callback_t* callback) nothrow get_auth_credentials; 15028 15029 /// 15030 /// Called on the IO thread when JavaScript requests a specific storage quota 15031 /// size via the webkitStorageInfo.requestQuota function. |origin_url| is the 15032 /// origin of the page making the request. |new_size| is the requested quota 15033 /// size in bytes. Return true (1) to continue the request and call 15034 /// cef_callback_t functions either in this function or at a later time to 15035 /// grant or deny the request. Return false (0) to cancel the request 15036 /// immediately. 15037 /// 15038 extern(System) int function ( 15039 cef_request_handler_t* self, 15040 cef_browser_t* browser, 15041 const(cef_string_t)* origin_url, 15042 int64 new_size, 15043 cef_callback_t* callback) nothrow on_quota_request; 15044 15045 /// 15046 /// Called on the UI thread to handle requests for URLs with an invalid SSL 15047 /// certificate. Return true (1) and call cef_callback_t functions either in 15048 /// this function or at a later time to continue or cancel the request. Return 15049 /// false (0) to cancel the request immediately. If 15050 /// cef_settings_t.ignore_certificate_errors is set all invalid certificates 15051 /// will be accepted without calling this function. 15052 /// 15053 extern(System) int function ( 15054 cef_request_handler_t* self, 15055 cef_browser_t* browser, 15056 cef_errorcode_t cert_error, 15057 const(cef_string_t)* request_url, 15058 cef_sslinfo_t* ssl_info, 15059 cef_callback_t* callback) nothrow on_certificate_error; 15060 15061 /// 15062 /// Called on the UI thread when a client certificate is being requested for 15063 /// authentication. Return false (0) to use the default behavior and 15064 /// automatically select the first certificate available. Return true (1) and 15065 /// call cef_select_client_certificate_callback_t::Select either in this 15066 /// function or at a later time to select a certificate. Do not call Select or 15067 /// call it with NULL to continue without using any certificate. |isProxy| 15068 /// indicates whether the host is an HTTPS proxy or the origin server. |host| 15069 /// and |port| contains the hostname and port of the SSL server. 15070 /// |certificates| is the list of certificates to choose from; this list has 15071 /// already been pruned by Chromium so that it only contains certificates from 15072 /// issuers that the server trusts. 15073 /// 15074 extern(System) int function ( 15075 cef_request_handler_t* self, 15076 cef_browser_t* browser, 15077 int isProxy, 15078 const(cef_string_t)* host, 15079 int port, 15080 size_t certificatesCount, 15081 cef_x509certificate_t** certificates, 15082 cef_select_client_certificate_callback_t* callback) nothrow on_select_client_certificate; 15083 15084 /// 15085 /// Called on the browser process UI thread when the render view associated 15086 /// with |browser| is ready to receive/handle IPC messages in the render 15087 /// process. 15088 /// 15089 extern(System) void function ( 15090 cef_request_handler_t* self, 15091 cef_browser_t* browser) nothrow on_render_view_ready; 15092 15093 /// 15094 /// Called on the browser process UI thread when the render process terminates 15095 /// unexpectedly. |status| indicates how the process terminated. 15096 /// 15097 extern(System) void function ( 15098 cef_request_handler_t* self, 15099 cef_browser_t* browser, 15100 cef_termination_status_t status) nothrow on_render_process_terminated; 15101 15102 /// 15103 /// Called on the browser process UI thread when the window.document object of 15104 /// the main frame has been created. 15105 /// 15106 extern(System) void function ( 15107 cef_request_handler_t* self, 15108 cef_browser_t* browser) nothrow on_document_available_in_main_frame; 15109 } 15110 15111 15112 15113 // CEF_INCLUDE_CAPI_CEF_REQUEST_HANDLER_CAPI_H_ 15114 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 15115 // 15116 // Redistribution and use in source and binary forms, with or without 15117 // modification, are permitted provided that the following conditions are 15118 // met: 15119 // 15120 // * Redistributions of source code must retain the above copyright 15121 // notice, this list of conditions and the following disclaimer. 15122 // * Redistributions in binary form must reproduce the above 15123 // copyright notice, this list of conditions and the following disclaimer 15124 // in the documentation and/or other materials provided with the 15125 // distribution. 15126 // * Neither the name of Google Inc. nor the name Chromium Embedded 15127 // Framework nor the names of its contributors may be used to endorse 15128 // or promote products derived from this software without specific prior 15129 // written permission. 15130 // 15131 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 15132 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 15133 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 15134 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 15135 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 15136 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 15137 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 15138 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 15139 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 15140 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 15141 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15142 // 15143 // --------------------------------------------------------------------------- 15144 // 15145 // This file was generated by the CEF translator tool and should not edited 15146 // by hand. See the translator.README.txt file in the tools directory for 15147 // more information. 15148 // 15149 // $hash=4350dcf46e2fcd18bea2c45446e448e588795afb$ 15150 // 15151 15152 extern (C): 15153 15154 /// 15155 /// Structure used for retrieving resources from the resource bundle (*.pak) 15156 /// files loaded by CEF during startup or via the cef_resource_bundle_handler_t 15157 /// returned from cef_app_t::GetResourceBundleHandler. See CefSettings for 15158 /// additional options related to resource bundle loading. The functions of this 15159 /// structure may be called on any thread unless otherwise indicated. 15160 /// 15161 struct cef_resource_bundle_t 15162 { 15163 /// 15164 /// Base structure. 15165 /// 15166 cef_base_ref_counted_t base; 15167 15168 /// 15169 /// Returns the localized string for the specified |string_id| or an NULL 15170 /// string if the value is not found. Include cef_pack_strings.h for a listing 15171 /// of valid string ID values. 15172 /// 15173 // The resulting string must be freed by calling cef_string_userfree_free(). 15174 extern(System) cef_string_userfree_t function ( 15175 cef_resource_bundle_t* self, 15176 int string_id) nothrow get_localized_string; 15177 15178 /// 15179 /// Returns a cef_binary_value_t containing the decompressed contents of the 15180 /// specified scale independent |resource_id| or NULL if not found. Include 15181 /// cef_pack_resources.h for a listing of valid resource ID values. 15182 /// 15183 extern(System) cef_binary_value_t* function ( 15184 cef_resource_bundle_t* self, 15185 int resource_id) nothrow get_data_resource; 15186 15187 /// 15188 /// Returns a cef_binary_value_t containing the decompressed contents of the 15189 /// specified |resource_id| nearest the scale factor |scale_factor| or NULL if 15190 /// not found. Use a |scale_factor| value of SCALE_FACTOR_NONE for scale 15191 /// independent resources or call GetDataResource instead.Include 15192 /// cef_pack_resources.h for a listing of valid resource ID values. 15193 /// 15194 extern(System) cef_binary_value_t* function ( 15195 cef_resource_bundle_t* self, 15196 int resource_id, 15197 cef_scale_factor_t scale_factor) nothrow get_data_resource_for_scale; 15198 } 15199 15200 15201 15202 /// 15203 /// Returns the global resource bundle instance. 15204 /// 15205 cef_resource_bundle_t* cef_resource_bundle_get_global (); 15206 15207 // CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_CAPI_H_ 15208 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 15209 // 15210 // Redistribution and use in source and binary forms, with or without 15211 // modification, are permitted provided that the following conditions are 15212 // met: 15213 // 15214 // * Redistributions of source code must retain the above copyright 15215 // notice, this list of conditions and the following disclaimer. 15216 // * Redistributions in binary form must reproduce the above 15217 // copyright notice, this list of conditions and the following disclaimer 15218 // in the documentation and/or other materials provided with the 15219 // distribution. 15220 // * Neither the name of Google Inc. nor the name Chromium Embedded 15221 // Framework nor the names of its contributors may be used to endorse 15222 // or promote products derived from this software without specific prior 15223 // written permission. 15224 // 15225 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 15226 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 15227 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 15228 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 15229 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 15230 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 15231 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 15232 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 15233 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 15234 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 15235 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15236 // 15237 // --------------------------------------------------------------------------- 15238 // 15239 // This file was generated by the CEF translator tool and should not edited 15240 // by hand. See the translator.README.txt file in the tools directory for 15241 // more information. 15242 // 15243 // $hash=5f8c2d1e11779072e83610190ed7215324028d07$ 15244 // 15245 15246 extern (C): 15247 15248 /// 15249 /// Structure used to implement a custom resource bundle structure. See 15250 /// CefSettings for additional options related to resource bundle loading. The 15251 /// functions of this structure may be called on multiple threads. 15252 /// 15253 struct cef_resource_bundle_handler_t 15254 { 15255 /// 15256 /// Base structure. 15257 /// 15258 cef_base_ref_counted_t base; 15259 15260 /// 15261 /// Called to retrieve a localized translation for the specified |string_id|. 15262 /// To provide the translation set |string| to the translation string and 15263 /// return true (1). To use the default translation return false (0). Include 15264 /// cef_pack_strings.h for a listing of valid string ID values. 15265 /// 15266 extern(System) int function ( 15267 cef_resource_bundle_handler_t* self, 15268 int string_id, 15269 cef_string_t* string) nothrow get_localized_string; 15270 15271 /// 15272 /// Called to retrieve data for the specified scale independent |resource_id|. 15273 /// To provide the resource data set |data| and |data_size| to the data 15274 /// pointer and size respectively and return true (1). To use the default 15275 /// resource data return false (0). The resource data will not be copied and 15276 /// must remain resident in memory. Include cef_pack_resources.h for a listing 15277 /// of valid resource ID values. 15278 /// 15279 extern(System) int function ( 15280 cef_resource_bundle_handler_t* self, 15281 int resource_id, 15282 void** data, 15283 size_t* data_size) nothrow get_data_resource; 15284 15285 /// 15286 /// Called to retrieve data for the specified |resource_id| nearest the scale 15287 /// factor |scale_factor|. To provide the resource data set |data| and 15288 /// |data_size| to the data pointer and size respectively and return true (1). 15289 /// To use the default resource data return false (0). The resource data will 15290 /// not be copied and must remain resident in memory. Include 15291 /// cef_pack_resources.h for a listing of valid resource ID values. 15292 /// 15293 extern(System) int function ( 15294 cef_resource_bundle_handler_t* self, 15295 int resource_id, 15296 cef_scale_factor_t scale_factor, 15297 void** data, 15298 size_t* data_size) nothrow get_data_resource_for_scale; 15299 } 15300 15301 15302 15303 // CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_HANDLER_CAPI_H_ 15304 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 15305 // 15306 // Redistribution and use in source and binary forms, with or without 15307 // modification, are permitted provided that the following conditions are 15308 // met: 15309 // 15310 // * Redistributions of source code must retain the above copyright 15311 // notice, this list of conditions and the following disclaimer. 15312 // * Redistributions in binary form must reproduce the above 15313 // copyright notice, this list of conditions and the following disclaimer 15314 // in the documentation and/or other materials provided with the 15315 // distribution. 15316 // * Neither the name of Google Inc. nor the name Chromium Embedded 15317 // Framework nor the names of its contributors may be used to endorse 15318 // or promote products derived from this software without specific prior 15319 // written permission. 15320 // 15321 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 15322 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 15323 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 15324 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 15325 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 15326 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 15327 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 15328 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 15329 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 15330 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 15331 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15332 // 15333 // --------------------------------------------------------------------------- 15334 // 15335 // This file was generated by the CEF translator tool and should not edited 15336 // by hand. See the translator.README.txt file in the tools directory for 15337 // more information. 15338 // 15339 // $hash=3373cc29becf60303d1f01774c1ed8017c3f0da3$ 15340 // 15341 15342 extern (C): 15343 15344 /// 15345 /// Callback for asynchronous continuation of cef_resource_handler_t::skip(). 15346 /// 15347 struct cef_resource_skip_callback_t 15348 { 15349 /// 15350 /// Base structure. 15351 /// 15352 cef_base_ref_counted_t base; 15353 15354 /// 15355 /// Callback for asynchronous continuation of skip(). If |bytes_skipped| > 0 15356 /// then either skip() will be called again until the requested number of 15357 /// bytes have been skipped or the request will proceed. If |bytes_skipped| <= 15358 /// 0 the request will fail with ERR_REQUEST_RANGE_NOT_SATISFIABLE. 15359 /// 15360 extern(System) void function ( 15361 cef_resource_skip_callback_t* self, 15362 int64 bytes_skipped) nothrow cont; 15363 } 15364 15365 15366 15367 /// 15368 /// Callback for asynchronous continuation of cef_resource_handler_t::read(). 15369 /// 15370 struct cef_resource_read_callback_t 15371 { 15372 /// 15373 /// Base structure. 15374 /// 15375 cef_base_ref_counted_t base; 15376 15377 /// 15378 /// Callback for asynchronous continuation of read(). If |bytes_read| == 0 the 15379 /// response will be considered complete. If |bytes_read| > 0 then read() will 15380 /// be called again until the request is complete (based on either the result 15381 /// or the expected content length). If |bytes_read| < 0 then the request will 15382 /// fail and the |bytes_read| value will be treated as the error code. 15383 /// 15384 extern(System) void function (cef_resource_read_callback_t* self, int bytes_read) nothrow cont; 15385 } 15386 15387 15388 15389 /// 15390 /// Structure used to implement a custom request handler structure. The 15391 /// functions of this structure will be called on the IO thread unless otherwise 15392 /// indicated. 15393 /// 15394 struct cef_resource_handler_t 15395 { 15396 /// 15397 /// Base structure. 15398 /// 15399 cef_base_ref_counted_t base; 15400 15401 /// 15402 /// Open the response stream. To handle the request immediately set 15403 /// |handle_request| to true (1) and return true (1). To decide at a later 15404 /// time set |handle_request| to false (0), return true (1), and execute 15405 /// |callback| to continue or cancel the request. To cancel the request 15406 /// immediately set |handle_request| to true (1) and return false (0). This 15407 /// function will be called in sequence but not from a dedicated thread. For 15408 /// backwards compatibility set |handle_request| to false (0) and return false 15409 /// (0) and the ProcessRequest function will be called. 15410 /// 15411 extern(System) int function ( 15412 cef_resource_handler_t* self, 15413 cef_request_t* request, 15414 int* handle_request, 15415 cef_callback_t* callback) nothrow open; 15416 15417 /// 15418 /// Begin processing the request. To handle the request return true (1) and 15419 /// call cef_callback_t::cont() once the response header information is 15420 /// available (cef_callback_t::cont() can also be called from inside this 15421 /// function if header information is available immediately). To cancel the 15422 /// request return false (0). 15423 /// 15424 /// WARNING: This function is deprecated. Use Open instead. 15425 /// 15426 extern(System) int function ( 15427 cef_resource_handler_t* self, 15428 cef_request_t* request, 15429 cef_callback_t* callback) nothrow process_request; 15430 15431 /// 15432 /// Retrieve response header information. If the response length is not known 15433 /// set |response_length| to -1 and read_response() will be called until it 15434 /// returns false (0). If the response length is known set |response_length| 15435 /// to a positive value and read_response() will be called until it returns 15436 /// false (0) or the specified number of bytes have been read. Use the 15437 /// |response| object to set the mime type, http status code and other 15438 /// optional header values. To redirect the request to a new URL set 15439 /// |redirectUrl| to the new URL. |redirectUrl| can be either a relative or 15440 /// fully qualified URL. It is also possible to set |response| to a redirect 15441 /// http status code and pass the new URL via a Location header. Likewise with 15442 /// |redirectUrl| it is valid to set a relative or fully qualified URL as the 15443 /// Location header value. If an error occured while setting up the request 15444 /// you can call set_error() on |response| to indicate the error condition. 15445 /// 15446 extern(System) void function ( 15447 cef_resource_handler_t* self, 15448 cef_response_t* response, 15449 int64* response_length, 15450 cef_string_t* redirectUrl) nothrow get_response_headers; 15451 15452 /// 15453 /// Skip response data when requested by a Range header. Skip over and discard 15454 /// |bytes_to_skip| bytes of response data. If data is available immediately 15455 /// set |bytes_skipped| to the number of bytes skipped and return true (1). To 15456 /// read the data at a later time set |bytes_skipped| to 0, return true (1) 15457 /// and execute |callback| when the data is available. To indicate failure set 15458 /// |bytes_skipped| to < 0 (e.g. -2 for ERR_FAILED) and return false (0). This 15459 /// function will be called in sequence but not from a dedicated thread. 15460 /// 15461 extern(System) int function ( 15462 cef_resource_handler_t* self, 15463 int64 bytes_to_skip, 15464 int64* bytes_skipped, 15465 cef_resource_skip_callback_t* callback) nothrow skip; 15466 15467 /// 15468 /// Read response data. If data is available immediately copy up to 15469 /// |bytes_to_read| bytes into |data_out|, set |bytes_read| to the number of 15470 /// bytes copied, and return true (1). To read the data at a later time keep a 15471 /// pointer to |data_out|, set |bytes_read| to 0, return true (1) and execute 15472 /// |callback| when the data is available (|data_out| will remain valid until 15473 /// the callback is executed). To indicate response completion set 15474 /// |bytes_read| to 0 and return false (0). To indicate failure set 15475 /// |bytes_read| to < 0 (e.g. -2 for ERR_FAILED) and return false (0). This 15476 /// function will be called in sequence but not from a dedicated thread. For 15477 /// backwards compatibility set |bytes_read| to -1 and return false (0) and 15478 /// the ReadResponse function will be called. 15479 /// 15480 extern(System) int function ( 15481 cef_resource_handler_t* self, 15482 void* data_out, 15483 int bytes_to_read, 15484 int* bytes_read, 15485 cef_resource_read_callback_t* callback) nothrow read; 15486 15487 /// 15488 /// Read response data. If data is available immediately copy up to 15489 /// |bytes_to_read| bytes into |data_out|, set |bytes_read| to the number of 15490 /// bytes copied, and return true (1). To read the data at a later time set 15491 /// |bytes_read| to 0, return true (1) and call cef_callback_t::cont() when 15492 /// the data is available. To indicate response completion return false (0). 15493 /// 15494 /// WARNING: This function is deprecated. Use Skip and Read instead. 15495 /// 15496 extern(System) int function ( 15497 cef_resource_handler_t* self, 15498 void* data_out, 15499 int bytes_to_read, 15500 int* bytes_read, 15501 cef_callback_t* callback) nothrow read_response; 15502 15503 /// 15504 /// Request processing has been canceled. 15505 /// 15506 extern(System) void function (cef_resource_handler_t* self) nothrow cancel; 15507 } 15508 15509 15510 15511 // CEF_INCLUDE_CAPI_CEF_RESOURCE_HANDLER_CAPI_H_ 15512 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 15513 // 15514 // Redistribution and use in source and binary forms, with or without 15515 // modification, are permitted provided that the following conditions are 15516 // met: 15517 // 15518 // * Redistributions of source code must retain the above copyright 15519 // notice, this list of conditions and the following disclaimer. 15520 // * Redistributions in binary form must reproduce the above 15521 // copyright notice, this list of conditions and the following disclaimer 15522 // in the documentation and/or other materials provided with the 15523 // distribution. 15524 // * Neither the name of Google Inc. nor the name Chromium Embedded 15525 // Framework nor the names of its contributors may be used to endorse 15526 // or promote products derived from this software without specific prior 15527 // written permission. 15528 // 15529 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 15530 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 15531 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 15532 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 15533 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 15534 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 15535 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 15536 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 15537 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 15538 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 15539 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15540 // 15541 // --------------------------------------------------------------------------- 15542 // 15543 // This file was generated by the CEF translator tool and should not edited 15544 // by hand. See the translator.README.txt file in the tools directory for 15545 // more information. 15546 // 15547 // $hash=64d090faf64e2ffb99da110840af383b757e113b$ 15548 // 15549 15550 extern (C): 15551 15552 /// 15553 /// Implement this structure to handle events related to browser requests. The 15554 /// functions of this structure will be called on the IO thread unless otherwise 15555 /// indicated. 15556 /// 15557 struct cef_resource_request_handler_t 15558 { 15559 /// 15560 /// Base structure. 15561 /// 15562 cef_base_ref_counted_t base; 15563 15564 /// 15565 /// Called on the IO thread before a resource request is loaded. The |browser| 15566 /// and |frame| values represent the source of the request, and may be NULL 15567 /// for requests originating from service workers or cef_urlrequest_t. To 15568 /// optionally filter cookies for the request return a 15569 /// cef_cookie_access_filter_t object. The |request| object cannot not be 15570 /// modified in this callback. 15571 /// 15572 extern(System) cef_cookie_access_filter_t* function ( 15573 cef_resource_request_handler_t* self, 15574 cef_browser_t* browser, 15575 cef_frame_t* frame, 15576 cef_request_t* request) nothrow get_cookie_access_filter; 15577 15578 /// 15579 /// Called on the IO thread before a resource request is loaded. The |browser| 15580 /// and |frame| values represent the source of the request, and may be NULL 15581 /// for requests originating from service workers or cef_urlrequest_t. To 15582 /// redirect or change the resource load optionally modify |request|. 15583 /// Modification of the request URL will be treated as a redirect. Return 15584 /// RV_CONTINUE to continue the request immediately. Return RV_CONTINUE_ASYNC 15585 /// and call cef_callback_t functions at a later time to continue or cancel 15586 /// the request asynchronously. Return RV_CANCEL to cancel the request 15587 /// immediately. 15588 /// 15589 extern(System) cef_return_value_t function ( 15590 cef_resource_request_handler_t* self, 15591 cef_browser_t* browser, 15592 cef_frame_t* frame, 15593 cef_request_t* request, 15594 cef_callback_t* callback) nothrow on_before_resource_load; 15595 15596 /// 15597 /// Called on the IO thread before a resource is loaded. The |browser| and 15598 /// |frame| values represent the source of the request, and may be NULL for 15599 /// requests originating from service workers or cef_urlrequest_t. To allow 15600 /// the resource to load using the default network loader return NULL. To 15601 /// specify a handler for the resource return a cef_resource_handler_t object. 15602 /// The |request| object cannot not be modified in this callback. 15603 /// 15604 extern(System) cef_resource_handler_t* function ( 15605 cef_resource_request_handler_t* self, 15606 cef_browser_t* browser, 15607 cef_frame_t* frame, 15608 cef_request_t* request) nothrow get_resource_handler; 15609 15610 /// 15611 /// Called on the IO thread when a resource load is redirected. The |browser| 15612 /// and |frame| values represent the source of the request, and may be NULL 15613 /// for requests originating from service workers or cef_urlrequest_t. The 15614 /// |request| parameter will contain the old URL and other request-related 15615 /// information. The |response| parameter will contain the response that 15616 /// resulted in the redirect. The |new_url| parameter will contain the new URL 15617 /// and can be changed if desired. The |request| and |response| objects cannot 15618 /// be modified in this callback. 15619 /// 15620 extern(System) void function ( 15621 cef_resource_request_handler_t* self, 15622 cef_browser_t* browser, 15623 cef_frame_t* frame, 15624 cef_request_t* request, 15625 cef_response_t* response, 15626 cef_string_t* new_url) nothrow on_resource_redirect; 15627 15628 /// 15629 /// Called on the IO thread when a resource response is received. The 15630 /// |browser| and |frame| values represent the source of the request, and may 15631 /// be NULL for requests originating from service workers or cef_urlrequest_t. 15632 /// To allow the resource load to proceed without modification return false 15633 /// (0). To redirect or retry the resource load optionally modify |request| 15634 /// and return true (1). Modification of the request URL will be treated as a 15635 /// redirect. Requests handled using the default network loader cannot be 15636 /// redirected in this callback. The |response| object cannot be modified in 15637 /// this callback. 15638 /// 15639 /// WARNING: Redirecting using this function is deprecated. Use 15640 /// OnBeforeResourceLoad or GetResourceHandler to perform redirects. 15641 /// 15642 extern(System) int function ( 15643 cef_resource_request_handler_t* self, 15644 cef_browser_t* browser, 15645 cef_frame_t* frame, 15646 cef_request_t* request, 15647 cef_response_t* response) nothrow on_resource_response; 15648 15649 /// 15650 /// Called on the IO thread to optionally filter resource response content. 15651 /// The |browser| and |frame| values represent the source of the request, and 15652 /// may be NULL for requests originating from service workers or 15653 /// cef_urlrequest_t. |request| and |response| represent the request and 15654 /// response respectively and cannot be modified in this callback. 15655 /// 15656 extern(System) cef_response_filter_t* function ( 15657 cef_resource_request_handler_t* self, 15658 cef_browser_t* browser, 15659 cef_frame_t* frame, 15660 cef_request_t* request, 15661 cef_response_t* response) nothrow get_resource_response_filter; 15662 15663 /// 15664 /// Called on the IO thread when a resource load has completed. The |browser| 15665 /// and |frame| values represent the source of the request, and may be NULL 15666 /// for requests originating from service workers or cef_urlrequest_t. 15667 /// |request| and |response| represent the request and response respectively 15668 /// and cannot be modified in this callback. |status| indicates the load 15669 /// completion status. |received_content_length| is the number of response 15670 /// bytes actually read. This function will be called for all requests, 15671 /// including requests that are aborted due to CEF shutdown or destruction of 15672 /// the associated browser. In cases where the associated browser is destroyed 15673 /// this callback may arrive after the cef_life_span_handler_t::OnBeforeClose 15674 /// callback for that browser. The cef_frame_t::IsValid function can be used 15675 /// to test for this situation, and care should be taken not to call |browser| 15676 /// or |frame| functions that modify state (like LoadURL, SendProcessMessage, 15677 /// etc.) if the frame is invalid. 15678 /// 15679 extern(System) void function ( 15680 cef_resource_request_handler_t* self, 15681 cef_browser_t* browser, 15682 cef_frame_t* frame, 15683 cef_request_t* request, 15684 cef_response_t* response, 15685 cef_urlrequest_status_t status, 15686 int64 received_content_length) nothrow on_resource_load_complete; 15687 15688 /// 15689 /// Called on the IO thread to handle requests for URLs with an unknown 15690 /// protocol component. The |browser| and |frame| values represent the source 15691 /// of the request, and may be NULL for requests originating from service 15692 /// workers or cef_urlrequest_t. |request| cannot be modified in this 15693 /// callback. Set |allow_os_execution| to true (1) to attempt execution via 15694 /// the registered OS protocol handler, if any. SECURITY WARNING: YOU SHOULD 15695 /// USE THIS METHOD TO ENFORCE RESTRICTIONS BASED ON SCHEME, HOST OR OTHER URL 15696 /// ANALYSIS BEFORE ALLOWING OS EXECUTION. 15697 /// 15698 extern(System) void function ( 15699 cef_resource_request_handler_t* self, 15700 cef_browser_t* browser, 15701 cef_frame_t* frame, 15702 cef_request_t* request, 15703 int* allow_os_execution) nothrow on_protocol_execution; 15704 } 15705 15706 15707 15708 /// 15709 /// Implement this structure to filter cookies that may be sent or received from 15710 /// resource requests. The functions of this structure will be called on the IO 15711 /// thread unless otherwise indicated. 15712 /// 15713 struct cef_cookie_access_filter_t 15714 { 15715 /// 15716 /// Base structure. 15717 /// 15718 cef_base_ref_counted_t base; 15719 15720 /// 15721 /// Called on the IO thread before a resource request is sent. The |browser| 15722 /// and |frame| values represent the source of the request, and may be NULL 15723 /// for requests originating from service workers or cef_urlrequest_t. 15724 /// |request| cannot be modified in this callback. Return true (1) if the 15725 /// specified cookie can be sent with the request or false (0) otherwise. 15726 /// 15727 extern(System) int function ( 15728 cef_cookie_access_filter_t* self, 15729 cef_browser_t* browser, 15730 cef_frame_t* frame, 15731 cef_request_t* request, 15732 const(cef_cookie_t)* cookie) nothrow can_send_cookie; 15733 15734 /// 15735 /// Called on the IO thread after a resource response is received. The 15736 /// |browser| and |frame| values represent the source of the request, and may 15737 /// be NULL for requests originating from service workers or cef_urlrequest_t. 15738 /// |request| cannot be modified in this callback. Return true (1) if the 15739 /// specified cookie returned with the response can be saved or false (0) 15740 /// otherwise. 15741 /// 15742 extern(System) int function ( 15743 cef_cookie_access_filter_t* self, 15744 cef_browser_t* browser, 15745 cef_frame_t* frame, 15746 cef_request_t* request, 15747 cef_response_t* response, 15748 const(cef_cookie_t)* cookie) nothrow can_save_cookie; 15749 } 15750 15751 15752 15753 // CEF_INCLUDE_CAPI_CEF_RESOURCE_REQUEST_HANDLER_CAPI_H_ 15754 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 15755 // 15756 // Redistribution and use in source and binary forms, with or without 15757 // modification, are permitted provided that the following conditions are 15758 // met: 15759 // 15760 // * Redistributions of source code must retain the above copyright 15761 // notice, this list of conditions and the following disclaimer. 15762 // * Redistributions in binary form must reproduce the above 15763 // copyright notice, this list of conditions and the following disclaimer 15764 // in the documentation and/or other materials provided with the 15765 // distribution. 15766 // * Neither the name of Google Inc. nor the name Chromium Embedded 15767 // Framework nor the names of its contributors may be used to endorse 15768 // or promote products derived from this software without specific prior 15769 // written permission. 15770 // 15771 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 15772 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 15773 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 15774 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 15775 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 15776 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 15777 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 15778 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 15779 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 15780 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 15781 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15782 // 15783 // --------------------------------------------------------------------------- 15784 // 15785 // This file was generated by the CEF translator tool and should not edited 15786 // by hand. See the translator.README.txt file in the tools directory for 15787 // more information. 15788 // 15789 // $hash=21354bc7b20a18eb0c25d2aa0abf1211fd9ebcaa$ 15790 // 15791 15792 extern (C): 15793 15794 /// 15795 /// Structure used to represent a web response. The functions of this structure 15796 /// may be called on any thread. 15797 /// 15798 struct cef_response_t 15799 { 15800 /// 15801 /// Base structure. 15802 /// 15803 cef_base_ref_counted_t base; 15804 15805 /// 15806 /// Returns true (1) if this object is read-only. 15807 /// 15808 extern(System) int function (cef_response_t* self) nothrow is_read_only; 15809 15810 /// 15811 /// Get the response error code. Returns ERR_NONE if there was no error. 15812 /// 15813 extern(System) cef_errorcode_t function (cef_response_t* self) nothrow get_error; 15814 15815 /// 15816 /// Set the response error code. This can be used by custom scheme handlers to 15817 /// return errors during initial request processing. 15818 /// 15819 extern(System) void function (cef_response_t* self, cef_errorcode_t error) nothrow set_error; 15820 15821 /// 15822 /// Get the response status code. 15823 /// 15824 extern(System) int function (cef_response_t* self) nothrow get_status; 15825 15826 /// 15827 /// Set the response status code. 15828 /// 15829 extern(System) void function (cef_response_t* self, int status) nothrow set_status; 15830 15831 /// 15832 /// Get the response status text. 15833 /// 15834 // The resulting string must be freed by calling cef_string_userfree_free(). 15835 extern(System) cef_string_userfree_t function (cef_response_t* self) nothrow get_status_text; 15836 15837 /// 15838 /// Set the response status text. 15839 /// 15840 extern(System) void function ( 15841 cef_response_t* self, 15842 const(cef_string_t)* statusText) nothrow set_status_text; 15843 15844 /// 15845 /// Get the response mime type. 15846 /// 15847 // The resulting string must be freed by calling cef_string_userfree_free(). 15848 extern(System) cef_string_userfree_t function (cef_response_t* self) nothrow get_mime_type; 15849 15850 /// 15851 /// Set the response mime type. 15852 /// 15853 extern(System) void function ( 15854 cef_response_t* self, 15855 const(cef_string_t)* mimeType) nothrow set_mime_type; 15856 15857 /// 15858 /// Get the response charset. 15859 /// 15860 // The resulting string must be freed by calling cef_string_userfree_free(). 15861 extern(System) cef_string_userfree_t function (cef_response_t* self) nothrow get_charset; 15862 15863 /// 15864 /// Set the response charset. 15865 /// 15866 extern(System) void function ( 15867 cef_response_t* self, 15868 const(cef_string_t)* charset) nothrow set_charset; 15869 15870 /// 15871 /// Get the value for the specified response header field. 15872 /// 15873 // The resulting string must be freed by calling cef_string_userfree_free(). 15874 extern(System) cef_string_userfree_t function ( 15875 cef_response_t* self, 15876 const(cef_string_t)* name) nothrow get_header_by_name; 15877 15878 /// 15879 /// Set the header |name| to |value|. If |overwrite| is true (1) any existing 15880 /// values will be replaced with the new value. If |overwrite| is false (0) 15881 /// any existing values will not be overwritten. 15882 /// 15883 extern(System) void function ( 15884 cef_response_t* self, 15885 const(cef_string_t)* name, 15886 const(cef_string_t)* value, 15887 int overwrite) nothrow set_header_by_name; 15888 15889 /// 15890 /// Get all response header fields. 15891 /// 15892 extern(System) void function ( 15893 cef_response_t* self, 15894 cef_string_multimap_t headerMap) nothrow get_header_map; 15895 15896 /// 15897 /// Set all response header fields. 15898 /// 15899 extern(System) void function ( 15900 cef_response_t* self, 15901 cef_string_multimap_t headerMap) nothrow set_header_map; 15902 15903 /// 15904 /// Get the resolved URL after redirects or changed as a result of HSTS. 15905 /// 15906 // The resulting string must be freed by calling cef_string_userfree_free(). 15907 extern(System) cef_string_userfree_t function (cef_response_t* self) nothrow get_url; 15908 15909 /// 15910 /// Set the resolved URL after redirects or changed as a result of HSTS. 15911 /// 15912 extern(System) void function (cef_response_t* self, const(cef_string_t)* url) nothrow set_url; 15913 } 15914 15915 15916 15917 /// 15918 /// Create a new cef_response_t object. 15919 /// 15920 cef_response_t* cef_response_create (); 15921 15922 // CEF_INCLUDE_CAPI_CEF_RESPONSE_CAPI_H_ 15923 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 15924 // 15925 // Redistribution and use in source and binary forms, with or without 15926 // modification, are permitted provided that the following conditions are 15927 // met: 15928 // 15929 // * Redistributions of source code must retain the above copyright 15930 // notice, this list of conditions and the following disclaimer. 15931 // * Redistributions in binary form must reproduce the above 15932 // copyright notice, this list of conditions and the following disclaimer 15933 // in the documentation and/or other materials provided with the 15934 // distribution. 15935 // * Neither the name of Google Inc. nor the name Chromium Embedded 15936 // Framework nor the names of its contributors may be used to endorse 15937 // or promote products derived from this software without specific prior 15938 // written permission. 15939 // 15940 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 15941 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 15942 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 15943 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 15944 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 15945 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 15946 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 15947 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 15948 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 15949 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 15950 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15951 // 15952 // --------------------------------------------------------------------------- 15953 // 15954 // This file was generated by the CEF translator tool and should not edited 15955 // by hand. See the translator.README.txt file in the tools directory for 15956 // more information. 15957 // 15958 // $hash=cbcb379f7ed86b58e271089a4117267a50f72814$ 15959 // 15960 15961 extern (C): 15962 15963 /// 15964 /// Implement this structure to filter resource response content. The functions 15965 /// of this structure will be called on the browser process IO thread. 15966 /// 15967 struct cef_response_filter_t 15968 { 15969 /// 15970 /// Base structure. 15971 /// 15972 cef_base_ref_counted_t base; 15973 15974 /// 15975 /// Initialize the response filter. Will only be called a single time. The 15976 /// filter will not be installed if this function returns false (0). 15977 /// 15978 extern(System) int function (cef_response_filter_t* self) nothrow init_filter; 15979 15980 /// 15981 /// Called to filter a chunk of data. Expected usage is as follows: 15982 /// 15983 /// 1. Read input data from |data_in| and set |data_in_read| to the number of 15984 /// bytes that were read up to a maximum of |data_in_size|. |data_in| will 15985 /// be NULL if |data_in_size| is zero. 15986 /// 2. Write filtered output data to |data_out| and set |data_out_written| to 15987 /// the number of bytes that were written up to a maximum of 15988 /// |data_out_size|. If no output data was written then all data must be 15989 /// read from |data_in| (user must set |data_in_read| = |data_in_size|). 15990 /// 3. Return RESPONSE_FILTER_DONE if all output data was written or 15991 /// RESPONSE_FILTER_NEED_MORE_DATA if output data is still pending. 15992 /// 15993 /// This function will be called repeatedly until the input buffer has been 15994 /// fully read (user sets |data_in_read| = |data_in_size|) and there is no 15995 /// more input data to filter (the resource response is complete). This 15996 /// function may then be called an additional time with an NULL input buffer 15997 /// if the user filled the output buffer (set |data_out_written| = 15998 /// |data_out_size|) and returned RESPONSE_FILTER_NEED_MORE_DATA to indicate 15999 /// that output data is still pending. 16000 /// 16001 /// Calls to this function will stop when one of the following conditions is 16002 /// met: 16003 /// 16004 /// 1. There is no more input data to filter (the resource response is 16005 /// complete) and the user sets |data_out_written| = 0 or returns 16006 /// RESPONSE_FILTER_DONE to indicate that all data has been written, or; 16007 /// 2. The user returns RESPONSE_FILTER_ERROR to indicate an error. 16008 /// 16009 /// Do not keep a reference to the buffers passed to this function. 16010 /// 16011 extern(System) cef_response_filter_status_t function ( 16012 cef_response_filter_t* self, 16013 void* data_in, 16014 size_t data_in_size, 16015 size_t* data_in_read, 16016 void* data_out, 16017 size_t data_out_size, 16018 size_t* data_out_written) nothrow filter; 16019 } 16020 16021 16022 16023 // CEF_INCLUDE_CAPI_CEF_RESPONSE_FILTER_CAPI_H_ 16024 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 16025 // 16026 // Redistribution and use in source and binary forms, with or without 16027 // modification, are permitted provided that the following conditions are 16028 // met: 16029 // 16030 // * Redistributions of source code must retain the above copyright 16031 // notice, this list of conditions and the following disclaimer. 16032 // * Redistributions in binary form must reproduce the above 16033 // copyright notice, this list of conditions and the following disclaimer 16034 // in the documentation and/or other materials provided with the 16035 // distribution. 16036 // * Neither the name of Google Inc. nor the name Chromium Embedded 16037 // Framework nor the names of its contributors may be used to endorse 16038 // or promote products derived from this software without specific prior 16039 // written permission. 16040 // 16041 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 16042 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 16043 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 16044 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 16045 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 16046 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 16047 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 16048 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 16049 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 16050 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 16051 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 16052 // 16053 // --------------------------------------------------------------------------- 16054 // 16055 // This file was generated by the CEF translator tool and should not edited 16056 // by hand. See the translator.README.txt file in the tools directory for 16057 // more information. 16058 // 16059 // $hash=1b6cd9a13f93867b1f20418bfa4c7db8b5e6725d$ 16060 // 16061 16062 extern (C): 16063 16064 /// 16065 /// Structure that manages custom scheme registrations. 16066 /// 16067 struct cef_scheme_registrar_t 16068 { 16069 /// 16070 /// Base structure. 16071 /// 16072 cef_base_scoped_t base; 16073 16074 /// 16075 /// Register a custom scheme. This function should not be called for the 16076 /// built-in HTTP, HTTPS, FILE, FTP, ABOUT and DATA schemes. 16077 /// 16078 /// See cef_scheme_options_t for possible values for |options|. 16079 /// 16080 /// This function may be called on any thread. It should only be called once 16081 /// per unique |scheme_name| value. If |scheme_name| is already registered or 16082 /// if an error occurs this function will return false (0). 16083 /// 16084 extern(System) int function ( 16085 cef_scheme_registrar_t* self, 16086 const(cef_string_t)* scheme_name, 16087 int options) nothrow add_custom_scheme; 16088 } 16089 16090 16091 16092 /// 16093 /// Structure that creates cef_resource_handler_t instances for handling scheme 16094 /// requests. The functions of this structure will always be called on the IO 16095 /// thread. 16096 /// 16097 struct cef_scheme_handler_factory_t 16098 { 16099 /// 16100 /// Base structure. 16101 /// 16102 cef_base_ref_counted_t base; 16103 16104 /// 16105 /// Return a new resource handler instance to handle the request or an NULL 16106 /// reference to allow default handling of the request. |browser| and |frame| 16107 /// will be the browser window and frame respectively that originated the 16108 /// request or NULL if the request did not originate from a browser window 16109 /// (for example, if the request came from cef_urlrequest_t). The |request| 16110 /// object passed to this function cannot be modified. 16111 /// 16112 extern(System) cef_resource_handler_t* function ( 16113 cef_scheme_handler_factory_t* self, 16114 cef_browser_t* browser, 16115 cef_frame_t* frame, 16116 const(cef_string_t)* scheme_name, 16117 cef_request_t* request) nothrow create; 16118 } 16119 16120 16121 16122 /// 16123 /// Register a scheme handler factory with the global request context. An NULL 16124 /// |domain_name| value for a standard scheme will cause the factory to match 16125 /// all domain names. The |domain_name| value will be ignored for non-standard 16126 /// schemes. If |scheme_name| is a built-in scheme and no handler is returned by 16127 /// |factory| then the built-in scheme handler factory will be called. If 16128 /// |scheme_name| is a custom scheme then you must also implement the 16129 /// cef_app_t::on_register_custom_schemes() function in all processes. This 16130 /// function may be called multiple times to change or remove the factory that 16131 /// matches the specified |scheme_name| and optional |domain_name|. Returns 16132 /// false (0) if an error occurs. This function may be called on any thread in 16133 /// the browser process. Using this function is equivalent to calling cef_reques 16134 /// t_context_t::cef_request_context_get_global_context()->register_scheme_handl 16135 /// er_factory(). 16136 /// 16137 int cef_register_scheme_handler_factory ( 16138 const(cef_string_t)* scheme_name, 16139 const(cef_string_t)* domain_name, 16140 cef_scheme_handler_factory_t* factory); 16141 16142 /// 16143 /// Clear all scheme handler factories registered with the global request 16144 /// context. Returns false (0) on error. This function may be called on any 16145 /// thread in the browser process. Using this function is equivalent to calling 16146 /// cef_request_context_t::cef_request_context_get_global_context()->clear_schem 16147 /// e_handler_factories(). 16148 /// 16149 int cef_clear_scheme_handler_factories (); 16150 16151 // CEF_INCLUDE_CAPI_CEF_SCHEME_CAPI_H_ 16152 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 16153 // 16154 // Redistribution and use in source and binary forms, with or without 16155 // modification, are permitted provided that the following conditions are 16156 // met: 16157 // 16158 // * Redistributions of source code must retain the above copyright 16159 // notice, this list of conditions and the following disclaimer. 16160 // * Redistributions in binary form must reproduce the above 16161 // copyright notice, this list of conditions and the following disclaimer 16162 // in the documentation and/or other materials provided with the 16163 // distribution. 16164 // * Neither the name of Google Inc. nor the name Chromium Embedded 16165 // Framework nor the names of its contributors may be used to endorse 16166 // or promote products derived from this software without specific prior 16167 // written permission. 16168 // 16169 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 16170 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 16171 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 16172 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 16173 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 16174 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 16175 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 16176 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 16177 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 16178 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 16179 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 16180 // 16181 // --------------------------------------------------------------------------- 16182 // 16183 // This file was generated by the CEF translator tool and should not edited 16184 // by hand. See the translator.README.txt file in the tools directory for 16185 // more information. 16186 // 16187 // $hash=4d76765604a96b026076f1c930a33d616f23b4ad$ 16188 // 16189 16190 extern (C): 16191 16192 /// 16193 /// Structure representing a server that supports HTTP and WebSocket requests. 16194 /// Server capacity is limited and is intended to handle only a small number of 16195 /// simultaneous connections (e.g. for communicating between applications on 16196 /// localhost). The functions of this structure are safe to call from any thread 16197 /// in the brower process unless otherwise indicated. 16198 /// 16199 struct cef_server_t 16200 { 16201 /// 16202 /// Base structure. 16203 /// 16204 cef_base_ref_counted_t base; 16205 16206 /// 16207 /// Returns the task runner for the dedicated server thread. 16208 /// 16209 extern(System) cef_task_runner_t* function (cef_server_t* self) nothrow get_task_runner; 16210 16211 /// 16212 /// Stop the server and shut down the dedicated server thread. See 16213 /// cef_server_handler_t::OnServerCreated documentation for a description of 16214 /// server lifespan. 16215 /// 16216 extern(System) void function (cef_server_t* self) nothrow shutdown; 16217 16218 /// 16219 /// Returns true (1) if the server is currently running and accepting incoming 16220 /// connections. See cef_server_handler_t::OnServerCreated documentation for a 16221 /// description of server lifespan. This function must be called on the 16222 /// dedicated server thread. 16223 /// 16224 extern(System) int function (cef_server_t* self) nothrow is_running; 16225 16226 /// 16227 /// Returns the server address including the port number. 16228 /// 16229 // The resulting string must be freed by calling cef_string_userfree_free(). 16230 extern(System) cef_string_userfree_t function (cef_server_t* self) nothrow get_address; 16231 16232 /// 16233 /// Returns true (1) if the server currently has a connection. This function 16234 /// must be called on the dedicated server thread. 16235 /// 16236 extern(System) int function (cef_server_t* self) nothrow has_connection; 16237 16238 /// 16239 /// Returns true (1) if |connection_id| represents a valid connection. This 16240 /// function must be called on the dedicated server thread. 16241 /// 16242 extern(System) int function (cef_server_t* self, int connection_id) nothrow is_valid_connection; 16243 16244 /// 16245 /// Send an HTTP 200 "OK" response to the connection identified by 16246 /// |connection_id|. |content_type| is the response content type (e.g. 16247 /// "text/html"), |data| is the response content, and |data_size| is the size 16248 /// of |data| in bytes. The contents of |data| will be copied. The connection 16249 /// will be closed automatically after the response is sent. 16250 /// 16251 extern(System) void function ( 16252 cef_server_t* self, 16253 int connection_id, 16254 const(cef_string_t)* content_type, 16255 const(void)* data, 16256 size_t data_size) nothrow send_http200response; 16257 16258 /// 16259 /// Send an HTTP 404 "Not Found" response to the connection identified by 16260 /// |connection_id|. The connection will be closed automatically after the 16261 /// response is sent. 16262 /// 16263 extern(System) void function ( 16264 cef_server_t* self, 16265 int connection_id) nothrow send_http404response; 16266 16267 /// 16268 /// Send an HTTP 500 "Internal Server Error" response to the connection 16269 /// identified by |connection_id|. |error_message| is the associated error 16270 /// message. The connection will be closed automatically after the response is 16271 /// sent. 16272 /// 16273 extern(System) void function ( 16274 cef_server_t* self, 16275 int connection_id, 16276 const(cef_string_t)* error_message) nothrow send_http500response; 16277 16278 /// 16279 /// Send a custom HTTP response to the connection identified by 16280 /// |connection_id|. |response_code| is the HTTP response code sent in the 16281 /// status line (e.g. 200), |content_type| is the response content type sent 16282 /// as the "Content-Type" header (e.g. "text/html"), |content_length| is the 16283 /// expected content length, and |extra_headers| is the map of extra response 16284 /// headers. If |content_length| is >= 0 then the "Content-Length" header will 16285 /// be sent. If |content_length| is 0 then no content is expected and the 16286 /// connection will be closed automatically after the response is sent. If 16287 /// |content_length| is < 0 then no "Content-Length" header will be sent and 16288 /// the client will continue reading until the connection is closed. Use the 16289 /// SendRawData function to send the content, if applicable, and call 16290 /// CloseConnection after all content has been sent. 16291 /// 16292 extern(System) void function ( 16293 cef_server_t* self, 16294 int connection_id, 16295 int response_code, 16296 const(cef_string_t)* content_type, 16297 int64 content_length, 16298 cef_string_multimap_t extra_headers) nothrow send_http_response; 16299 16300 /// 16301 /// Send raw data directly to the connection identified by |connection_id|. 16302 /// |data| is the raw data and |data_size| is the size of |data| in bytes. The 16303 /// contents of |data| will be copied. No validation of |data| is performed 16304 /// internally so the client should be careful to send the amount indicated by 16305 /// the "Content-Length" header, if specified. See SendHttpResponse 16306 /// documentation for intended usage. 16307 /// 16308 extern(System) void function ( 16309 cef_server_t* self, 16310 int connection_id, 16311 const(void)* data, 16312 size_t data_size) nothrow send_raw_data; 16313 16314 /// 16315 /// Close the connection identified by |connection_id|. See SendHttpResponse 16316 /// documentation for intended usage. 16317 /// 16318 extern(System) void function (cef_server_t* self, int connection_id) nothrow close_connection; 16319 16320 /// 16321 /// Send a WebSocket message to the connection identified by |connection_id|. 16322 /// |data| is the response content and |data_size| is the size of |data| in 16323 /// bytes. The contents of |data| will be copied. See 16324 /// cef_server_handler_t::OnWebSocketRequest documentation for intended usage. 16325 /// 16326 extern(System) void function ( 16327 cef_server_t* self, 16328 int connection_id, 16329 const(void)* data, 16330 size_t data_size) nothrow send_web_socket_message; 16331 } 16332 16333 16334 16335 /// 16336 /// Create a new server that binds to |address| and |port|. |address| must be a 16337 /// valid IPv4 or IPv6 address (e.g. 127.0.0.1 or ::1) and |port| must be a port 16338 /// number outside of the reserved range (e.g. between 1025 and 65535 on most 16339 /// platforms). |backlog| is the maximum number of pending connections. A new 16340 /// thread will be created for each CreateServer call (the "dedicated server 16341 /// thread"). It is therefore recommended to use a different 16342 /// cef_server_handler_t instance for each CreateServer call to avoid thread 16343 /// safety issues in the cef_server_handler_t implementation. The 16344 /// cef_server_handler_t::OnServerCreated function will be called on the 16345 /// dedicated server thread to report success or failure. See 16346 /// cef_server_handler_t::OnServerCreated documentation for a description of 16347 /// server lifespan. 16348 /// 16349 void cef_server_create ( 16350 const(cef_string_t)* address, 16351 uint16 port, 16352 int backlog, 16353 cef_server_handler_t* handler); 16354 16355 /// 16356 /// Implement this structure to handle HTTP server requests. A new thread will 16357 /// be created for each cef_server_t::CreateServer call (the "dedicated server 16358 /// thread"), and the functions of this structure will be called on that thread. 16359 /// It is therefore recommended to use a different cef_server_handler_t instance 16360 /// for each cef_server_t::CreateServer call to avoid thread safety issues in 16361 /// the cef_server_handler_t implementation. 16362 /// 16363 struct cef_server_handler_t 16364 { 16365 /// 16366 /// Base structure. 16367 /// 16368 cef_base_ref_counted_t base; 16369 16370 /// 16371 /// Called when |server| is created. If the server was started successfully 16372 /// then cef_server_t::IsRunning will return true (1). The server will 16373 /// continue running until cef_server_t::Shutdown is called, after which time 16374 /// OnServerDestroyed will be called. If the server failed to start then 16375 /// OnServerDestroyed will be called immediately after this function returns. 16376 /// 16377 extern(System) void function ( 16378 cef_server_handler_t* self, 16379 cef_server_t* server) nothrow on_server_created; 16380 16381 /// 16382 /// Called when |server| is destroyed. The server thread will be stopped after 16383 /// this function returns. The client should release any references to 16384 /// |server| when this function is called. See OnServerCreated documentation 16385 /// for a description of server lifespan. 16386 /// 16387 extern(System) void function ( 16388 cef_server_handler_t* self, 16389 cef_server_t* server) nothrow on_server_destroyed; 16390 16391 /// 16392 /// Called when a client connects to |server|. |connection_id| uniquely 16393 /// identifies the connection. Each call to this function will have a matching 16394 /// call to OnClientDisconnected. 16395 /// 16396 extern(System) void function ( 16397 cef_server_handler_t* self, 16398 cef_server_t* server, 16399 int connection_id) nothrow on_client_connected; 16400 16401 /// 16402 /// Called when a client disconnects from |server|. |connection_id| uniquely 16403 /// identifies the connection. The client should release any data associated 16404 /// with |connection_id| when this function is called and |connection_id| 16405 /// should no longer be passed to cef_server_t functions. Disconnects can 16406 /// originate from either the client or the server. For example, the server 16407 /// will disconnect automatically after a cef_server_t::SendHttpXXXResponse 16408 /// function is called. 16409 /// 16410 extern(System) void function ( 16411 cef_server_handler_t* self, 16412 cef_server_t* server, 16413 int connection_id) nothrow on_client_disconnected; 16414 16415 /// 16416 /// Called when |server| receives an HTTP request. |connection_id| uniquely 16417 /// identifies the connection, |client_address| is the requesting IPv4 or IPv6 16418 /// client address including port number, and |request| contains the request 16419 /// contents (URL, function, headers and optional POST data). Call 16420 /// cef_server_t functions either synchronously or asynchronusly to send a 16421 /// response. 16422 /// 16423 extern(System) void function ( 16424 cef_server_handler_t* self, 16425 cef_server_t* server, 16426 int connection_id, 16427 const(cef_string_t)* client_address, 16428 cef_request_t* request) nothrow on_http_request; 16429 16430 /// 16431 /// Called when |server| receives a WebSocket request. |connection_id| 16432 /// uniquely identifies the connection, |client_address| is the requesting 16433 /// IPv4 or IPv6 client address including port number, and |request| contains 16434 /// the request contents (URL, function, headers and optional POST data). 16435 /// Execute |callback| either synchronously or asynchronously to accept or 16436 /// decline the WebSocket connection. If the request is accepted then 16437 /// OnWebSocketConnected will be called after the WebSocket has connected and 16438 /// incoming messages will be delivered to the OnWebSocketMessage callback. If 16439 /// the request is declined then the client will be disconnected and 16440 /// OnClientDisconnected will be called. Call the 16441 /// cef_server_t::SendWebSocketMessage function after receiving the 16442 /// OnWebSocketConnected callback to respond with WebSocket messages. 16443 /// 16444 extern(System) void function ( 16445 cef_server_handler_t* self, 16446 cef_server_t* server, 16447 int connection_id, 16448 const(cef_string_t)* client_address, 16449 cef_request_t* request, 16450 cef_callback_t* callback) nothrow on_web_socket_request; 16451 16452 /// 16453 /// Called after the client has accepted the WebSocket connection for |server| 16454 /// and |connection_id| via the OnWebSocketRequest callback. See 16455 /// OnWebSocketRequest documentation for intended usage. 16456 /// 16457 extern(System) void function ( 16458 cef_server_handler_t* self, 16459 cef_server_t* server, 16460 int connection_id) nothrow on_web_socket_connected; 16461 16462 /// 16463 /// Called when |server| receives an WebSocket message. |connection_id| 16464 /// uniquely identifies the connection, |data| is the message content and 16465 /// |data_size| is the size of |data| in bytes. Do not keep a reference to 16466 /// |data| outside of this function. See OnWebSocketRequest documentation for 16467 /// intended usage. 16468 /// 16469 extern(System) void function ( 16470 cef_server_handler_t* self, 16471 cef_server_t* server, 16472 int connection_id, 16473 const(void)* data, 16474 size_t data_size) nothrow on_web_socket_message; 16475 } 16476 16477 16478 16479 // CEF_INCLUDE_CAPI_CEF_SERVER_CAPI_H_ 16480 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 16481 // 16482 // Redistribution and use in source and binary forms, with or without 16483 // modification, are permitted provided that the following conditions are 16484 // met: 16485 // 16486 // * Redistributions of source code must retain the above copyright 16487 // notice, this list of conditions and the following disclaimer. 16488 // * Redistributions in binary form must reproduce the above 16489 // copyright notice, this list of conditions and the following disclaimer 16490 // in the documentation and/or other materials provided with the 16491 // distribution. 16492 // * Neither the name of Google Inc. nor the name Chromium Embedded 16493 // Framework nor the names of its contributors may be used to endorse 16494 // or promote products derived from this software without specific prior 16495 // written permission. 16496 // 16497 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 16498 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 16499 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 16500 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 16501 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 16502 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 16503 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 16504 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 16505 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 16506 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 16507 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 16508 // 16509 // --------------------------------------------------------------------------- 16510 // 16511 // This file was generated by the CEF translator tool and should not edited 16512 // by hand. See the translator.README.txt file in the tools directory for 16513 // more information. 16514 // 16515 // $hash=5f69190b21f9fa17e6fb4c2284968f8ec5b147ed$ 16516 // 16517 16518 extern (C): 16519 16520 /// 16521 /// Structure that wraps platform-dependent share memory region mapping. 16522 /// 16523 struct cef_shared_memory_region_t 16524 { 16525 /// 16526 /// Base structure. 16527 /// 16528 cef_base_ref_counted_t base; 16529 16530 /// 16531 /// Returns true (1) if the mapping is valid. 16532 /// 16533 extern(System) int function (cef_shared_memory_region_t* self) nothrow is_valid; 16534 16535 /// 16536 /// Returns the size of the mapping in bytes. Returns 0 for invalid instances. 16537 /// 16538 extern(System) size_t function (cef_shared_memory_region_t* self) nothrow size; 16539 16540 /// 16541 /// Returns the pointer to the memory. Returns nullptr for invalid instances. 16542 /// The returned pointer is only valid for the life span of this object. 16543 /// 16544 extern(System) const(void)* function (cef_shared_memory_region_t* self) nothrow memory; 16545 } 16546 16547 16548 16549 // CEF_INCLUDE_CAPI_CEF_SHARED_MEMORY_REGION_CAPI_H_ 16550 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 16551 // 16552 // Redistribution and use in source and binary forms, with or without 16553 // modification, are permitted provided that the following conditions are 16554 // met: 16555 // 16556 // * Redistributions of source code must retain the above copyright 16557 // notice, this list of conditions and the following disclaimer. 16558 // * Redistributions in binary form must reproduce the above 16559 // copyright notice, this list of conditions and the following disclaimer 16560 // in the documentation and/or other materials provided with the 16561 // distribution. 16562 // * Neither the name of Google Inc. nor the name Chromium Embedded 16563 // Framework nor the names of its contributors may be used to endorse 16564 // or promote products derived from this software without specific prior 16565 // written permission. 16566 // 16567 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 16568 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 16569 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 16570 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 16571 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 16572 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 16573 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 16574 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 16575 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 16576 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 16577 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 16578 // 16579 // --------------------------------------------------------------------------- 16580 // 16581 // This file was generated by the CEF translator tool and should not edited 16582 // by hand. See the translator.README.txt file in the tools directory for 16583 // more information. 16584 // 16585 // $hash=66198e92ec123e753bb427a0b92d73672610136e$ 16586 // 16587 16588 extern (C): 16589 16590 /// 16591 /// Structure that builds a cef_process_message_t containing a shared memory 16592 /// region. This structure is not thread-safe but may be used exclusively on a 16593 /// different thread from the one which constructed it. 16594 /// 16595 struct cef_shared_process_message_builder_t 16596 { 16597 /// 16598 /// Base structure. 16599 /// 16600 cef_base_ref_counted_t base; 16601 16602 /// 16603 /// Returns true (1) if the builder is valid. 16604 /// 16605 extern(System) int function (cef_shared_process_message_builder_t* self) nothrow is_valid; 16606 16607 /// 16608 /// Returns the size of the shared memory region in bytes. Returns 0 for 16609 /// invalid instances. 16610 /// 16611 extern(System) size_t function (cef_shared_process_message_builder_t* self) nothrow size; 16612 16613 /// 16614 /// Returns the pointer to the writable memory. Returns nullptr for invalid 16615 /// instances. The returned pointer is only valid for the life span of this 16616 /// object. 16617 /// 16618 extern(System) void* function (cef_shared_process_message_builder_t* self) nothrow memory; 16619 16620 /// 16621 /// Creates a new cef_process_message_t from the data provided to the builder. 16622 /// Returns nullptr for invalid instances. Invalidates the builder instance. 16623 /// 16624 extern(System) cef_process_message_t* function ( 16625 cef_shared_process_message_builder_t* self) nothrow build; 16626 } 16627 16628 16629 16630 /// 16631 /// Creates a new cef_shared_process_message_builder_t with the specified |name| 16632 /// and shared memory region of specified |byte_size|. 16633 /// 16634 cef_shared_process_message_builder_t* cef_shared_process_message_builder_create ( 16635 const(cef_string_t)* name, 16636 size_t byte_size); 16637 16638 // CEF_INCLUDE_CAPI_CEF_SHARED_PROCESS_MESSAGE_BUILDER_CAPI_H_ 16639 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 16640 // 16641 // Redistribution and use in source and binary forms, with or without 16642 // modification, are permitted provided that the following conditions are 16643 // met: 16644 // 16645 // * Redistributions of source code must retain the above copyright 16646 // notice, this list of conditions and the following disclaimer. 16647 // * Redistributions in binary form must reproduce the above 16648 // copyright notice, this list of conditions and the following disclaimer 16649 // in the documentation and/or other materials provided with the 16650 // distribution. 16651 // * Neither the name of Google Inc. nor the name Chromium Embedded 16652 // Framework nor the names of its contributors may be used to endorse 16653 // or promote products derived from this software without specific prior 16654 // written permission. 16655 // 16656 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 16657 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 16658 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 16659 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 16660 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 16661 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 16662 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 16663 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 16664 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 16665 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 16666 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 16667 // 16668 // --------------------------------------------------------------------------- 16669 // 16670 // This file was generated by the CEF translator tool and should not edited 16671 // by hand. See the translator.README.txt file in the tools directory for 16672 // more information. 16673 // 16674 // $hash=64d6affe3e8e45869403f829c2aa86026773a17b$ 16675 // 16676 16677 extern (C): 16678 16679 /// 16680 /// Structure representing SSL information. 16681 /// 16682 struct cef_sslinfo_t 16683 { 16684 /// 16685 /// Base structure. 16686 /// 16687 cef_base_ref_counted_t base; 16688 16689 /// 16690 /// Returns a bitmask containing any and all problems verifying the server 16691 /// certificate. 16692 /// 16693 extern(System) cef_cert_status_t function (cef_sslinfo_t* self) nothrow get_cert_status; 16694 16695 /// 16696 /// Returns the X.509 certificate. 16697 /// 16698 extern(System) cef_x509certificate_t* function ( 16699 cef_sslinfo_t* self) nothrow get_x509certificate; 16700 } 16701 16702 16703 16704 /// 16705 /// Returns true (1) if the certificate status represents an error. 16706 /// 16707 int cef_is_cert_status_error (cef_cert_status_t status); 16708 16709 // CEF_INCLUDE_CAPI_CEF_SSL_INFO_CAPI_H_ 16710 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 16711 // 16712 // Redistribution and use in source and binary forms, with or without 16713 // modification, are permitted provided that the following conditions are 16714 // met: 16715 // 16716 // * Redistributions of source code must retain the above copyright 16717 // notice, this list of conditions and the following disclaimer. 16718 // * Redistributions in binary form must reproduce the above 16719 // copyright notice, this list of conditions and the following disclaimer 16720 // in the documentation and/or other materials provided with the 16721 // distribution. 16722 // * Neither the name of Google Inc. nor the name Chromium Embedded 16723 // Framework nor the names of its contributors may be used to endorse 16724 // or promote products derived from this software without specific prior 16725 // written permission. 16726 // 16727 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 16728 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 16729 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 16730 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 16731 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 16732 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 16733 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 16734 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 16735 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 16736 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 16737 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 16738 // 16739 // --------------------------------------------------------------------------- 16740 // 16741 // This file was generated by the CEF translator tool and should not edited 16742 // by hand. See the translator.README.txt file in the tools directory for 16743 // more information. 16744 // 16745 // $hash=b40ab326a1bf140859db9288b809a4038833f014$ 16746 // 16747 16748 extern (C): 16749 16750 /// 16751 /// Structure representing the SSL information for a navigation entry. 16752 /// 16753 struct cef_sslstatus_t 16754 { 16755 /// 16756 /// Base structure. 16757 /// 16758 cef_base_ref_counted_t base; 16759 16760 /// 16761 /// Returns true (1) if the status is related to a secure SSL/TLS connection. 16762 /// 16763 extern(System) int function (cef_sslstatus_t* self) nothrow is_secure_connection; 16764 16765 /// 16766 /// Returns a bitmask containing any and all problems verifying the server 16767 /// certificate. 16768 /// 16769 extern(System) cef_cert_status_t function (cef_sslstatus_t* self) nothrow get_cert_status; 16770 16771 /// 16772 /// Returns the SSL version used for the SSL connection. 16773 /// 16774 extern(System) cef_ssl_version_t function (cef_sslstatus_t* self) nothrow get_sslversion; 16775 16776 /// 16777 /// Returns a bitmask containing the page security content status. 16778 /// 16779 extern(System) cef_ssl_content_status_t function ( 16780 cef_sslstatus_t* self) nothrow get_content_status; 16781 16782 /// 16783 /// Returns the X.509 certificate. 16784 /// 16785 extern(System) cef_x509certificate_t* function ( 16786 cef_sslstatus_t* self) nothrow get_x509certificate; 16787 } 16788 16789 16790 16791 // CEF_INCLUDE_CAPI_CEF_SSL_STATUS_CAPI_H_ 16792 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 16793 // 16794 // Redistribution and use in source and binary forms, with or without 16795 // modification, are permitted provided that the following conditions are 16796 // met: 16797 // 16798 // * Redistributions of source code must retain the above copyright 16799 // notice, this list of conditions and the following disclaimer. 16800 // * Redistributions in binary form must reproduce the above 16801 // copyright notice, this list of conditions and the following disclaimer 16802 // in the documentation and/or other materials provided with the 16803 // distribution. 16804 // * Neither the name of Google Inc. nor the name Chromium Embedded 16805 // Framework nor the names of its contributors may be used to endorse 16806 // or promote products derived from this software without specific prior 16807 // written permission. 16808 // 16809 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 16810 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 16811 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 16812 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 16813 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 16814 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 16815 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 16816 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 16817 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 16818 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 16819 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 16820 // 16821 // --------------------------------------------------------------------------- 16822 // 16823 // This file was generated by the CEF translator tool and should not edited 16824 // by hand. See the translator.README.txt file in the tools directory for 16825 // more information. 16826 // 16827 // $hash=9ccb4e6ea821c1b98adcc934429d2bf43cf9d8a2$ 16828 // 16829 16830 extern (C): 16831 16832 /// 16833 /// Structure the client can implement to provide a custom stream reader. The 16834 /// functions of this structure may be called on any thread. 16835 /// 16836 struct cef_read_handler_t 16837 { 16838 /// 16839 /// Base structure. 16840 /// 16841 cef_base_ref_counted_t base; 16842 16843 /// 16844 /// Read raw binary data. 16845 /// 16846 extern(System) size_t function ( 16847 cef_read_handler_t* self, 16848 void* ptr, 16849 size_t size, 16850 size_t n) nothrow read; 16851 16852 /// 16853 /// Seek to the specified offset position. |whence| may be any one of 16854 /// SEEK_CUR, SEEK_END or SEEK_SET. Return zero on success and non-zero on 16855 /// failure. 16856 /// 16857 extern(System) int function (cef_read_handler_t* self, int64 offset, int whence) nothrow seek; 16858 16859 /// 16860 /// Return the current offset position. 16861 /// 16862 extern(System) int64 function (cef_read_handler_t* self) nothrow tell; 16863 16864 /// 16865 /// Return non-zero if at end of file. 16866 /// 16867 extern(System) int function (cef_read_handler_t* self) nothrow eof; 16868 16869 /// 16870 /// Return true (1) if this handler performs work like accessing the file 16871 /// system which may block. Used as a hint for determining the thread to 16872 /// access the handler from. 16873 /// 16874 extern(System) int function (cef_read_handler_t* self) nothrow may_block; 16875 } 16876 16877 16878 16879 /// 16880 /// Structure used to read data from a stream. The functions of this structure 16881 /// may be called on any thread. 16882 /// 16883 struct cef_stream_reader_t 16884 { 16885 /// 16886 /// Base structure. 16887 /// 16888 cef_base_ref_counted_t base; 16889 16890 /// 16891 /// Read raw binary data. 16892 /// 16893 extern(System) size_t function ( 16894 cef_stream_reader_t* self, 16895 void* ptr, 16896 size_t size, 16897 size_t n) nothrow read; 16898 16899 /// 16900 /// Seek to the specified offset position. |whence| may be any one of 16901 /// SEEK_CUR, SEEK_END or SEEK_SET. Returns zero on success and non-zero on 16902 /// failure. 16903 /// 16904 extern(System) int function (cef_stream_reader_t* self, int64 offset, int whence) nothrow seek; 16905 16906 /// 16907 /// Return the current offset position. 16908 /// 16909 extern(System) int64 function (cef_stream_reader_t* self) nothrow tell; 16910 16911 /// 16912 /// Return non-zero if at end of file. 16913 /// 16914 extern(System) int function (cef_stream_reader_t* self) nothrow eof; 16915 16916 /// 16917 /// Returns true (1) if this reader performs work like accessing the file 16918 /// system which may block. Used as a hint for determining the thread to 16919 /// access the reader from. 16920 /// 16921 extern(System) int function (cef_stream_reader_t* self) nothrow may_block; 16922 } 16923 16924 16925 16926 /// 16927 /// Create a new cef_stream_reader_t object from a file. 16928 /// 16929 cef_stream_reader_t* cef_stream_reader_create_for_file ( 16930 const(cef_string_t)* fileName); 16931 16932 /// 16933 /// Create a new cef_stream_reader_t object from data. 16934 /// 16935 cef_stream_reader_t* cef_stream_reader_create_for_data ( 16936 void* data, 16937 size_t size); 16938 16939 /// 16940 /// Create a new cef_stream_reader_t object from a custom handler. 16941 /// 16942 cef_stream_reader_t* cef_stream_reader_create_for_handler ( 16943 cef_read_handler_t* handler); 16944 16945 /// 16946 /// Structure the client can implement to provide a custom stream writer. The 16947 /// functions of this structure may be called on any thread. 16948 /// 16949 struct cef_write_handler_t 16950 { 16951 /// 16952 /// Base structure. 16953 /// 16954 cef_base_ref_counted_t base; 16955 16956 /// 16957 /// Write raw binary data. 16958 /// 16959 extern(System) size_t function ( 16960 cef_write_handler_t* self, 16961 const(void)* ptr, 16962 size_t size, 16963 size_t n) nothrow write; 16964 16965 /// 16966 /// Seek to the specified offset position. |whence| may be any one of 16967 /// SEEK_CUR, SEEK_END or SEEK_SET. Return zero on success and non-zero on 16968 /// failure. 16969 /// 16970 extern(System) int function (cef_write_handler_t* self, int64 offset, int whence) nothrow seek; 16971 16972 /// 16973 /// Return the current offset position. 16974 /// 16975 extern(System) int64 function (cef_write_handler_t* self) nothrow tell; 16976 16977 /// 16978 /// Flush the stream. 16979 /// 16980 extern(System) int function (cef_write_handler_t* self) nothrow flush; 16981 16982 /// 16983 /// Return true (1) if this handler performs work like accessing the file 16984 /// system which may block. Used as a hint for determining the thread to 16985 /// access the handler from. 16986 /// 16987 extern(System) int function (cef_write_handler_t* self) nothrow may_block; 16988 } 16989 16990 16991 16992 /// 16993 /// Structure used to write data to a stream. The functions of this structure 16994 /// may be called on any thread. 16995 /// 16996 struct cef_stream_writer_t 16997 { 16998 /// 16999 /// Base structure. 17000 /// 17001 cef_base_ref_counted_t base; 17002 17003 /// 17004 /// Write raw binary data. 17005 /// 17006 extern(System) size_t function ( 17007 cef_stream_writer_t* self, 17008 const(void)* ptr, 17009 size_t size, 17010 size_t n) nothrow write; 17011 17012 /// 17013 /// Seek to the specified offset position. |whence| may be any one of 17014 /// SEEK_CUR, SEEK_END or SEEK_SET. Returns zero on success and non-zero on 17015 /// failure. 17016 /// 17017 extern(System) int function (cef_stream_writer_t* self, int64 offset, int whence) nothrow seek; 17018 17019 /// 17020 /// Return the current offset position. 17021 /// 17022 extern(System) int64 function (cef_stream_writer_t* self) nothrow tell; 17023 17024 /// 17025 /// Flush the stream. 17026 /// 17027 extern(System) int function (cef_stream_writer_t* self) nothrow flush; 17028 17029 /// 17030 /// Returns true (1) if this writer performs work like accessing the file 17031 /// system which may block. Used as a hint for determining the thread to 17032 /// access the writer from. 17033 /// 17034 extern(System) int function (cef_stream_writer_t* self) nothrow may_block; 17035 } 17036 17037 17038 17039 /// 17040 /// Create a new cef_stream_writer_t object for a file. 17041 /// 17042 cef_stream_writer_t* cef_stream_writer_create_for_file ( 17043 const(cef_string_t)* fileName); 17044 17045 /// 17046 /// Create a new cef_stream_writer_t object for a custom handler. 17047 /// 17048 cef_stream_writer_t* cef_stream_writer_create_for_handler ( 17049 cef_write_handler_t* handler); 17050 17051 // CEF_INCLUDE_CAPI_CEF_STREAM_CAPI_H_ 17052 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 17053 // 17054 // Redistribution and use in source and binary forms, with or without 17055 // modification, are permitted provided that the following conditions are 17056 // met: 17057 // 17058 // * Redistributions of source code must retain the above copyright 17059 // notice, this list of conditions and the following disclaimer. 17060 // * Redistributions in binary form must reproduce the above 17061 // copyright notice, this list of conditions and the following disclaimer 17062 // in the documentation and/or other materials provided with the 17063 // distribution. 17064 // * Neither the name of Google Inc. nor the name Chromium Embedded 17065 // Framework nor the names of its contributors may be used to endorse 17066 // or promote products derived from this software without specific prior 17067 // written permission. 17068 // 17069 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17070 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 17071 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 17072 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 17073 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 17074 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 17075 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 17076 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 17077 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 17078 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 17079 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 17080 // 17081 // --------------------------------------------------------------------------- 17082 // 17083 // This file was generated by the CEF translator tool and should not edited 17084 // by hand. See the translator.README.txt file in the tools directory for 17085 // more information. 17086 // 17087 // $hash=3940b4c999764eae305984a16c401e302aefddc6$ 17088 // 17089 17090 extern (C): 17091 17092 /// 17093 /// Implement this structure to receive string values asynchronously. 17094 /// 17095 struct cef_string_visitor_t 17096 { 17097 /// 17098 /// Base structure. 17099 /// 17100 cef_base_ref_counted_t base; 17101 17102 /// 17103 /// Method that will be executed. 17104 /// 17105 extern(System) void function ( 17106 cef_string_visitor_t* self, 17107 const(cef_string_t)* string) nothrow visit; 17108 } 17109 17110 17111 17112 // CEF_INCLUDE_CAPI_CEF_STRING_VISITOR_CAPI_H_ 17113 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 17114 // 17115 // Redistribution and use in source and binary forms, with or without 17116 // modification, are permitted provided that the following conditions are 17117 // met: 17118 // 17119 // * Redistributions of source code must retain the above copyright 17120 // notice, this list of conditions and the following disclaimer. 17121 // * Redistributions in binary form must reproduce the above 17122 // copyright notice, this list of conditions and the following disclaimer 17123 // in the documentation and/or other materials provided with the 17124 // distribution. 17125 // * Neither the name of Google Inc. nor the name Chromium Embedded 17126 // Framework nor the names of its contributors may be used to endorse 17127 // or promote products derived from this software without specific prior 17128 // written permission. 17129 // 17130 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17131 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 17132 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 17133 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 17134 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 17135 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 17136 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 17137 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 17138 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 17139 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 17140 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 17141 // 17142 // --------------------------------------------------------------------------- 17143 // 17144 // This file was generated by the CEF translator tool and should not edited 17145 // by hand. See the translator.README.txt file in the tools directory for 17146 // more information. 17147 // 17148 // $hash=a7a4bf5cd4bde87774b8300d25f12b057a5abf60$ 17149 // 17150 17151 extern (C): 17152 17153 /// 17154 /// Implement this structure for asynchronous task execution. If the task is 17155 /// posted successfully and if the associated message loop is still running then 17156 /// the execute() function will be called on the target thread. If the task 17157 /// fails to post then the task object may be destroyed on the source thread 17158 /// instead of the target thread. For this reason be cautious when performing 17159 /// work in the task object destructor. 17160 /// 17161 struct cef_task_t 17162 { 17163 /// 17164 /// Base structure. 17165 /// 17166 cef_base_ref_counted_t base; 17167 17168 /// 17169 /// Method that will be executed on the target thread. 17170 /// 17171 extern(System) void function (cef_task_t* self) nothrow execute; 17172 } 17173 17174 17175 17176 /// 17177 /// Structure that asynchronously executes tasks on the associated thread. It is 17178 /// safe to call the functions of this structure on any thread. 17179 /// 17180 /// CEF maintains multiple internal threads that are used for handling different 17181 /// types of tasks in different processes. The cef_thread_id_t definitions in 17182 /// cef_types.h list the common CEF threads. Task runners are also available for 17183 /// other CEF threads as appropriate (for example, V8 WebWorker threads). 17184 /// 17185 struct cef_task_runner_t 17186 { 17187 /// 17188 /// Base structure. 17189 /// 17190 cef_base_ref_counted_t base; 17191 17192 /// 17193 /// Returns true (1) if this object is pointing to the same task runner as 17194 /// |that| object. 17195 /// 17196 extern(System) int function (cef_task_runner_t* self, cef_task_runner_t* that) nothrow is_same; 17197 17198 /// 17199 /// Returns true (1) if this task runner belongs to the current thread. 17200 /// 17201 extern(System) int function (cef_task_runner_t* self) nothrow belongs_to_current_thread; 17202 17203 /// 17204 /// Returns true (1) if this task runner is for the specified CEF thread. 17205 /// 17206 extern(System) int function ( 17207 cef_task_runner_t* self, 17208 cef_thread_id_t threadId) nothrow belongs_to_thread; 17209 17210 /// 17211 /// Post a task for execution on the thread associated with this task runner. 17212 /// Execution will occur asynchronously. 17213 /// 17214 extern(System) int function (cef_task_runner_t* self, cef_task_t* task) nothrow post_task; 17215 17216 /// 17217 /// Post a task for delayed execution on the thread associated with this task 17218 /// runner. Execution will occur asynchronously. Delayed tasks are not 17219 /// supported on V8 WebWorker threads and will be executed without the 17220 /// specified delay. 17221 /// 17222 extern(System) int function ( 17223 cef_task_runner_t* self, 17224 cef_task_t* task, 17225 int64 delay_ms) nothrow post_delayed_task; 17226 } 17227 17228 17229 17230 /// 17231 /// Returns the task runner for the current thread. Only CEF threads will have 17232 /// task runners. An NULL reference will be returned if this function is called 17233 /// on an invalid thread. 17234 /// 17235 cef_task_runner_t* cef_task_runner_get_for_current_thread (); 17236 17237 /// 17238 /// Returns the task runner for the specified CEF thread. 17239 /// 17240 cef_task_runner_t* cef_task_runner_get_for_thread (cef_thread_id_t threadId); 17241 17242 /// 17243 /// Returns true (1) if called on the specified thread. Equivalent to using 17244 /// cef_task_runner_t::GetForThread(threadId)->belongs_to_current_thread(). 17245 /// 17246 int cef_currently_on (cef_thread_id_t threadId); 17247 17248 /// 17249 /// Post a task for execution on the specified thread. Equivalent to using 17250 /// cef_task_runner_t::GetForThread(threadId)->PostTask(task). 17251 /// 17252 int cef_post_task (cef_thread_id_t threadId, cef_task_t* task); 17253 17254 /// 17255 /// Post a task for delayed execution on the specified thread. Equivalent to 17256 /// using cef_task_runner_t::GetForThread(threadId)->PostDelayedTask(task, 17257 /// delay_ms). 17258 /// 17259 int cef_post_delayed_task ( 17260 cef_thread_id_t threadId, 17261 cef_task_t* task, 17262 int64 delay_ms); 17263 17264 // CEF_INCLUDE_CAPI_CEF_TASK_CAPI_H_ 17265 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 17266 // 17267 // Redistribution and use in source and binary forms, with or without 17268 // modification, are permitted provided that the following conditions are 17269 // met: 17270 // 17271 // * Redistributions of source code must retain the above copyright 17272 // notice, this list of conditions and the following disclaimer. 17273 // * Redistributions in binary form must reproduce the above 17274 // copyright notice, this list of conditions and the following disclaimer 17275 // in the documentation and/or other materials provided with the 17276 // distribution. 17277 // * Neither the name of Google Inc. nor the name Chromium Embedded 17278 // Framework nor the names of its contributors may be used to endorse 17279 // or promote products derived from this software without specific prior 17280 // written permission. 17281 // 17282 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17283 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 17284 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 17285 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 17286 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 17287 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 17288 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 17289 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 17290 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 17291 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 17292 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 17293 // 17294 // --------------------------------------------------------------------------- 17295 // 17296 // This file was generated by the CEF translator tool and should not edited 17297 // by hand. See the translator.README.txt file in the tools directory for 17298 // more information. 17299 // 17300 // $hash=b5b17f2a66283495e19978a5bbc36b47d9b61507$ 17301 // 17302 17303 extern (C): 17304 17305 /// 17306 /// A simple thread abstraction that establishes a message loop on a new thread. 17307 /// The consumer uses cef_task_runner_t to execute code on the thread's message 17308 /// loop. The thread is terminated when the cef_thread_t object is destroyed or 17309 /// stop() is called. All pending tasks queued on the thread's message loop will 17310 /// run to completion before the thread is terminated. cef_thread_create() can 17311 /// be called on any valid CEF thread in either the browser or render process. 17312 /// This structure should only be used for tasks that require a dedicated 17313 /// thread. In most cases you can post tasks to an existing CEF thread instead 17314 /// of creating a new one; see cef_task.h for details. 17315 /// 17316 struct cef_thread_t 17317 { 17318 /// 17319 /// Base structure. 17320 /// 17321 cef_base_ref_counted_t base; 17322 17323 /// 17324 /// Returns the cef_task_runner_t that will execute code on this thread's 17325 /// message loop. This function is safe to call from any thread. 17326 /// 17327 extern(System) cef_task_runner_t* function (cef_thread_t* self) nothrow get_task_runner; 17328 17329 /// 17330 /// Returns the platform thread ID. It will return the same value after stop() 17331 /// is called. This function is safe to call from any thread. 17332 /// 17333 extern(System) cef_platform_thread_id_t function ( 17334 cef_thread_t* self) nothrow get_platform_thread_id; 17335 17336 /// 17337 /// Stop and join the thread. This function must be called from the same 17338 /// thread that called cef_thread_create(). Do not call this function if 17339 /// cef_thread_create() was called with a |stoppable| value of false (0). 17340 /// 17341 extern(System) void function (cef_thread_t* self) nothrow stop; 17342 17343 /// 17344 /// Returns true (1) if the thread is currently running. This function must be 17345 /// called from the same thread that called cef_thread_create(). 17346 /// 17347 extern(System) int function (cef_thread_t* self) nothrow is_running; 17348 } 17349 17350 17351 17352 /// 17353 /// Create and start a new thread. This function does not block waiting for the 17354 /// thread to run initialization. |display_name| is the name that will be used 17355 /// to identify the thread. |priority| is the thread execution priority. 17356 /// |message_loop_type| indicates the set of asynchronous events that the thread 17357 /// can process. If |stoppable| is true (1) the thread will stopped and joined 17358 /// on destruction or when stop() is called; otherwise, the thread cannot be 17359 /// stopped and will be leaked on shutdown. On Windows the |com_init_mode| value 17360 /// specifies how COM will be initialized for the thread. If |com_init_mode| is 17361 /// set to COM_INIT_MODE_STA then |message_loop_type| must be set to ML_TYPE_UI. 17362 /// 17363 cef_thread_t* cef_thread_create ( 17364 const(cef_string_t)* display_name, 17365 cef_thread_priority_t priority, 17366 cef_message_loop_type_t message_loop_type, 17367 int stoppable, 17368 cef_com_init_mode_t com_init_mode); 17369 17370 // CEF_INCLUDE_CAPI_CEF_THREAD_CAPI_H_ 17371 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 17372 // 17373 // Redistribution and use in source and binary forms, with or without 17374 // modification, are permitted provided that the following conditions are 17375 // met: 17376 // 17377 // * Redistributions of source code must retain the above copyright 17378 // notice, this list of conditions and the following disclaimer. 17379 // * Redistributions in binary form must reproduce the above 17380 // copyright notice, this list of conditions and the following disclaimer 17381 // in the documentation and/or other materials provided with the 17382 // distribution. 17383 // * Neither the name of Google Inc. nor the name Chromium Embedded 17384 // Framework nor the names of its contributors may be used to endorse 17385 // or promote products derived from this software without specific prior 17386 // written permission. 17387 // 17388 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17389 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 17390 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 17391 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 17392 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 17393 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 17394 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 17395 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 17396 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 17397 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 17398 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 17399 // 17400 // --------------------------------------------------------------------------- 17401 // 17402 // This file was generated by the CEF translator tool and should not edited 17403 // by hand. See the translator.README.txt file in the tools directory for 17404 // more information. 17405 // 17406 // $hash=587514b02797f420da6ba13ba21c4344f41b56ce$ 17407 // 17408 17409 extern (C): 17410 17411 /// 17412 /// Implement this structure to receive notification when tracing has completed. 17413 /// The functions of this structure will be called on the browser process UI 17414 /// thread. 17415 /// 17416 struct cef_end_tracing_callback_t 17417 { 17418 /// 17419 /// Base structure. 17420 /// 17421 cef_base_ref_counted_t base; 17422 17423 /// 17424 /// Called after all processes have sent their trace data. |tracing_file| is 17425 /// the path at which tracing data was written. The client is responsible for 17426 /// deleting |tracing_file|. 17427 /// 17428 extern(System) void function ( 17429 cef_end_tracing_callback_t* self, 17430 const(cef_string_t)* tracing_file) nothrow on_end_tracing_complete; 17431 } 17432 17433 17434 17435 /// 17436 /// Start tracing events on all processes. Tracing is initialized asynchronously 17437 /// and |callback| will be executed on the UI thread after initialization is 17438 /// complete. 17439 /// 17440 /// If CefBeginTracing was called previously, or if a CefEndTracingAsync call is 17441 /// pending, CefBeginTracing will fail and return false (0). 17442 /// 17443 /// |categories| is a comma-delimited list of category wildcards. A category can 17444 /// have an optional '-' prefix to make it an excluded category. Having both 17445 /// included and excluded categories in the same list is not supported. 17446 /// 17447 /// Examples: - "test_MyTest*" - "test_MyTest*,test_OtherStuff" - 17448 /// "-excluded_category1,-excluded_category2" 17449 /// 17450 /// This function must be called on the browser process UI thread. 17451 /// 17452 int cef_begin_tracing ( 17453 const(cef_string_t)* categories, 17454 cef_completion_callback_t* callback); 17455 17456 /// 17457 /// Stop tracing events on all processes. 17458 /// 17459 /// This function will fail and return false (0) if a previous call to 17460 /// CefEndTracingAsync is already pending or if CefBeginTracing was not called. 17461 /// 17462 /// |tracing_file| is the path at which tracing data will be written and 17463 /// |callback| is the callback that will be executed once all processes have 17464 /// sent their trace data. If |tracing_file| is NULL a new temporary file path 17465 /// will be used. If |callback| is NULL no trace data will be written. 17466 /// 17467 /// This function must be called on the browser process UI thread. 17468 /// 17469 int cef_end_tracing ( 17470 const(cef_string_t)* tracing_file, 17471 cef_end_tracing_callback_t* callback); 17472 17473 /// 17474 /// Returns the current system trace time or, if none is defined, the current 17475 /// high-res time. Can be used by clients to synchronize with the time 17476 /// information in trace events. 17477 /// 17478 int64 cef_now_from_system_trace_time (); 17479 17480 // CEF_INCLUDE_CAPI_CEF_TRACE_CAPI_H_ 17481 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 17482 // 17483 // Redistribution and use in source and binary forms, with or without 17484 // modification, are permitted provided that the following conditions are 17485 // met: 17486 // 17487 // * Redistributions of source code must retain the above copyright 17488 // notice, this list of conditions and the following disclaimer. 17489 // * Redistributions in binary form must reproduce the above 17490 // copyright notice, this list of conditions and the following disclaimer 17491 // in the documentation and/or other materials provided with the 17492 // distribution. 17493 // * Neither the name of Google Inc. nor the name Chromium Embedded 17494 // Framework nor the names of its contributors may be used to endorse 17495 // or promote products derived from this software without specific prior 17496 // written permission. 17497 // 17498 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17499 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 17500 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 17501 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 17502 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 17503 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 17504 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 17505 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 17506 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 17507 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 17508 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 17509 // 17510 // --------------------------------------------------------------------------- 17511 // 17512 // This file was generated by the CEF translator tool and should not edited 17513 // by hand. See the translator.README.txt file in the tools directory for 17514 // more information. 17515 // 17516 // $hash=5b2bfaf4b7572935b2cfba804dc1625261e32e24$ 17517 // 17518 17519 extern (C): 17520 17521 /// 17522 /// Structure used to make a URL request. URL requests are not associated with a 17523 /// browser instance so no cef_client_t callbacks will be executed. URL requests 17524 /// can be created on any valid CEF thread in either the browser or render 17525 /// process. Once created the functions of the URL request object must be 17526 /// accessed on the same thread that created it. 17527 /// 17528 struct cef_urlrequest_t 17529 { 17530 /// 17531 /// Base structure. 17532 /// 17533 cef_base_ref_counted_t base; 17534 17535 /// 17536 /// Returns the request object used to create this URL request. The returned 17537 /// object is read-only and should not be modified. 17538 /// 17539 extern(System) cef_request_t* function (cef_urlrequest_t* self) nothrow get_request; 17540 17541 /// 17542 /// Returns the client. 17543 /// 17544 extern(System) cef_urlrequest_client_t* function (cef_urlrequest_t* self) nothrow get_client; 17545 17546 /// 17547 /// Returns the request status. 17548 /// 17549 extern(System) cef_urlrequest_status_t function ( 17550 cef_urlrequest_t* self) nothrow get_request_status; 17551 17552 /// 17553 /// Returns the request error if status is UR_CANCELED or UR_FAILED, or 0 17554 /// otherwise. 17555 /// 17556 extern(System) cef_errorcode_t function (cef_urlrequest_t* self) nothrow get_request_error; 17557 17558 /// 17559 /// Returns the response, or NULL if no response information is available. 17560 /// Response information will only be available after the upload has 17561 /// completed. The returned object is read-only and should not be modified. 17562 /// 17563 extern(System) cef_response_t* function (cef_urlrequest_t* self) nothrow get_response; 17564 17565 /// 17566 /// Returns true (1) if the response body was served from the cache. This 17567 /// includes responses for which revalidation was required. 17568 /// 17569 extern(System) int function (cef_urlrequest_t* self) nothrow response_was_cached; 17570 17571 /// 17572 /// Cancel the request. 17573 /// 17574 extern(System) void function (cef_urlrequest_t* self) nothrow cancel; 17575 } 17576 17577 17578 17579 /// 17580 /// Create a new URL request that is not associated with a specific browser or 17581 /// frame. Use cef_frame_t::CreateURLRequest instead if you want the request to 17582 /// have this association, in which case it may be handled differently (see 17583 /// documentation on that function). A request created with this function may 17584 /// only originate from the browser process, and will behave as follows: 17585 /// - It may be intercepted by the client via CefResourceRequestHandler or 17586 /// CefSchemeHandlerFactory. 17587 /// - POST data may only contain only a single element of type PDE_TYPE_FILE 17588 /// or PDE_TYPE_BYTES. 17589 /// - If |request_context| is empty the global request context will be used. 17590 /// 17591 /// The |request| object will be marked as read-only after calling this 17592 /// function. 17593 /// 17594 cef_urlrequest_t* cef_urlrequest_create ( 17595 cef_request_t* request, 17596 cef_urlrequest_client_t* client, 17597 cef_request_context_t* request_context); 17598 17599 /// 17600 /// Structure that should be implemented by the cef_urlrequest_t client. The 17601 /// functions of this structure will be called on the same thread that created 17602 /// the request unless otherwise documented. 17603 /// 17604 struct cef_urlrequest_client_t 17605 { 17606 /// 17607 /// Base structure. 17608 /// 17609 cef_base_ref_counted_t base; 17610 17611 /// 17612 /// Notifies the client that the request has completed. Use the 17613 /// cef_urlrequest_t::GetRequestStatus function to determine if the request 17614 /// was successful or not. 17615 /// 17616 extern(System) void function ( 17617 cef_urlrequest_client_t* self, 17618 cef_urlrequest_t* request) nothrow on_request_complete; 17619 17620 /// 17621 /// Notifies the client of upload progress. |current| denotes the number of 17622 /// bytes sent so far and |total| is the total size of uploading data (or -1 17623 /// if chunked upload is enabled). This function will only be called if the 17624 /// UR_FLAG_REPORT_UPLOAD_PROGRESS flag is set on the request. 17625 /// 17626 extern(System) void function ( 17627 cef_urlrequest_client_t* self, 17628 cef_urlrequest_t* request, 17629 int64 current, 17630 int64 total) nothrow on_upload_progress; 17631 17632 /// 17633 /// Notifies the client of download progress. |current| denotes the number of 17634 /// bytes received up to the call and |total| is the expected total size of 17635 /// the response (or -1 if not determined). 17636 /// 17637 extern(System) void function ( 17638 cef_urlrequest_client_t* self, 17639 cef_urlrequest_t* request, 17640 int64 current, 17641 int64 total) nothrow on_download_progress; 17642 17643 /// 17644 /// Called when some part of the response is read. |data| contains the current 17645 /// bytes received since the last call. This function will not be called if 17646 /// the UR_FLAG_NO_DOWNLOAD_DATA flag is set on the request. 17647 /// 17648 extern(System) void function ( 17649 cef_urlrequest_client_t* self, 17650 cef_urlrequest_t* request, 17651 const(void)* data, 17652 size_t data_length) nothrow on_download_data; 17653 17654 /// 17655 /// Called on the IO thread when the browser needs credentials from the user. 17656 /// |isProxy| indicates whether the host is a proxy server. |host| contains 17657 /// the hostname and |port| contains the port number. Return true (1) to 17658 /// continue the request and call cef_auth_callback_t::cont() when the 17659 /// authentication information is available. If the request has an associated 17660 /// browser/frame then returning false (0) will result in a call to 17661 /// GetAuthCredentials on the cef_request_handler_t associated with that 17662 /// browser, if any. Otherwise, returning false (0) will cancel the request 17663 /// immediately. This function will only be called for requests initiated from 17664 /// the browser process. 17665 /// 17666 extern(System) int function ( 17667 cef_urlrequest_client_t* self, 17668 int isProxy, 17669 const(cef_string_t)* host, 17670 int port, 17671 const(cef_string_t)* realm, 17672 const(cef_string_t)* scheme, 17673 cef_auth_callback_t* callback) nothrow get_auth_credentials; 17674 } 17675 17676 17677 17678 // CEF_INCLUDE_CAPI_CEF_URLREQUEST_CAPI_H_ 17679 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 17680 // 17681 // Redistribution and use in source and binary forms, with or without 17682 // modification, are permitted provided that the following conditions are 17683 // met: 17684 // 17685 // * Redistributions of source code must retain the above copyright 17686 // notice, this list of conditions and the following disclaimer. 17687 // * Redistributions in binary form must reproduce the above 17688 // copyright notice, this list of conditions and the following disclaimer 17689 // in the documentation and/or other materials provided with the 17690 // distribution. 17691 // * Neither the name of Google Inc. nor the name Chromium Embedded 17692 // Framework nor the names of its contributors may be used to endorse 17693 // or promote products derived from this software without specific prior 17694 // written permission. 17695 // 17696 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17697 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 17698 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 17699 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 17700 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 17701 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 17702 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 17703 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 17704 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 17705 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 17706 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 17707 // 17708 // --------------------------------------------------------------------------- 17709 // 17710 // This file was generated by the CEF translator tool and should not edited 17711 // by hand. See the translator.README.txt file in the tools directory for 17712 // more information. 17713 // 17714 // $hash=98f6d1c93609958fa457c15d7f6fef56fac7e3f6$ 17715 // 17716 17717 extern (C): 17718 17719 /// 17720 /// Structure representing a V8 context handle. V8 handles can only be accessed 17721 /// from the thread on which they are created. Valid threads for creating a V8 17722 /// handle include the render process main thread (TID_RENDERER) and WebWorker 17723 /// threads. A task runner for posting tasks on the associated thread can be 17724 /// retrieved via the cef_v8context_t::get_task_runner() function. 17725 /// 17726 struct cef_v8context_t 17727 { 17728 /// 17729 /// Base structure. 17730 /// 17731 cef_base_ref_counted_t base; 17732 17733 /// 17734 /// Returns the task runner associated with this context. V8 handles can only 17735 /// be accessed from the thread on which they are created. This function can 17736 /// be called on any render process thread. 17737 /// 17738 extern(System) cef_task_runner_t* function (cef_v8context_t* self) nothrow get_task_runner; 17739 17740 /// 17741 /// Returns true (1) if the underlying handle is valid and it can be accessed 17742 /// on the current thread. Do not call any other functions if this function 17743 /// returns false (0). 17744 /// 17745 extern(System) int function (cef_v8context_t* self) nothrow is_valid; 17746 17747 /// 17748 /// Returns the browser for this context. This function will return an NULL 17749 /// reference for WebWorker contexts. 17750 /// 17751 extern(System) cef_browser_t* function (cef_v8context_t* self) nothrow get_browser; 17752 17753 /// 17754 /// Returns the frame for this context. This function will return an NULL 17755 /// reference for WebWorker contexts. 17756 /// 17757 extern(System) cef_frame_t* function (cef_v8context_t* self) nothrow get_frame; 17758 17759 /// 17760 /// Returns the global object for this context. The context must be entered 17761 /// before calling this function. 17762 /// 17763 extern(System) cef_v8value_t* function (cef_v8context_t* self) nothrow get_global; 17764 17765 /// 17766 /// Enter this context. A context must be explicitly entered before creating a 17767 /// V8 Object, Array, Function or Date asynchronously. exit() must be called 17768 /// the same number of times as enter() before releasing this context. V8 17769 /// objects belong to the context in which they are created. Returns true (1) 17770 /// if the scope was entered successfully. 17771 /// 17772 extern(System) int function (cef_v8context_t* self) nothrow enter; 17773 17774 /// 17775 /// Exit this context. Call this function only after calling enter(). Returns 17776 /// true (1) if the scope was exited successfully. 17777 /// 17778 extern(System) int function (cef_v8context_t* self) nothrow exit; 17779 17780 /// 17781 /// Returns true (1) if this object is pointing to the same handle as |that| 17782 /// object. 17783 /// 17784 extern(System) int function (cef_v8context_t* self, cef_v8context_t* that) nothrow is_same; 17785 17786 /// 17787 /// Execute a string of JavaScript code in this V8 context. The |script_url| 17788 /// parameter is the URL where the script in question can be found, if any. 17789 /// The |start_line| parameter is the base line number to use for error 17790 /// reporting. On success |retval| will be set to the return value, if any, 17791 /// and the function will return true (1). On failure |exception| will be set 17792 /// to the exception, if any, and the function will return false (0). 17793 /// 17794 extern(System) int function ( 17795 cef_v8context_t* self, 17796 const(cef_string_t)* code, 17797 const(cef_string_t)* script_url, 17798 int start_line, 17799 cef_v8value_t** retval, 17800 cef_v8exception_t** exception) nothrow eval; 17801 } 17802 17803 17804 17805 /// 17806 /// Returns the current (top) context object in the V8 context stack. 17807 /// 17808 cef_v8context_t* cef_v8context_get_current_context (); 17809 17810 /// 17811 /// Returns the entered (bottom) context object in the V8 context stack. 17812 /// 17813 cef_v8context_t* cef_v8context_get_entered_context (); 17814 17815 /// 17816 /// Returns true (1) if V8 is currently inside a context. 17817 /// 17818 int cef_v8context_in_context (); 17819 17820 /// 17821 /// Structure that should be implemented to handle V8 function calls. The 17822 /// functions of this structure will be called on the thread associated with the 17823 /// V8 function. 17824 /// 17825 struct cef_v8handler_t 17826 { 17827 /// 17828 /// Base structure. 17829 /// 17830 cef_base_ref_counted_t base; 17831 17832 /// 17833 /// Handle execution of the function identified by |name|. |object| is the 17834 /// receiver ('this' object) of the function. |arguments| is the list of 17835 /// arguments passed to the function. If execution succeeds set |retval| to 17836 /// the function return value. If execution fails set |exception| to the 17837 /// exception that will be thrown. Return true (1) if execution was handled. 17838 /// 17839 extern(System) int function ( 17840 cef_v8handler_t* self, 17841 const(cef_string_t)* name, 17842 cef_v8value_t* object, 17843 size_t argumentsCount, 17844 cef_v8value_t** arguments, 17845 cef_v8value_t** retval, 17846 cef_string_t* exception) nothrow execute; 17847 } 17848 17849 17850 17851 /// 17852 /// Structure that should be implemented to handle V8 accessor calls. Accessor 17853 /// identifiers are registered by calling cef_v8value_t::set_value(). The 17854 /// functions of this structure will be called on the thread associated with the 17855 /// V8 accessor. 17856 /// 17857 struct cef_v8accessor_t 17858 { 17859 /// 17860 /// Base structure. 17861 /// 17862 cef_base_ref_counted_t base; 17863 17864 /// 17865 /// Handle retrieval the accessor value identified by |name|. |object| is the 17866 /// receiver ('this' object) of the accessor. If retrieval succeeds set 17867 /// |retval| to the return value. If retrieval fails set |exception| to the 17868 /// exception that will be thrown. Return true (1) if accessor retrieval was 17869 /// handled. 17870 /// 17871 extern(System) int function ( 17872 cef_v8accessor_t* self, 17873 const(cef_string_t)* name, 17874 cef_v8value_t* object, 17875 cef_v8value_t** retval, 17876 cef_string_t* exception) nothrow get; 17877 17878 /// 17879 /// Handle assignment of the accessor value identified by |name|. |object| is 17880 /// the receiver ('this' object) of the accessor. |value| is the new value 17881 /// being assigned to the accessor. If assignment fails set |exception| to the 17882 /// exception that will be thrown. Return true (1) if accessor assignment was 17883 /// handled. 17884 /// 17885 extern(System) int function ( 17886 cef_v8accessor_t* self, 17887 const(cef_string_t)* name, 17888 cef_v8value_t* object, 17889 cef_v8value_t* value, 17890 cef_string_t* exception) nothrow set; 17891 } 17892 17893 17894 17895 /// 17896 /// Structure that should be implemented to handle V8 interceptor calls. The 17897 /// functions of this structure will be called on the thread associated with the 17898 /// V8 interceptor. Interceptor's named property handlers (with first argument 17899 /// of type CefString) are called when object is indexed by string. Indexed 17900 /// property handlers (with first argument of type int) are called when object 17901 /// is indexed by integer. 17902 /// 17903 struct cef_v8interceptor_t 17904 { 17905 /// 17906 /// Base structure. 17907 /// 17908 cef_base_ref_counted_t base; 17909 17910 /// 17911 /// Handle retrieval of the interceptor value identified by |name|. |object| 17912 /// is the receiver ('this' object) of the interceptor. If retrieval succeeds, 17913 /// set |retval| to the return value. If the requested value does not exist, 17914 /// don't set either |retval| or |exception|. If retrieval fails, set 17915 /// |exception| to the exception that will be thrown. If the property has an 17916 /// associated accessor, it will be called only if you don't set |retval|. 17917 /// Return true (1) if interceptor retrieval was handled, false (0) otherwise. 17918 /// 17919 extern(System) int function ( 17920 cef_v8interceptor_t* self, 17921 const(cef_string_t)* name, 17922 cef_v8value_t* object, 17923 cef_v8value_t** retval, 17924 cef_string_t* exception) nothrow get_byname; 17925 17926 /// 17927 /// Handle retrieval of the interceptor value identified by |index|. |object| 17928 /// is the receiver ('this' object) of the interceptor. If retrieval succeeds, 17929 /// set |retval| to the return value. If the requested value does not exist, 17930 /// don't set either |retval| or |exception|. If retrieval fails, set 17931 /// |exception| to the exception that will be thrown. Return true (1) if 17932 /// interceptor retrieval was handled, false (0) otherwise. 17933 /// 17934 extern(System) int function ( 17935 cef_v8interceptor_t* self, 17936 int index, 17937 cef_v8value_t* object, 17938 cef_v8value_t** retval, 17939 cef_string_t* exception) nothrow get_byindex; 17940 17941 /// 17942 /// Handle assignment of the interceptor value identified by |name|. |object| 17943 /// is the receiver ('this' object) of the interceptor. |value| is the new 17944 /// value being assigned to the interceptor. If assignment fails, set 17945 /// |exception| to the exception that will be thrown. This setter will always 17946 /// be called, even when the property has an associated accessor. Return true 17947 /// (1) if interceptor assignment was handled, false (0) otherwise. 17948 /// 17949 extern(System) int function ( 17950 cef_v8interceptor_t* self, 17951 const(cef_string_t)* name, 17952 cef_v8value_t* object, 17953 cef_v8value_t* value, 17954 cef_string_t* exception) nothrow set_byname; 17955 17956 /// 17957 /// Handle assignment of the interceptor value identified by |index|. |object| 17958 /// is the receiver ('this' object) of the interceptor. |value| is the new 17959 /// value being assigned to the interceptor. If assignment fails, set 17960 /// |exception| to the exception that will be thrown. Return true (1) if 17961 /// interceptor assignment was handled, false (0) otherwise. 17962 /// 17963 extern(System) int function ( 17964 cef_v8interceptor_t* self, 17965 int index, 17966 cef_v8value_t* object, 17967 cef_v8value_t* value, 17968 cef_string_t* exception) nothrow set_byindex; 17969 } 17970 17971 17972 17973 /// 17974 /// Structure representing a V8 exception. The functions of this structure may 17975 /// be called on any render process thread. 17976 /// 17977 struct cef_v8exception_t 17978 { 17979 /// 17980 /// Base structure. 17981 /// 17982 cef_base_ref_counted_t base; 17983 17984 /// 17985 /// Returns the exception message. 17986 /// 17987 // The resulting string must be freed by calling cef_string_userfree_free(). 17988 extern(System) cef_string_userfree_t function (cef_v8exception_t* self) nothrow get_message; 17989 17990 /// 17991 /// Returns the line of source code that the exception occurred within. 17992 /// 17993 // The resulting string must be freed by calling cef_string_userfree_free(). 17994 extern(System) cef_string_userfree_t function (cef_v8exception_t* self) nothrow get_source_line; 17995 17996 /// 17997 /// Returns the resource name for the script from where the function causing 17998 /// the error originates. 17999 /// 18000 // The resulting string must be freed by calling cef_string_userfree_free(). 18001 extern(System) cef_string_userfree_t function ( 18002 cef_v8exception_t* self) nothrow get_script_resource_name; 18003 18004 /// 18005 /// Returns the 1-based number of the line where the error occurred or 0 if 18006 /// the line number is unknown. 18007 /// 18008 extern(System) int function (cef_v8exception_t* self) nothrow get_line_number; 18009 18010 /// 18011 /// Returns the index within the script of the first character where the error 18012 /// occurred. 18013 /// 18014 extern(System) int function (cef_v8exception_t* self) nothrow get_start_position; 18015 18016 /// 18017 /// Returns the index within the script of the last character where the error 18018 /// occurred. 18019 /// 18020 extern(System) int function (cef_v8exception_t* self) nothrow get_end_position; 18021 18022 /// 18023 /// Returns the index within the line of the first character where the error 18024 /// occurred. 18025 /// 18026 extern(System) int function (cef_v8exception_t* self) nothrow get_start_column; 18027 18028 /// 18029 /// Returns the index within the line of the last character where the error 18030 /// occurred. 18031 /// 18032 extern(System) int function (cef_v8exception_t* self) nothrow get_end_column; 18033 } 18034 18035 18036 18037 /// 18038 /// Callback structure that is passed to cef_v8value_t::CreateArrayBuffer. 18039 /// 18040 struct cef_v8array_buffer_release_callback_t 18041 { 18042 /// 18043 /// Base structure. 18044 /// 18045 cef_base_ref_counted_t base; 18046 18047 /// 18048 /// Called to release |buffer| when the ArrayBuffer JS object is garbage 18049 /// collected. |buffer| is the value that was passed to CreateArrayBuffer 18050 /// along with this object. 18051 /// 18052 extern(System) void function ( 18053 cef_v8array_buffer_release_callback_t* self, 18054 void* buffer) nothrow release_buffer; 18055 } 18056 18057 18058 18059 /// 18060 /// Structure representing a V8 value handle. V8 handles can only be accessed 18061 /// from the thread on which they are created. Valid threads for creating a V8 18062 /// handle include the render process main thread (TID_RENDERER) and WebWorker 18063 /// threads. A task runner for posting tasks on the associated thread can be 18064 /// retrieved via the cef_v8context_t::get_task_runner() function. 18065 /// 18066 struct cef_v8value_t 18067 { 18068 /// 18069 /// Base structure. 18070 /// 18071 cef_base_ref_counted_t base; 18072 18073 /// 18074 /// Returns true (1) if the underlying handle is valid and it can be accessed 18075 /// on the current thread. Do not call any other functions if this function 18076 /// returns false (0). 18077 /// 18078 extern(System) int function (cef_v8value_t* self) nothrow is_valid; 18079 18080 /// 18081 /// True if the value type is undefined. 18082 /// 18083 extern(System) int function (cef_v8value_t* self) nothrow is_undefined; 18084 18085 /// 18086 /// True if the value type is null. 18087 /// 18088 extern(System) int function (cef_v8value_t* self) nothrow is_null; 18089 18090 /// 18091 /// True if the value type is bool. 18092 /// 18093 extern(System) int function (cef_v8value_t* self) nothrow is_bool; 18094 18095 /// 18096 /// True if the value type is int. 18097 /// 18098 extern(System) int function (cef_v8value_t* self) nothrow is_int; 18099 18100 /// 18101 /// True if the value type is unsigned int. 18102 /// 18103 extern(System) int function (cef_v8value_t* self) nothrow is_uint; 18104 18105 /// 18106 /// True if the value type is double. 18107 /// 18108 extern(System) int function (cef_v8value_t* self) nothrow is_double; 18109 18110 /// 18111 /// True if the value type is Date. 18112 /// 18113 extern(System) int function (cef_v8value_t* self) nothrow is_date; 18114 18115 /// 18116 /// True if the value type is string. 18117 /// 18118 extern(System) int function (cef_v8value_t* self) nothrow is_string; 18119 18120 /// 18121 /// True if the value type is object. 18122 /// 18123 extern(System) int function (cef_v8value_t* self) nothrow is_object; 18124 18125 /// 18126 /// True if the value type is array. 18127 /// 18128 extern(System) int function (cef_v8value_t* self) nothrow is_array; 18129 18130 /// 18131 /// True if the value type is an ArrayBuffer. 18132 /// 18133 extern(System) int function (cef_v8value_t* self) nothrow is_array_buffer; 18134 18135 /// 18136 /// True if the value type is function. 18137 /// 18138 extern(System) int function (cef_v8value_t* self) nothrow is_function; 18139 18140 /// 18141 /// Returns true (1) if this object is pointing to the same handle as |that| 18142 /// object. 18143 /// 18144 extern(System) int function (cef_v8value_t* self, cef_v8value_t* that) nothrow is_same; 18145 18146 /// 18147 /// Return a bool value. 18148 /// 18149 extern(System) int function (cef_v8value_t* self) nothrow get_bool_value; 18150 18151 /// 18152 /// Return an int value. 18153 /// 18154 extern(System) int32 function (cef_v8value_t* self) nothrow get_int_value; 18155 18156 /// 18157 /// Return an unsigned int value. 18158 /// 18159 extern(System) uint32 function (cef_v8value_t* self) nothrow get_uint_value; 18160 18161 /// 18162 /// Return a double value. 18163 /// 18164 extern(System) double function (cef_v8value_t* self) nothrow get_double_value; 18165 18166 /// 18167 /// Return a Date value. 18168 /// 18169 extern(System) cef_basetime_t function (cef_v8value_t* self) nothrow get_date_value; 18170 18171 /// 18172 /// Return a string value. 18173 /// 18174 // The resulting string must be freed by calling cef_string_userfree_free(). 18175 extern(System) cef_string_userfree_t function (cef_v8value_t* self) nothrow get_string_value; 18176 18177 /// 18178 /// Returns true (1) if this is a user created object. 18179 /// 18180 extern(System) int function (cef_v8value_t* self) nothrow is_user_created; 18181 18182 /// 18183 /// Returns true (1) if the last function call resulted in an exception. This 18184 /// attribute exists only in the scope of the current CEF value object. 18185 /// 18186 extern(System) int function (cef_v8value_t* self) nothrow has_exception; 18187 18188 /// 18189 /// Returns the exception resulting from the last function call. This 18190 /// attribute exists only in the scope of the current CEF value object. 18191 /// 18192 extern(System) cef_v8exception_t* function (cef_v8value_t* self) nothrow get_exception; 18193 18194 /// 18195 /// Clears the last exception and returns true (1) on success. 18196 /// 18197 extern(System) int function (cef_v8value_t* self) nothrow clear_exception; 18198 18199 /// 18200 /// Returns true (1) if this object will re-throw future exceptions. This 18201 /// attribute exists only in the scope of the current CEF value object. 18202 /// 18203 extern(System) int function (cef_v8value_t* self) nothrow will_rethrow_exceptions; 18204 18205 /// 18206 /// Set whether this object will re-throw future exceptions. By default 18207 /// exceptions are not re-thrown. If a exception is re-thrown the current 18208 /// context should not be accessed again until after the exception has been 18209 /// caught and not re-thrown. Returns true (1) on success. This attribute 18210 /// exists only in the scope of the current CEF value object. 18211 /// 18212 extern(System) int function (cef_v8value_t* self, int rethrow) nothrow set_rethrow_exceptions; 18213 18214 /// 18215 /// Returns true (1) if the object has a value with the specified identifier. 18216 /// 18217 extern(System) int function ( 18218 cef_v8value_t* self, 18219 const(cef_string_t)* key) nothrow has_value_bykey; 18220 18221 /// 18222 /// Returns true (1) if the object has a value with the specified identifier. 18223 /// 18224 extern(System) int function (cef_v8value_t* self, int index) nothrow has_value_byindex; 18225 18226 /// 18227 /// Deletes the value with the specified identifier and returns true (1) on 18228 /// success. Returns false (0) if this function is called incorrectly or an 18229 /// exception is thrown. For read-only and don't-delete values this function 18230 /// will return true (1) even though deletion failed. 18231 /// 18232 extern(System) int function ( 18233 cef_v8value_t* self, 18234 const(cef_string_t)* key) nothrow delete_value_bykey; 18235 18236 /// 18237 /// Deletes the value with the specified identifier and returns true (1) on 18238 /// success. Returns false (0) if this function is called incorrectly, 18239 /// deletion fails or an exception is thrown. For read-only and don't-delete 18240 /// values this function will return true (1) even though deletion failed. 18241 /// 18242 extern(System) int function (cef_v8value_t* self, int index) nothrow delete_value_byindex; 18243 18244 /// 18245 /// Returns the value with the specified identifier on success. Returns NULL 18246 /// if this function is called incorrectly or an exception is thrown. 18247 /// 18248 extern(System) cef_v8value_t* function ( 18249 cef_v8value_t* self, 18250 const(cef_string_t)* key) nothrow get_value_bykey; 18251 18252 /// 18253 /// Returns the value with the specified identifier on success. Returns NULL 18254 /// if this function is called incorrectly or an exception is thrown. 18255 /// 18256 extern(System) cef_v8value_t* function ( 18257 cef_v8value_t* self, 18258 int index) nothrow get_value_byindex; 18259 18260 /// 18261 /// Associates a value with the specified identifier and returns true (1) on 18262 /// success. Returns false (0) if this function is called incorrectly or an 18263 /// exception is thrown. For read-only values this function will return true 18264 /// (1) even though assignment failed. 18265 /// 18266 extern(System) int function ( 18267 cef_v8value_t* self, 18268 const(cef_string_t)* key, 18269 cef_v8value_t* value, 18270 cef_v8_propertyattribute_t attribute) nothrow set_value_bykey; 18271 18272 /// 18273 /// Associates a value with the specified identifier and returns true (1) on 18274 /// success. Returns false (0) if this function is called incorrectly or an 18275 /// exception is thrown. For read-only values this function will return true 18276 /// (1) even though assignment failed. 18277 /// 18278 extern(System) int function ( 18279 cef_v8value_t* self, 18280 int index, 18281 cef_v8value_t* value) nothrow set_value_byindex; 18282 18283 /// 18284 /// Registers an identifier and returns true (1) on success. Access to the 18285 /// identifier will be forwarded to the cef_v8accessor_t instance passed to 18286 /// cef_v8value_t::cef_v8value_create_object(). Returns false (0) if this 18287 /// function is called incorrectly or an exception is thrown. For read-only 18288 /// values this function will return true (1) even though assignment failed. 18289 /// 18290 extern(System) int function ( 18291 cef_v8value_t* self, 18292 const(cef_string_t)* key, 18293 cef_v8_accesscontrol_t settings, 18294 cef_v8_propertyattribute_t attribute) nothrow set_value_byaccessor; 18295 18296 /// 18297 /// Read the keys for the object's values into the specified vector. Integer- 18298 /// based keys will also be returned as strings. 18299 /// 18300 extern(System) int function (cef_v8value_t* self, cef_string_list_t keys) nothrow get_keys; 18301 18302 /// 18303 /// Sets the user data for this object and returns true (1) on success. 18304 /// Returns false (0) if this function is called incorrectly. This function 18305 /// can only be called on user created objects. 18306 /// 18307 extern(System) int function ( 18308 cef_v8value_t* self, 18309 cef_base_ref_counted_t* user_data) nothrow set_user_data; 18310 18311 /// 18312 /// Returns the user data, if any, assigned to this object. 18313 /// 18314 extern(System) cef_base_ref_counted_t* function (cef_v8value_t* self) nothrow get_user_data; 18315 18316 /// 18317 /// Returns the amount of externally allocated memory registered for the 18318 /// object. 18319 /// 18320 extern(System) int function (cef_v8value_t* self) nothrow get_externally_allocated_memory; 18321 18322 /// 18323 /// Adjusts the amount of registered external memory for the object. Used to 18324 /// give V8 an indication of the amount of externally allocated memory that is 18325 /// kept alive by JavaScript objects. V8 uses this information to decide when 18326 /// to perform global garbage collection. Each cef_v8value_t tracks the amount 18327 /// of external memory associated with it and automatically decreases the 18328 /// global total by the appropriate amount on its destruction. 18329 /// |change_in_bytes| specifies the number of bytes to adjust by. This 18330 /// function returns the number of bytes associated with the object after the 18331 /// adjustment. This function can only be called on user created objects. 18332 /// 18333 extern(System) int function ( 18334 cef_v8value_t* self, 18335 int change_in_bytes) nothrow adjust_externally_allocated_memory; 18336 18337 /// 18338 /// Returns the number of elements in the array. 18339 /// 18340 extern(System) int function (cef_v8value_t* self) nothrow get_array_length; 18341 18342 /// 18343 /// Returns the ReleaseCallback object associated with the ArrayBuffer or NULL 18344 /// if the ArrayBuffer was not created with CreateArrayBuffer. 18345 /// 18346 extern(System) cef_v8array_buffer_release_callback_t* function ( 18347 cef_v8value_t* self) nothrow get_array_buffer_release_callback; 18348 18349 /// 18350 /// Prevent the ArrayBuffer from using it's memory block by setting the length 18351 /// to zero. This operation cannot be undone. If the ArrayBuffer was created 18352 /// with CreateArrayBuffer then 18353 /// cef_v8array_buffer_release_callback_t::ReleaseBuffer will be called to 18354 /// release the underlying buffer. 18355 /// 18356 extern(System) int function (cef_v8value_t* self) nothrow neuter_array_buffer; 18357 18358 /// 18359 /// Returns the function name. 18360 /// 18361 // The resulting string must be freed by calling cef_string_userfree_free(). 18362 extern(System) cef_string_userfree_t function (cef_v8value_t* self) nothrow get_function_name; 18363 18364 /// 18365 /// Returns the function handler or NULL if not a CEF-created function. 18366 /// 18367 extern(System) cef_v8handler_t* function (cef_v8value_t* self) nothrow get_function_handler; 18368 18369 /// 18370 /// Execute the function using the current V8 context. This function should 18371 /// only be called from within the scope of a cef_v8handler_t or 18372 /// cef_v8accessor_t callback, or in combination with calling enter() and 18373 /// exit() on a stored cef_v8context_t reference. |object| is the receiver 18374 /// ('this' object) of the function. If |object| is NULL the current context's 18375 /// global object will be used. |arguments| is the list of arguments that will 18376 /// be passed to the function. Returns the function return value on success. 18377 /// Returns NULL if this function is called incorrectly or an exception is 18378 /// thrown. 18379 /// 18380 extern(System) cef_v8value_t* function ( 18381 cef_v8value_t* self, 18382 cef_v8value_t* object, 18383 size_t argumentsCount, 18384 cef_v8value_t** arguments) nothrow execute_function; 18385 18386 /// 18387 /// Execute the function using the specified V8 context. |object| is the 18388 /// receiver ('this' object) of the function. If |object| is NULL the 18389 /// specified context's global object will be used. |arguments| is the list of 18390 /// arguments that will be passed to the function. Returns the function return 18391 /// value on success. Returns NULL if this function is called incorrectly or 18392 /// an exception is thrown. 18393 /// 18394 extern(System) cef_v8value_t* function ( 18395 cef_v8value_t* self, 18396 cef_v8context_t* context, 18397 cef_v8value_t* object, 18398 size_t argumentsCount, 18399 cef_v8value_t** arguments) nothrow execute_function_with_context; 18400 } 18401 18402 18403 18404 /// 18405 /// Create a new cef_v8value_t object of type undefined. 18406 /// 18407 cef_v8value_t* cef_v8value_create_undefined (); 18408 18409 /// 18410 /// Create a new cef_v8value_t object of type null. 18411 /// 18412 cef_v8value_t* cef_v8value_create_null (); 18413 18414 /// 18415 /// Create a new cef_v8value_t object of type bool. 18416 /// 18417 cef_v8value_t* cef_v8value_create_bool (int value); 18418 18419 /// 18420 /// Create a new cef_v8value_t object of type int. 18421 /// 18422 cef_v8value_t* cef_v8value_create_int (int32 value); 18423 18424 /// 18425 /// Create a new cef_v8value_t object of type unsigned int. 18426 /// 18427 cef_v8value_t* cef_v8value_create_uint (uint32 value); 18428 18429 /// 18430 /// Create a new cef_v8value_t object of type double. 18431 /// 18432 cef_v8value_t* cef_v8value_create_double (double value); 18433 18434 /// 18435 /// Create a new cef_v8value_t object of type Date. This function should only be 18436 /// called from within the scope of a cef_render_process_handler_t, 18437 /// cef_v8handler_t or cef_v8accessor_t callback, or in combination with calling 18438 /// enter() and exit() on a stored cef_v8context_t reference. 18439 /// 18440 cef_v8value_t* cef_v8value_create_date (cef_basetime_t date); 18441 18442 /// 18443 /// Create a new cef_v8value_t object of type string. 18444 /// 18445 cef_v8value_t* cef_v8value_create_string (const(cef_string_t)* value); 18446 18447 /// 18448 /// Create a new cef_v8value_t object of type object with optional accessor 18449 /// and/or interceptor. This function should only be called from within the 18450 /// scope of a cef_render_process_handler_t, cef_v8handler_t or cef_v8accessor_t 18451 /// callback, or in combination with calling enter() and exit() on a stored 18452 /// cef_v8context_t reference. 18453 /// 18454 cef_v8value_t* cef_v8value_create_object ( 18455 cef_v8accessor_t* accessor, 18456 cef_v8interceptor_t* interceptor); 18457 18458 /// 18459 /// Create a new cef_v8value_t object of type array with the specified |length|. 18460 /// If |length| is negative the returned array will have length 0. This function 18461 /// should only be called from within the scope of a 18462 /// cef_render_process_handler_t, cef_v8handler_t or cef_v8accessor_t callback, 18463 /// or in combination with calling enter() and exit() on a stored 18464 /// cef_v8context_t reference. 18465 /// 18466 cef_v8value_t* cef_v8value_create_array (int length); 18467 18468 /// 18469 /// Create a new cef_v8value_t object of type ArrayBuffer which wraps the 18470 /// provided |buffer| of size |length| bytes. The ArrayBuffer is externalized, 18471 /// meaning that it does not own |buffer|. The caller is responsible for freeing 18472 /// |buffer| when requested via a call to 18473 /// cef_v8array_buffer_release_callback_t::ReleaseBuffer. This function should 18474 /// only be called from within the scope of a cef_render_process_handler_t, 18475 /// cef_v8handler_t or cef_v8accessor_t callback, or in combination with calling 18476 /// enter() and exit() on a stored cef_v8context_t reference. 18477 /// 18478 cef_v8value_t* cef_v8value_create_array_buffer ( 18479 void* buffer, 18480 size_t length, 18481 cef_v8array_buffer_release_callback_t* release_callback); 18482 18483 /// 18484 /// Create a new cef_v8value_t object of type function. This function should 18485 /// only be called from within the scope of a cef_render_process_handler_t, 18486 /// cef_v8handler_t or cef_v8accessor_t callback, or in combination with calling 18487 /// enter() and exit() on a stored cef_v8context_t reference. 18488 /// 18489 extern(System) cef_v8value_t* cef_v8value_create_function ( 18490 const(cef_string_t)* name, 18491 cef_v8handler_t* handler) nothrow; 18492 18493 /// 18494 /// Structure representing a V8 stack trace handle. V8 handles can only be 18495 /// accessed from the thread on which they are created. Valid threads for 18496 /// creating a V8 handle include the render process main thread (TID_RENDERER) 18497 /// and WebWorker threads. A task runner for posting tasks on the associated 18498 /// thread can be retrieved via the cef_v8context_t::get_task_runner() function. 18499 /// 18500 struct cef_v8stack_trace_t 18501 { 18502 /// 18503 /// Base structure. 18504 /// 18505 cef_base_ref_counted_t base; 18506 18507 /// 18508 /// Returns true (1) if the underlying handle is valid and it can be accessed 18509 /// on the current thread. Do not call any other functions if this function 18510 /// returns false (0). 18511 /// 18512 extern(System) int function (cef_v8stack_trace_t* self) nothrow is_valid; 18513 18514 /// 18515 /// Returns the number of stack frames. 18516 /// 18517 extern(System) int function (cef_v8stack_trace_t* self) nothrow get_frame_count; 18518 18519 /// 18520 /// Returns the stack frame at the specified 0-based index. 18521 /// 18522 extern(System) cef_v8stack_frame_t* function ( 18523 cef_v8stack_trace_t* self, 18524 int index) nothrow get_frame; 18525 } 18526 18527 18528 18529 /// 18530 /// Returns the stack trace for the currently active context. |frame_limit| is 18531 /// the maximum number of frames that will be captured. 18532 /// 18533 cef_v8stack_trace_t* cef_v8stack_trace_get_current (int frame_limit); 18534 18535 /// 18536 /// Structure representing a V8 stack frame handle. V8 handles can only be 18537 /// accessed from the thread on which they are created. Valid threads for 18538 /// creating a V8 handle include the render process main thread (TID_RENDERER) 18539 /// and WebWorker threads. A task runner for posting tasks on the associated 18540 /// thread can be retrieved via the cef_v8context_t::get_task_runner() function. 18541 /// 18542 struct cef_v8stack_frame_t 18543 { 18544 /// 18545 /// Base structure. 18546 /// 18547 cef_base_ref_counted_t base; 18548 18549 /// 18550 /// Returns true (1) if the underlying handle is valid and it can be accessed 18551 /// on the current thread. Do not call any other functions if this function 18552 /// returns false (0). 18553 /// 18554 extern(System) int function (cef_v8stack_frame_t* self) nothrow is_valid; 18555 18556 /// 18557 /// Returns the name of the resource script that contains the function. 18558 /// 18559 // The resulting string must be freed by calling cef_string_userfree_free(). 18560 extern(System) cef_string_userfree_t function ( 18561 cef_v8stack_frame_t* self) nothrow get_script_name; 18562 18563 /// 18564 /// Returns the name of the resource script that contains the function or the 18565 /// sourceURL value if the script name is undefined and its source ends with a 18566 /// "//@ sourceURL=..." string. 18567 /// 18568 // The resulting string must be freed by calling cef_string_userfree_free(). 18569 extern(System) cef_string_userfree_t function ( 18570 cef_v8stack_frame_t* self) nothrow get_script_name_or_source_url; 18571 18572 /// 18573 /// Returns the name of the function. 18574 /// 18575 // The resulting string must be freed by calling cef_string_userfree_free(). 18576 extern(System) cef_string_userfree_t function ( 18577 cef_v8stack_frame_t* self) nothrow get_function_name; 18578 18579 /// 18580 /// Returns the 1-based line number for the function call or 0 if unknown. 18581 /// 18582 extern(System) int function (cef_v8stack_frame_t* self) nothrow get_line_number; 18583 18584 /// 18585 /// Returns the 1-based column offset on the line for the function call or 0 18586 /// if unknown. 18587 /// 18588 extern(System) int function (cef_v8stack_frame_t* self) nothrow get_column; 18589 18590 /// 18591 /// Returns true (1) if the function was compiled using eval(). 18592 /// 18593 extern(System) int function (cef_v8stack_frame_t* self) nothrow is_eval; 18594 18595 /// 18596 /// Returns true (1) if the function was called as a constructor via "new". 18597 /// 18598 extern(System) int function (cef_v8stack_frame_t* self) nothrow is_constructor; 18599 } 18600 18601 18602 18603 /// 18604 /// Register a new V8 extension with the specified JavaScript extension code and 18605 /// handler. Functions implemented by the handler are prototyped using the 18606 /// keyword 'native'. The calling of a native function is restricted to the 18607 /// scope in which the prototype of the native function is defined. This 18608 /// function may only be called on the render process main thread. 18609 /// 18610 /// Example JavaScript extension code: <pre> 18611 /// // create the 'example' global object if it doesn't already exist. 18612 /// if (!example) 18613 /// example = {}; 18614 /// // create the 'example.test' global object if it doesn't already exist. 18615 /// if (!example.test) 18616 /// example.test = {}; 18617 /// (function() { 18618 /// // Define the function 'example.test.myfunction'. 18619 /// example.test.myfunction = function() { 18620 /// // Call CefV8Handler::Execute() with the function name 'MyFunction' 18621 /// // and no arguments. 18622 /// native function MyFunction(); 18623 /// return MyFunction(); 18624 /// }; 18625 /// // Define the getter function for parameter 'example.test.myparam'. 18626 /// example.test.__defineGetter__('myparam', function() { 18627 /// // Call CefV8Handler::Execute() with the function name 'GetMyParam' 18628 /// // and no arguments. 18629 /// native function GetMyParam(); 18630 /// return GetMyParam(); 18631 /// }); 18632 /// // Define the setter function for parameter 'example.test.myparam'. 18633 /// example.test.__defineSetter__('myparam', function(b) { 18634 /// // Call CefV8Handler::Execute() with the function name 'SetMyParam' 18635 /// // and a single argument. 18636 /// native function SetMyParam(); 18637 /// if(b) SetMyParam(b); 18638 /// }); 18639 /// 18640 /// // Extension definitions can also contain normal JavaScript variables 18641 /// // and functions. 18642 /// var myint = 0; 18643 /// example.test.increment = function() { 18644 /// myint += 1; 18645 /// return myint; 18646 /// }; 18647 /// })(); 18648 /// </pre> 18649 /// 18650 /// Example usage in the page: <pre> 18651 /// // Call the function. 18652 /// example.test.myfunction(); 18653 /// // Set the parameter. 18654 /// example.test.myparam = value; 18655 /// // Get the parameter. 18656 /// value = example.test.myparam; 18657 /// // Call another function. 18658 /// example.test.increment(); 18659 /// </pre> 18660 /// 18661 int cef_register_extension ( 18662 const(cef_string_t)* extension_name, 18663 const(cef_string_t)* javascript_code, 18664 cef_v8handler_t* handler); 18665 18666 // CEF_INCLUDE_CAPI_CEF_V8_CAPI_H_ 18667 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 18668 // 18669 // Redistribution and use in source and binary forms, with or without 18670 // modification, are permitted provided that the following conditions are 18671 // met: 18672 // 18673 // * Redistributions of source code must retain the above copyright 18674 // notice, this list of conditions and the following disclaimer. 18675 // * Redistributions in binary form must reproduce the above 18676 // copyright notice, this list of conditions and the following disclaimer 18677 // in the documentation and/or other materials provided with the 18678 // distribution. 18679 // * Neither the name of Google Inc. nor the name Chromium Embedded 18680 // Framework nor the names of its contributors may be used to endorse 18681 // or promote products derived from this software without specific prior 18682 // written permission. 18683 // 18684 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18685 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18686 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18687 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 18688 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 18689 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 18690 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 18691 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 18692 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 18693 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 18694 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 18695 // 18696 // --------------------------------------------------------------------------- 18697 // 18698 // This file was generated by the CEF translator tool and should not edited 18699 // by hand. See the translator.README.txt file in the tools directory for 18700 // more information. 18701 // 18702 // $hash=e8f16d32cc835f9b20b3fcd7048146f52ec9bfe5$ 18703 // 18704 18705 extern (C): 18706 18707 /// 18708 /// Structure that wraps other data value types. Complex types (binary, 18709 /// dictionary and list) will be referenced but not owned by this object. Can be 18710 /// used on any process and thread. 18711 /// 18712 struct cef_value_t 18713 { 18714 /// 18715 /// Base structure. 18716 /// 18717 cef_base_ref_counted_t base; 18718 18719 /// 18720 /// Returns true (1) if the underlying data is valid. This will always be true 18721 /// (1) for simple types. For complex types (binary, dictionary and list) the 18722 /// underlying data may become invalid if owned by another object (e.g. list 18723 /// or dictionary) and that other object is then modified or destroyed. This 18724 /// value object can be re-used by calling Set*() even if the underlying data 18725 /// is invalid. 18726 /// 18727 extern(System) int function (cef_value_t* self) nothrow is_valid; 18728 18729 /// 18730 /// Returns true (1) if the underlying data is owned by another object. 18731 /// 18732 extern(System) int function (cef_value_t* self) nothrow is_owned; 18733 18734 /// 18735 /// Returns true (1) if the underlying data is read-only. Some APIs may expose 18736 /// read-only objects. 18737 /// 18738 extern(System) int function (cef_value_t* self) nothrow is_read_only; 18739 18740 /// 18741 /// Returns true (1) if this object and |that| object have the same underlying 18742 /// data. If true (1) modifications to this object will also affect |that| 18743 /// object and vice-versa. 18744 /// 18745 extern(System) int function (cef_value_t* self, cef_value_t* that) nothrow is_same; 18746 18747 /// 18748 /// Returns true (1) if this object and |that| object have an equivalent 18749 /// underlying value but are not necessarily the same object. 18750 /// 18751 extern(System) int function (cef_value_t* self, cef_value_t* that) nothrow is_equal; 18752 18753 /// 18754 /// Returns a copy of this object. The underlying data will also be copied. 18755 /// 18756 extern(System) cef_value_t* function (cef_value_t* self) nothrow copy; 18757 18758 /// 18759 /// Returns the underlying value type. 18760 /// 18761 extern(System) cef_value_type_t function (cef_value_t* self) nothrow get_type; 18762 18763 /// 18764 /// Returns the underlying value as type bool. 18765 /// 18766 extern(System) int function (cef_value_t* self) nothrow get_bool; 18767 18768 /// 18769 /// Returns the underlying value as type int. 18770 /// 18771 extern(System) int function (cef_value_t* self) nothrow get_int; 18772 18773 /// 18774 /// Returns the underlying value as type double. 18775 /// 18776 extern(System) double function (cef_value_t* self) nothrow get_double; 18777 18778 /// 18779 /// Returns the underlying value as type string. 18780 /// 18781 // The resulting string must be freed by calling cef_string_userfree_free(). 18782 extern(System) cef_string_userfree_t function (cef_value_t* self) nothrow get_string; 18783 18784 /// 18785 /// Returns the underlying value as type binary. The returned reference may 18786 /// become invalid if the value is owned by another object or if ownership is 18787 /// transferred to another object in the future. To maintain a reference to 18788 /// the value after assigning ownership to a dictionary or list pass this 18789 /// object to the set_value() function instead of passing the returned 18790 /// reference to set_binary(). 18791 /// 18792 extern(System) cef_binary_value_t* function (cef_value_t* self) nothrow get_binary; 18793 18794 /// 18795 /// Returns the underlying value as type dictionary. The returned reference 18796 /// may become invalid if the value is owned by another object or if ownership 18797 /// is transferred to another object in the future. To maintain a reference to 18798 /// the value after assigning ownership to a dictionary or list pass this 18799 /// object to the set_value() function instead of passing the returned 18800 /// reference to set_dictionary(). 18801 /// 18802 extern(System) cef_dictionary_value_t* function (cef_value_t* self) nothrow get_dictionary; 18803 18804 /// 18805 /// Returns the underlying value as type list. The returned reference may 18806 /// become invalid if the value is owned by another object or if ownership is 18807 /// transferred to another object in the future. To maintain a reference to 18808 /// the value after assigning ownership to a dictionary or list pass this 18809 /// object to the set_value() function instead of passing the returned 18810 /// reference to set_list(). 18811 /// 18812 extern(System) cef_list_value_t* function (cef_value_t* self) nothrow get_list; 18813 18814 /// 18815 /// Sets the underlying value as type null. Returns true (1) if the value was 18816 /// set successfully. 18817 /// 18818 extern(System) int function (cef_value_t* self) nothrow set_null; 18819 18820 /// 18821 /// Sets the underlying value as type bool. Returns true (1) if the value was 18822 /// set successfully. 18823 /// 18824 extern(System) int function (cef_value_t* self, int value) nothrow set_bool; 18825 18826 /// 18827 /// Sets the underlying value as type int. Returns true (1) if the value was 18828 /// set successfully. 18829 /// 18830 extern(System) int function (cef_value_t* self, int value) nothrow set_int; 18831 18832 /// 18833 /// Sets the underlying value as type double. Returns true (1) if the value 18834 /// was set successfully. 18835 /// 18836 extern(System) int function (cef_value_t* self, double value) nothrow set_double; 18837 18838 /// 18839 /// Sets the underlying value as type string. Returns true (1) if the value 18840 /// was set successfully. 18841 /// 18842 extern(System) int function (cef_value_t* self, const(cef_string_t)* value) nothrow set_string; 18843 18844 /// 18845 /// Sets the underlying value as type binary. Returns true (1) if the value 18846 /// was set successfully. This object keeps a reference to |value| and 18847 /// ownership of the underlying data remains unchanged. 18848 /// 18849 extern(System) int function (cef_value_t* self, cef_binary_value_t* value) nothrow set_binary; 18850 18851 /// 18852 /// Sets the underlying value as type dict. Returns true (1) if the value was 18853 /// set successfully. This object keeps a reference to |value| and ownership 18854 /// of the underlying data remains unchanged. 18855 /// 18856 extern(System) int function ( 18857 cef_value_t* self, 18858 cef_dictionary_value_t* value) nothrow set_dictionary; 18859 18860 /// 18861 /// Sets the underlying value as type list. Returns true (1) if the value was 18862 /// set successfully. This object keeps a reference to |value| and ownership 18863 /// of the underlying data remains unchanged. 18864 /// 18865 extern(System) int function (cef_value_t* self, cef_list_value_t* value) nothrow set_list; 18866 } 18867 18868 18869 18870 /// 18871 /// Creates a new object. 18872 /// 18873 cef_value_t* cef_value_create (); 18874 18875 /// 18876 /// Structure representing a binary value. Can be used on any process and 18877 /// thread. 18878 /// 18879 struct cef_binary_value_t 18880 { 18881 /// 18882 /// Base structure. 18883 /// 18884 cef_base_ref_counted_t base; 18885 18886 /// 18887 /// Returns true (1) if this object is valid. This object may become invalid 18888 /// if the underlying data is owned by another object (e.g. list or 18889 /// dictionary) and that other object is then modified or destroyed. Do not 18890 /// call any other functions if this function returns false (0). 18891 /// 18892 extern(System) int function (cef_binary_value_t* self) nothrow is_valid; 18893 18894 /// 18895 /// Returns true (1) if this object is currently owned by another object. 18896 /// 18897 extern(System) int function (cef_binary_value_t* self) nothrow is_owned; 18898 18899 /// 18900 /// Returns true (1) if this object and |that| object have the same underlying 18901 /// data. 18902 /// 18903 extern(System) int function ( 18904 cef_binary_value_t* self, 18905 cef_binary_value_t* that) nothrow is_same; 18906 18907 /// 18908 /// Returns true (1) if this object and |that| object have an equivalent 18909 /// underlying value but are not necessarily the same object. 18910 /// 18911 extern(System) int function ( 18912 cef_binary_value_t* self, 18913 cef_binary_value_t* that) nothrow is_equal; 18914 18915 /// 18916 /// Returns a copy of this object. The data in this object will also be 18917 /// copied. 18918 /// 18919 extern(System) cef_binary_value_t* function (cef_binary_value_t* self) nothrow copy; 18920 18921 /// 18922 /// Returns the data size. 18923 /// 18924 extern(System) size_t function (cef_binary_value_t* self) nothrow get_size; 18925 18926 /// 18927 /// Read up to |buffer_size| number of bytes into |buffer|. Reading begins at 18928 /// the specified byte |data_offset|. Returns the number of bytes read. 18929 /// 18930 extern(System) size_t function ( 18931 cef_binary_value_t* self, 18932 void* buffer, 18933 size_t buffer_size, 18934 size_t data_offset) nothrow get_data; 18935 } 18936 18937 18938 18939 /// 18940 /// Creates a new object that is not owned by any other object. The specified 18941 /// |data| will be copied. 18942 /// 18943 cef_binary_value_t* cef_binary_value_create ( 18944 const(void)* data, 18945 size_t data_size); 18946 18947 /// 18948 /// Structure representing a dictionary value. Can be used on any process and 18949 /// thread. 18950 /// 18951 struct cef_dictionary_value_t 18952 { 18953 /// 18954 /// Base structure. 18955 /// 18956 cef_base_ref_counted_t base; 18957 18958 /// 18959 /// Returns true (1) if this object is valid. This object may become invalid 18960 /// if the underlying data is owned by another object (e.g. list or 18961 /// dictionary) and that other object is then modified or destroyed. Do not 18962 /// call any other functions if this function returns false (0). 18963 /// 18964 extern(System) int function (cef_dictionary_value_t* self) nothrow is_valid; 18965 18966 /// 18967 /// Returns true (1) if this object is currently owned by another object. 18968 /// 18969 extern(System) int function (cef_dictionary_value_t* self) nothrow is_owned; 18970 18971 /// 18972 /// Returns true (1) if the values of this object are read-only. Some APIs may 18973 /// expose read-only objects. 18974 /// 18975 extern(System) int function (cef_dictionary_value_t* self) nothrow is_read_only; 18976 18977 /// 18978 /// Returns true (1) if this object and |that| object have the same underlying 18979 /// data. If true (1) modifications to this object will also affect |that| 18980 /// object and vice-versa. 18981 /// 18982 extern(System) int function ( 18983 cef_dictionary_value_t* self, 18984 cef_dictionary_value_t* that) nothrow is_same; 18985 18986 /// 18987 /// Returns true (1) if this object and |that| object have an equivalent 18988 /// underlying value but are not necessarily the same object. 18989 /// 18990 extern(System) int function ( 18991 cef_dictionary_value_t* self, 18992 cef_dictionary_value_t* that) nothrow is_equal; 18993 18994 /// 18995 /// Returns a writable copy of this object. If |exclude_NULL_children| is true 18996 /// (1) any NULL dictionaries or lists will be excluded from the copy. 18997 /// 18998 extern(System) cef_dictionary_value_t* function ( 18999 cef_dictionary_value_t* self, 19000 int exclude_empty_children) nothrow copy; 19001 19002 /// 19003 /// Returns the number of values. 19004 /// 19005 extern(System) size_t function (cef_dictionary_value_t* self) nothrow get_size; 19006 19007 /// 19008 /// Removes all values. Returns true (1) on success. 19009 /// 19010 extern(System) int function (cef_dictionary_value_t* self) nothrow clear; 19011 19012 /// 19013 /// Returns true (1) if the current dictionary has a value for the given key. 19014 /// 19015 extern(System) int function ( 19016 cef_dictionary_value_t* self, 19017 const(cef_string_t)* key) nothrow has_key; 19018 19019 /// 19020 /// Reads all keys for this dictionary into the specified vector. 19021 /// 19022 extern(System) int function ( 19023 cef_dictionary_value_t* self, 19024 cef_string_list_t keys) nothrow get_keys; 19025 19026 /// 19027 /// Removes the value at the specified key. Returns true (1) is the value was 19028 /// removed successfully. 19029 /// 19030 extern(System) int function ( 19031 cef_dictionary_value_t* self, 19032 const(cef_string_t)* key) nothrow remove; 19033 19034 /// 19035 /// Returns the value type for the specified key. 19036 /// 19037 extern(System) cef_value_type_t function ( 19038 cef_dictionary_value_t* self, 19039 const(cef_string_t)* key) nothrow get_type; 19040 19041 /// 19042 /// Returns the value at the specified key. For simple types the returned 19043 /// value will copy existing data and modifications to the value will not 19044 /// modify this object. For complex types (binary, dictionary and list) the 19045 /// returned value will reference existing data and modifications to the value 19046 /// will modify this object. 19047 /// 19048 extern(System) cef_value_t* function ( 19049 cef_dictionary_value_t* self, 19050 const(cef_string_t)* key) nothrow get_value; 19051 19052 /// 19053 /// Returns the value at the specified key as type bool. 19054 /// 19055 extern(System) int function ( 19056 cef_dictionary_value_t* self, 19057 const(cef_string_t)* key) nothrow get_bool; 19058 19059 /// 19060 /// Returns the value at the specified key as type int. 19061 /// 19062 extern(System) int function ( 19063 cef_dictionary_value_t* self, 19064 const(cef_string_t)* key) nothrow get_int; 19065 19066 /// 19067 /// Returns the value at the specified key as type double. 19068 /// 19069 extern(System) double function ( 19070 cef_dictionary_value_t* self, 19071 const(cef_string_t)* key) nothrow get_double; 19072 19073 /// 19074 /// Returns the value at the specified key as type string. 19075 /// 19076 // The resulting string must be freed by calling cef_string_userfree_free(). 19077 extern(System) cef_string_userfree_t function ( 19078 cef_dictionary_value_t* self, 19079 const(cef_string_t)* key) nothrow get_string; 19080 19081 /// 19082 /// Returns the value at the specified key as type binary. The returned value 19083 /// will reference existing data. 19084 /// 19085 extern(System) cef_binary_value_t* function ( 19086 cef_dictionary_value_t* self, 19087 const(cef_string_t)* key) nothrow get_binary; 19088 19089 /// 19090 /// Returns the value at the specified key as type dictionary. The returned 19091 /// value will reference existing data and modifications to the value will 19092 /// modify this object. 19093 /// 19094 extern(System) cef_dictionary_value_t* function ( 19095 cef_dictionary_value_t* self, 19096 const(cef_string_t)* key) nothrow get_dictionary; 19097 19098 /// 19099 /// Returns the value at the specified key as type list. The returned value 19100 /// will reference existing data and modifications to the value will modify 19101 /// this object. 19102 /// 19103 extern(System) cef_list_value_t* function ( 19104 cef_dictionary_value_t* self, 19105 const(cef_string_t)* key) nothrow get_list; 19106 19107 /// 19108 /// Sets the value at the specified key. Returns true (1) if the value was set 19109 /// successfully. If |value| represents simple data then the underlying data 19110 /// will be copied and modifications to |value| will not modify this object. 19111 /// If |value| represents complex data (binary, dictionary or list) then the 19112 /// underlying data will be referenced and modifications to |value| will 19113 /// modify this object. 19114 /// 19115 extern(System) int function ( 19116 cef_dictionary_value_t* self, 19117 const(cef_string_t)* key, 19118 cef_value_t* value) nothrow set_value; 19119 19120 /// 19121 /// Sets the value at the specified key as type null. Returns true (1) if the 19122 /// value was set successfully. 19123 /// 19124 extern(System) int function ( 19125 cef_dictionary_value_t* self, 19126 const(cef_string_t)* key) nothrow set_null; 19127 19128 /// 19129 /// Sets the value at the specified key as type bool. Returns true (1) if the 19130 /// value was set successfully. 19131 /// 19132 extern(System) int function ( 19133 cef_dictionary_value_t* self, 19134 const(cef_string_t)* key, 19135 int value) nothrow set_bool; 19136 19137 /// 19138 /// Sets the value at the specified key as type int. Returns true (1) if the 19139 /// value was set successfully. 19140 /// 19141 extern(System) int function ( 19142 cef_dictionary_value_t* self, 19143 const(cef_string_t)* key, 19144 int value) nothrow set_int; 19145 19146 /// 19147 /// Sets the value at the specified key as type double. Returns true (1) if 19148 /// the value was set successfully. 19149 /// 19150 extern(System) int function ( 19151 cef_dictionary_value_t* self, 19152 const(cef_string_t)* key, 19153 double value) nothrow set_double; 19154 19155 /// 19156 /// Sets the value at the specified key as type string. Returns true (1) if 19157 /// the value was set successfully. 19158 /// 19159 extern(System) int function ( 19160 cef_dictionary_value_t* self, 19161 const(cef_string_t)* key, 19162 const(cef_string_t)* value) nothrow set_string; 19163 19164 /// 19165 /// Sets the value at the specified key as type binary. Returns true (1) if 19166 /// the value was set successfully. If |value| is currently owned by another 19167 /// object then the value will be copied and the |value| reference will not 19168 /// change. Otherwise, ownership will be transferred to this object and the 19169 /// |value| reference will be invalidated. 19170 /// 19171 extern(System) int function ( 19172 cef_dictionary_value_t* self, 19173 const(cef_string_t)* key, 19174 cef_binary_value_t* value) nothrow set_binary; 19175 19176 /// 19177 /// Sets the value at the specified key as type dict. Returns true (1) if the 19178 /// value was set successfully. If |value| is currently owned by another 19179 /// object then the value will be copied and the |value| reference will not 19180 /// change. Otherwise, ownership will be transferred to this object and the 19181 /// |value| reference will be invalidated. 19182 /// 19183 extern(System) int function ( 19184 cef_dictionary_value_t* self, 19185 const(cef_string_t)* key, 19186 cef_dictionary_value_t* value) nothrow set_dictionary; 19187 19188 /// 19189 /// Sets the value at the specified key as type list. Returns true (1) if the 19190 /// value was set successfully. If |value| is currently owned by another 19191 /// object then the value will be copied and the |value| reference will not 19192 /// change. Otherwise, ownership will be transferred to this object and the 19193 /// |value| reference will be invalidated. 19194 /// 19195 extern(System) int function ( 19196 cef_dictionary_value_t* self, 19197 const(cef_string_t)* key, 19198 cef_list_value_t* value) nothrow set_list; 19199 } 19200 19201 19202 19203 /// 19204 /// Creates a new object that is not owned by any other object. 19205 /// 19206 cef_dictionary_value_t* cef_dictionary_value_create (); 19207 19208 /// 19209 /// Structure representing a list value. Can be used on any process and thread. 19210 /// 19211 struct cef_list_value_t 19212 { 19213 /// 19214 /// Base structure. 19215 /// 19216 cef_base_ref_counted_t base; 19217 19218 /// 19219 /// Returns true (1) if this object is valid. This object may become invalid 19220 /// if the underlying data is owned by another object (e.g. list or 19221 /// dictionary) and that other object is then modified or destroyed. Do not 19222 /// call any other functions if this function returns false (0). 19223 /// 19224 extern(System) int function (cef_list_value_t* self) nothrow is_valid; 19225 19226 /// 19227 /// Returns true (1) if this object is currently owned by another object. 19228 /// 19229 extern(System) int function (cef_list_value_t* self) nothrow is_owned; 19230 19231 /// 19232 /// Returns true (1) if the values of this object are read-only. Some APIs may 19233 /// expose read-only objects. 19234 /// 19235 extern(System) int function (cef_list_value_t* self) nothrow is_read_only; 19236 19237 /// 19238 /// Returns true (1) if this object and |that| object have the same underlying 19239 /// data. If true (1) modifications to this object will also affect |that| 19240 /// object and vice-versa. 19241 /// 19242 extern(System) int function (cef_list_value_t* self, cef_list_value_t* that) nothrow is_same; 19243 19244 /// 19245 /// Returns true (1) if this object and |that| object have an equivalent 19246 /// underlying value but are not necessarily the same object. 19247 /// 19248 extern(System) int function (cef_list_value_t* self, cef_list_value_t* that) nothrow is_equal; 19249 19250 /// 19251 /// Returns a writable copy of this object. 19252 /// 19253 extern(System) cef_list_value_t* function (cef_list_value_t* self) nothrow copy; 19254 19255 /// 19256 /// Sets the number of values. If the number of values is expanded all new 19257 /// value slots will default to type null. Returns true (1) on success. 19258 /// 19259 extern(System) int function (cef_list_value_t* self, size_t size) nothrow set_size; 19260 19261 /// 19262 /// Returns the number of values. 19263 /// 19264 extern(System) size_t function (cef_list_value_t* self) nothrow get_size; 19265 19266 /// 19267 /// Removes all values. Returns true (1) on success. 19268 /// 19269 extern(System) int function (cef_list_value_t* self) nothrow clear; 19270 19271 /// 19272 /// Removes the value at the specified index. 19273 /// 19274 extern(System) int function (cef_list_value_t* self, size_t index) nothrow remove; 19275 19276 /// 19277 /// Returns the value type at the specified index. 19278 /// 19279 extern(System) cef_value_type_t function (cef_list_value_t* self, size_t index) nothrow get_type; 19280 19281 /// 19282 /// Returns the value at the specified index. For simple types the returned 19283 /// value will copy existing data and modifications to the value will not 19284 /// modify this object. For complex types (binary, dictionary and list) the 19285 /// returned value will reference existing data and modifications to the value 19286 /// will modify this object. 19287 /// 19288 extern(System) cef_value_t* function (cef_list_value_t* self, size_t index) nothrow get_value; 19289 19290 /// 19291 /// Returns the value at the specified index as type bool. 19292 /// 19293 extern(System) int function (cef_list_value_t* self, size_t index) nothrow get_bool; 19294 19295 /// 19296 /// Returns the value at the specified index as type int. 19297 /// 19298 extern(System) int function (cef_list_value_t* self, size_t index) nothrow get_int; 19299 19300 /// 19301 /// Returns the value at the specified index as type double. 19302 /// 19303 extern(System) double function (cef_list_value_t* self, size_t index) nothrow get_double; 19304 19305 /// 19306 /// Returns the value at the specified index as type string. 19307 /// 19308 // The resulting string must be freed by calling cef_string_userfree_free(). 19309 extern(System) cef_string_userfree_t function ( 19310 cef_list_value_t* self, 19311 size_t index) nothrow get_string; 19312 19313 /// 19314 /// Returns the value at the specified index as type binary. The returned 19315 /// value will reference existing data. 19316 /// 19317 extern(System) cef_binary_value_t* function ( 19318 cef_list_value_t* self, 19319 size_t index) nothrow get_binary; 19320 19321 /// 19322 /// Returns the value at the specified index as type dictionary. The returned 19323 /// value will reference existing data and modifications to the value will 19324 /// modify this object. 19325 /// 19326 extern(System) cef_dictionary_value_t* function ( 19327 cef_list_value_t* self, 19328 size_t index) nothrow get_dictionary; 19329 19330 /// 19331 /// Returns the value at the specified index as type list. The returned value 19332 /// will reference existing data and modifications to the value will modify 19333 /// this object. 19334 /// 19335 extern(System) cef_list_value_t* function ( 19336 cef_list_value_t* self, 19337 size_t index) nothrow get_list; 19338 19339 /// 19340 /// Sets the value at the specified index. Returns true (1) if the value was 19341 /// set successfully. If |value| represents simple data then the underlying 19342 /// data will be copied and modifications to |value| will not modify this 19343 /// object. If |value| represents complex data (binary, dictionary or list) 19344 /// then the underlying data will be referenced and modifications to |value| 19345 /// will modify this object. 19346 /// 19347 extern(System) int function ( 19348 cef_list_value_t* self, 19349 size_t index, 19350 cef_value_t* value) nothrow set_value; 19351 19352 /// 19353 /// Sets the value at the specified index as type null. Returns true (1) if 19354 /// the value was set successfully. 19355 /// 19356 extern(System) int function (cef_list_value_t* self, size_t index) nothrow set_null; 19357 19358 /// 19359 /// Sets the value at the specified index as type bool. Returns true (1) if 19360 /// the value was set successfully. 19361 /// 19362 extern(System) int function (cef_list_value_t* self, size_t index, int value) nothrow set_bool; 19363 19364 /// 19365 /// Sets the value at the specified index as type int. Returns true (1) if the 19366 /// value was set successfully. 19367 /// 19368 extern(System) int function (cef_list_value_t* self, size_t index, int value) nothrow set_int; 19369 19370 /// 19371 /// Sets the value at the specified index as type double. Returns true (1) if 19372 /// the value was set successfully. 19373 /// 19374 extern(System) int function ( 19375 cef_list_value_t* self, 19376 size_t index, 19377 double value) nothrow set_double; 19378 19379 /// 19380 /// Sets the value at the specified index as type string. Returns true (1) if 19381 /// the value was set successfully. 19382 /// 19383 extern(System) int function ( 19384 cef_list_value_t* self, 19385 size_t index, 19386 const(cef_string_t)* value) nothrow set_string; 19387 19388 /// 19389 /// Sets the value at the specified index as type binary. Returns true (1) if 19390 /// the value was set successfully. If |value| is currently owned by another 19391 /// object then the value will be copied and the |value| reference will not 19392 /// change. Otherwise, ownership will be transferred to this object and the 19393 /// |value| reference will be invalidated. 19394 /// 19395 extern(System) int function ( 19396 cef_list_value_t* self, 19397 size_t index, 19398 cef_binary_value_t* value) nothrow set_binary; 19399 19400 /// 19401 /// Sets the value at the specified index as type dict. Returns true (1) if 19402 /// the value was set successfully. If |value| is currently owned by another 19403 /// object then the value will be copied and the |value| reference will not 19404 /// change. Otherwise, ownership will be transferred to this object and the 19405 /// |value| reference will be invalidated. 19406 /// 19407 extern(System) int function ( 19408 cef_list_value_t* self, 19409 size_t index, 19410 cef_dictionary_value_t* value) nothrow set_dictionary; 19411 19412 /// 19413 /// Sets the value at the specified index as type list. Returns true (1) if 19414 /// the value was set successfully. If |value| is currently owned by another 19415 /// object then the value will be copied and the |value| reference will not 19416 /// change. Otherwise, ownership will be transferred to this object and the 19417 /// |value| reference will be invalidated. 19418 /// 19419 extern(System) int function ( 19420 cef_list_value_t* self, 19421 size_t index, 19422 cef_list_value_t* value) nothrow set_list; 19423 } 19424 19425 19426 19427 /// 19428 /// Creates a new object that is not owned by any other object. 19429 /// 19430 cef_list_value_t* cef_list_value_create (); 19431 19432 // CEF_INCLUDE_CAPI_CEF_VALUES_CAPI_H_ 19433 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 19434 // 19435 // Redistribution and use in source and binary forms, with or without 19436 // modification, are permitted provided that the following conditions are 19437 // met: 19438 // 19439 // * Redistributions of source code must retain the above copyright 19440 // notice, this list of conditions and the following disclaimer. 19441 // * Redistributions in binary form must reproduce the above 19442 // copyright notice, this list of conditions and the following disclaimer 19443 // in the documentation and/or other materials provided with the 19444 // distribution. 19445 // * Neither the name of Google Inc. nor the name Chromium Embedded 19446 // Framework nor the names of its contributors may be used to endorse 19447 // or promote products derived from this software without specific prior 19448 // written permission. 19449 // 19450 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19451 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19452 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19453 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19454 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 19455 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 19456 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19457 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 19458 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 19459 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 19460 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 19461 // 19462 // --------------------------------------------------------------------------- 19463 // 19464 // This file was generated by the CEF translator tool and should not edited 19465 // by hand. See the translator.README.txt file in the tools directory for 19466 // more information. 19467 // 19468 // $hash=737b3ee4e678de14ebffec828d113b007e06c58d$ 19469 // 19470 19471 extern (C): 19472 19473 /// 19474 /// WaitableEvent is a thread synchronization tool that allows one thread to 19475 /// wait for another thread to finish some work. This is equivalent to using a 19476 /// Lock+ConditionVariable to protect a simple boolean value. However, using 19477 /// WaitableEvent in conjunction with a Lock to wait for a more complex state 19478 /// change (e.g., for an item to be added to a queue) is not recommended. In 19479 /// that case consider using a ConditionVariable instead of a WaitableEvent. It 19480 /// is safe to create and/or signal a WaitableEvent from any thread. Blocking on 19481 /// a WaitableEvent by calling the *wait() functions is not allowed on the 19482 /// browser process UI or IO threads. 19483 /// 19484 struct cef_waitable_event_t 19485 { 19486 /// 19487 /// Base structure. 19488 /// 19489 cef_base_ref_counted_t base; 19490 19491 /// 19492 /// Put the event in the un-signaled state. 19493 /// 19494 extern(System) void function (cef_waitable_event_t* self) nothrow reset; 19495 19496 /// 19497 /// Put the event in the signaled state. This causes any thread blocked on 19498 /// Wait to be woken up. 19499 /// 19500 extern(System) void function (cef_waitable_event_t* self) nothrow signal; 19501 19502 /// 19503 /// Returns true (1) if the event is in the signaled state, else false (0). If 19504 /// the event was created with |automatic_reset| set to true (1) then calling 19505 /// this function will also cause a reset. 19506 /// 19507 extern(System) int function (cef_waitable_event_t* self) nothrow is_signaled; 19508 19509 /// 19510 /// Wait indefinitely for the event to be signaled. This function will not 19511 /// return until after the call to signal() has completed. This function 19512 /// cannot be called on the browser process UI or IO threads. 19513 /// 19514 extern(System) void function (cef_waitable_event_t* self) nothrow wait; 19515 19516 /// 19517 /// Wait up to |max_ms| milliseconds for the event to be signaled. Returns 19518 /// true (1) if the event was signaled. A return value of false (0) does not 19519 /// necessarily mean that |max_ms| was exceeded. This function will not return 19520 /// until after the call to signal() has completed. This function cannot be 19521 /// called on the browser process UI or IO threads. 19522 /// 19523 extern(System) int function (cef_waitable_event_t* self, int64 max_ms) nothrow timed_wait; 19524 } 19525 19526 19527 19528 /// 19529 /// Create a new waitable event. If |automatic_reset| is true (1) then the event 19530 /// state is automatically reset to un-signaled after a single waiting thread 19531 /// has been released; otherwise, the state remains signaled until reset() is 19532 /// called manually. If |initially_signaled| is true (1) then the event will 19533 /// start in the signaled state. 19534 /// 19535 cef_waitable_event_t* cef_waitable_event_create ( 19536 int automatic_reset, 19537 int initially_signaled); 19538 19539 // CEF_INCLUDE_CAPI_CEF_WAITABLE_EVENT_CAPI_H_ 19540 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 19541 // 19542 // Redistribution and use in source and binary forms, with or without 19543 // modification, are permitted provided that the following conditions are 19544 // met: 19545 // 19546 // * Redistributions of source code must retain the above copyright 19547 // notice, this list of conditions and the following disclaimer. 19548 // * Redistributions in binary form must reproduce the above 19549 // copyright notice, this list of conditions and the following disclaimer 19550 // in the documentation and/or other materials provided with the 19551 // distribution. 19552 // * Neither the name of Google Inc. nor the name Chromium Embedded 19553 // Framework nor the names of its contributors may be used to endorse 19554 // or promote products derived from this software without specific prior 19555 // written permission. 19556 // 19557 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19558 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19559 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19560 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19561 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 19562 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 19563 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19564 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 19565 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 19566 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 19567 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 19568 // 19569 // --------------------------------------------------------------------------- 19570 // 19571 // This file was generated by the CEF translator tool and should not edited 19572 // by hand. See the translator.README.txt file in the tools directory for 19573 // more information. 19574 // 19575 // $hash=1d551ff4900e1792bc2d89bebcda1707b8d9c985$ 19576 // 19577 19578 extern (C): 19579 19580 /// 19581 /// Structure representing the issuer or subject field of an X.509 certificate. 19582 /// 19583 struct cef_x509cert_principal_t 19584 { 19585 /// 19586 /// Base structure. 19587 /// 19588 cef_base_ref_counted_t base; 19589 19590 /// 19591 /// Returns a name that can be used to represent the issuer. It tries in this 19592 /// order: Common Name (CN), Organization Name (O) and Organizational Unit 19593 /// Name (OU) and returns the first non-NULL one found. 19594 /// 19595 // The resulting string must be freed by calling cef_string_userfree_free(). 19596 extern(System) cef_string_userfree_t function ( 19597 cef_x509cert_principal_t* self) nothrow get_display_name; 19598 19599 /// 19600 /// Returns the common name. 19601 /// 19602 // The resulting string must be freed by calling cef_string_userfree_free(). 19603 extern(System) cef_string_userfree_t function ( 19604 cef_x509cert_principal_t* self) nothrow get_common_name; 19605 19606 /// 19607 /// Returns the locality name. 19608 /// 19609 // The resulting string must be freed by calling cef_string_userfree_free(). 19610 extern(System) cef_string_userfree_t function ( 19611 cef_x509cert_principal_t* self) nothrow get_locality_name; 19612 19613 /// 19614 /// Returns the state or province name. 19615 /// 19616 // The resulting string must be freed by calling cef_string_userfree_free(). 19617 extern(System) cef_string_userfree_t function ( 19618 cef_x509cert_principal_t* self) nothrow get_state_or_province_name; 19619 19620 /// 19621 /// Returns the country name. 19622 /// 19623 // The resulting string must be freed by calling cef_string_userfree_free(). 19624 extern(System) cef_string_userfree_t function ( 19625 cef_x509cert_principal_t* self) nothrow get_country_name; 19626 19627 /// 19628 /// Retrieve the list of street addresses. 19629 /// 19630 extern(System) void function ( 19631 cef_x509cert_principal_t* self, 19632 cef_string_list_t addresses) nothrow get_street_addresses; 19633 19634 /// 19635 /// Retrieve the list of organization names. 19636 /// 19637 extern(System) void function ( 19638 cef_x509cert_principal_t* self, 19639 cef_string_list_t names) nothrow get_organization_names; 19640 19641 /// 19642 /// Retrieve the list of organization unit names. 19643 /// 19644 extern(System) void function ( 19645 cef_x509cert_principal_t* self, 19646 cef_string_list_t names) nothrow get_organization_unit_names; 19647 19648 /// 19649 /// Retrieve the list of domain components. 19650 /// 19651 extern(System) void function ( 19652 cef_x509cert_principal_t* self, 19653 cef_string_list_t components) nothrow get_domain_components; 19654 } 19655 19656 19657 19658 /// 19659 /// Structure representing a X.509 certificate. 19660 /// 19661 struct cef_x509certificate_t 19662 { 19663 /// 19664 /// Base structure. 19665 /// 19666 cef_base_ref_counted_t base; 19667 19668 /// 19669 /// Returns the subject of the X.509 certificate. For HTTPS server 19670 /// certificates this represents the web server. The common name of the 19671 /// subject should match the host name of the web server. 19672 /// 19673 extern(System) cef_x509cert_principal_t* function ( 19674 cef_x509certificate_t* self) nothrow get_subject; 19675 19676 /// 19677 /// Returns the issuer of the X.509 certificate. 19678 /// 19679 extern(System) cef_x509cert_principal_t* function ( 19680 cef_x509certificate_t* self) nothrow get_issuer; 19681 19682 /// 19683 /// Returns the DER encoded serial number for the X.509 certificate. The value 19684 /// possibly includes a leading 00 byte. 19685 /// 19686 extern(System) cef_binary_value_t* function ( 19687 cef_x509certificate_t* self) nothrow get_serial_number; 19688 19689 /// 19690 /// Returns the date before which the X.509 certificate is invalid. 19691 /// CefBaseTime.GetTimeT() will return 0 if no date was specified. 19692 /// 19693 extern(System) cef_basetime_t function (cef_x509certificate_t* self) nothrow get_valid_start; 19694 19695 /// 19696 /// Returns the date after which the X.509 certificate is invalid. 19697 /// CefBaseTime.GetTimeT() will return 0 if no date was specified. 19698 /// 19699 extern(System) cef_basetime_t function (cef_x509certificate_t* self) nothrow get_valid_expiry; 19700 19701 /// 19702 /// Returns the DER encoded data for the X.509 certificate. 19703 /// 19704 extern(System) cef_binary_value_t* function ( 19705 cef_x509certificate_t* self) nothrow get_derencoded; 19706 19707 /// 19708 /// Returns the PEM encoded data for the X.509 certificate. 19709 /// 19710 extern(System) cef_binary_value_t* function ( 19711 cef_x509certificate_t* self) nothrow get_pemencoded; 19712 19713 /// 19714 /// Returns the number of certificates in the issuer chain. If 0, the 19715 /// certificate is self-signed. 19716 /// 19717 extern(System) size_t function (cef_x509certificate_t* self) nothrow get_issuer_chain_size; 19718 19719 /// 19720 /// Returns the DER encoded data for the certificate issuer chain. If we 19721 /// failed to encode a certificate in the chain it is still present in the 19722 /// array but is an NULL string. 19723 /// 19724 extern(System) void function ( 19725 cef_x509certificate_t* self, 19726 size_t* chainCount, 19727 cef_binary_value_t** chain) nothrow get_derencoded_issuer_chain; 19728 19729 /// 19730 /// Returns the PEM encoded data for the certificate issuer chain. If we 19731 /// failed to encode a certificate in the chain it is still present in the 19732 /// array but is an NULL string. 19733 /// 19734 extern(System) void function ( 19735 cef_x509certificate_t* self, 19736 size_t* chainCount, 19737 cef_binary_value_t** chain) nothrow get_pemencoded_issuer_chain; 19738 } 19739 19740 19741 19742 // CEF_INCLUDE_CAPI_CEF_X509_CERTIFICATE_CAPI_H_ 19743 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 19744 // 19745 // Redistribution and use in source and binary forms, with or without 19746 // modification, are permitted provided that the following conditions are 19747 // met: 19748 // 19749 // * Redistributions of source code must retain the above copyright 19750 // notice, this list of conditions and the following disclaimer. 19751 // * Redistributions in binary form must reproduce the above 19752 // copyright notice, this list of conditions and the following disclaimer 19753 // in the documentation and/or other materials provided with the 19754 // distribution. 19755 // * Neither the name of Google Inc. nor the name Chromium Embedded 19756 // Framework nor the names of its contributors may be used to endorse 19757 // or promote products derived from this software without specific prior 19758 // written permission. 19759 // 19760 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19761 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19762 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19763 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19764 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 19765 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 19766 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19767 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 19768 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 19769 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 19770 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 19771 // 19772 // --------------------------------------------------------------------------- 19773 // 19774 // This file was generated by the CEF translator tool and should not edited 19775 // by hand. See the translator.README.txt file in the tools directory for 19776 // more information. 19777 // 19778 // $hash=988d13daa86a6ed89d2116e44d2307ee01c63c08$ 19779 // 19780 19781 extern (C): 19782 19783 /// 19784 /// Structure that supports the reading of XML data via the libxml streaming 19785 /// API. The functions of this structure should only be called on the thread 19786 /// that creates the object. 19787 /// 19788 struct cef_xml_reader_t 19789 { 19790 /// 19791 /// Base structure. 19792 /// 19793 cef_base_ref_counted_t base; 19794 19795 /// 19796 /// Moves the cursor to the next node in the document. This function must be 19797 /// called at least once to set the current cursor position. Returns true (1) 19798 /// if the cursor position was set successfully. 19799 /// 19800 extern(System) int function (cef_xml_reader_t* self) nothrow move_to_next_node; 19801 19802 /// 19803 /// Close the document. This should be called directly to ensure that cleanup 19804 /// occurs on the correct thread. 19805 /// 19806 extern(System) int function (cef_xml_reader_t* self) nothrow close; 19807 19808 /// 19809 /// Returns true (1) if an error has been reported by the XML parser. 19810 /// 19811 extern(System) int function (cef_xml_reader_t* self) nothrow has_error; 19812 19813 /// 19814 /// Returns the error string. 19815 /// 19816 // The resulting string must be freed by calling cef_string_userfree_free(). 19817 extern(System) cef_string_userfree_t function (cef_xml_reader_t* self) nothrow get_error; 19818 19819 /// 19820 /// Returns the node type. 19821 /// 19822 extern(System) cef_xml_node_type_t function (cef_xml_reader_t* self) nothrow get_type; 19823 19824 /// 19825 /// Returns the node depth. Depth starts at 0 for the root node. 19826 /// 19827 extern(System) int function (cef_xml_reader_t* self) nothrow get_depth; 19828 19829 /// 19830 /// Returns the local name. See http://www.w3.org/TR/REC-xml-names/#NT- 19831 /// LocalPart for additional details. 19832 /// 19833 // The resulting string must be freed by calling cef_string_userfree_free(). 19834 extern(System) cef_string_userfree_t function (cef_xml_reader_t* self) nothrow get_local_name; 19835 19836 /// 19837 /// Returns the namespace prefix. See http://www.w3.org/TR/REC-xml-names/ for 19838 /// additional details. 19839 /// 19840 // The resulting string must be freed by calling cef_string_userfree_free(). 19841 extern(System) cef_string_userfree_t function (cef_xml_reader_t* self) nothrow get_prefix; 19842 19843 /// 19844 /// Returns the qualified name, equal to (Prefix:)LocalName. See 19845 /// http://www.w3.org/TR/REC-xml-names/#ns-qualnames for additional details. 19846 /// 19847 // The resulting string must be freed by calling cef_string_userfree_free(). 19848 extern(System) cef_string_userfree_t function ( 19849 cef_xml_reader_t* self) nothrow get_qualified_name; 19850 19851 /// 19852 /// Returns the URI defining the namespace associated with the node. See 19853 /// http://www.w3.org/TR/REC-xml-names/ for additional details. 19854 /// 19855 // The resulting string must be freed by calling cef_string_userfree_free(). 19856 extern(System) cef_string_userfree_t function (cef_xml_reader_t* self) nothrow get_namespace_uri; 19857 19858 /// 19859 /// Returns the base URI of the node. See http://www.w3.org/TR/xmlbase/ for 19860 /// additional details. 19861 /// 19862 // The resulting string must be freed by calling cef_string_userfree_free(). 19863 extern(System) cef_string_userfree_t function (cef_xml_reader_t* self) nothrow get_base_uri; 19864 19865 /// 19866 /// Returns the xml:lang scope within which the node resides. See 19867 /// http://www.w3.org/TR/REC-xml/#sec-lang-tag for additional details. 19868 /// 19869 // The resulting string must be freed by calling cef_string_userfree_free(). 19870 extern(System) cef_string_userfree_t function (cef_xml_reader_t* self) nothrow get_xml_lang; 19871 19872 /// 19873 /// Returns true (1) if the node represents an NULL element. "<a/>" is 19874 /// considered NULL but "<a></a>" is not. 19875 /// 19876 extern(System) int function (cef_xml_reader_t* self) nothrow is_empty_element; 19877 19878 /// 19879 /// Returns true (1) if the node has a text value. 19880 /// 19881 extern(System) int function (cef_xml_reader_t* self) nothrow has_value; 19882 19883 /// 19884 /// Returns the text value. 19885 /// 19886 // The resulting string must be freed by calling cef_string_userfree_free(). 19887 extern(System) cef_string_userfree_t function (cef_xml_reader_t* self) nothrow get_value; 19888 19889 /// 19890 /// Returns true (1) if the node has attributes. 19891 /// 19892 extern(System) int function (cef_xml_reader_t* self) nothrow has_attributes; 19893 19894 /// 19895 /// Returns the number of attributes. 19896 /// 19897 extern(System) size_t function (cef_xml_reader_t* self) nothrow get_attribute_count; 19898 19899 /// 19900 /// Returns the value of the attribute at the specified 0-based index. 19901 /// 19902 // The resulting string must be freed by calling cef_string_userfree_free(). 19903 extern(System) cef_string_userfree_t function ( 19904 cef_xml_reader_t* self, 19905 int index) nothrow get_attribute_byindex; 19906 19907 /// 19908 /// Returns the value of the attribute with the specified qualified name. 19909 /// 19910 // The resulting string must be freed by calling cef_string_userfree_free(). 19911 extern(System) cef_string_userfree_t function ( 19912 cef_xml_reader_t* self, 19913 const(cef_string_t)* qualifiedName) nothrow get_attribute_byqname; 19914 19915 /// 19916 /// Returns the value of the attribute with the specified local name and 19917 /// namespace URI. 19918 /// 19919 // The resulting string must be freed by calling cef_string_userfree_free(). 19920 extern(System) cef_string_userfree_t function ( 19921 cef_xml_reader_t* self, 19922 const(cef_string_t)* localName, 19923 const(cef_string_t)* namespaceURI) nothrow get_attribute_bylname; 19924 19925 /// 19926 /// Returns an XML representation of the current node's children. 19927 /// 19928 // The resulting string must be freed by calling cef_string_userfree_free(). 19929 extern(System) cef_string_userfree_t function (cef_xml_reader_t* self) nothrow get_inner_xml; 19930 19931 /// 19932 /// Returns an XML representation of the current node including its children. 19933 /// 19934 // The resulting string must be freed by calling cef_string_userfree_free(). 19935 extern(System) cef_string_userfree_t function (cef_xml_reader_t* self) nothrow get_outer_xml; 19936 19937 /// 19938 /// Returns the line number for the current node. 19939 /// 19940 extern(System) int function (cef_xml_reader_t* self) nothrow get_line_number; 19941 19942 /// 19943 /// Moves the cursor to the attribute at the specified 0-based index. Returns 19944 /// true (1) if the cursor position was set successfully. 19945 /// 19946 extern(System) int function ( 19947 cef_xml_reader_t* self, 19948 int index) nothrow move_to_attribute_byindex; 19949 19950 /// 19951 /// Moves the cursor to the attribute with the specified qualified name. 19952 /// Returns true (1) if the cursor position was set successfully. 19953 /// 19954 extern(System) int function ( 19955 cef_xml_reader_t* self, 19956 const(cef_string_t)* qualifiedName) nothrow move_to_attribute_byqname; 19957 19958 /// 19959 /// Moves the cursor to the attribute with the specified local name and 19960 /// namespace URI. Returns true (1) if the cursor position was set 19961 /// successfully. 19962 /// 19963 extern(System) int function ( 19964 cef_xml_reader_t* self, 19965 const(cef_string_t)* localName, 19966 const(cef_string_t)* namespaceURI) nothrow move_to_attribute_bylname; 19967 19968 /// 19969 /// Moves the cursor to the first attribute in the current element. Returns 19970 /// true (1) if the cursor position was set successfully. 19971 /// 19972 extern(System) int function (cef_xml_reader_t* self) nothrow move_to_first_attribute; 19973 19974 /// 19975 /// Moves the cursor to the next attribute in the current element. Returns 19976 /// true (1) if the cursor position was set successfully. 19977 /// 19978 extern(System) int function (cef_xml_reader_t* self) nothrow move_to_next_attribute; 19979 19980 /// 19981 /// Moves the cursor back to the carrying element. Returns true (1) if the 19982 /// cursor position was set successfully. 19983 /// 19984 extern(System) int function (cef_xml_reader_t* self) nothrow move_to_carrying_element; 19985 } 19986 19987 19988 19989 /// 19990 /// Create a new cef_xml_reader_t object. The returned object's functions can 19991 /// only be called from the thread that created the object. 19992 /// 19993 cef_xml_reader_t* cef_xml_reader_create ( 19994 cef_stream_reader_t* stream, 19995 cef_xml_encoding_type_t encodingType, 19996 const(cef_string_t)* URI); 19997 19998 // CEF_INCLUDE_CAPI_CEF_XML_READER_CAPI_H_ 19999 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 20000 // 20001 // Redistribution and use in source and binary forms, with or without 20002 // modification, are permitted provided that the following conditions are 20003 // met: 20004 // 20005 // * Redistributions of source code must retain the above copyright 20006 // notice, this list of conditions and the following disclaimer. 20007 // * Redistributions in binary form must reproduce the above 20008 // copyright notice, this list of conditions and the following disclaimer 20009 // in the documentation and/or other materials provided with the 20010 // distribution. 20011 // * Neither the name of Google Inc. nor the name Chromium Embedded 20012 // Framework nor the names of its contributors may be used to endorse 20013 // or promote products derived from this software without specific prior 20014 // written permission. 20015 // 20016 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20017 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20018 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20019 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20020 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20021 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 20022 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20023 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20024 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 20025 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 20026 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 20027 // 20028 // --------------------------------------------------------------------------- 20029 // 20030 // This file was generated by the CEF translator tool and should not edited 20031 // by hand. See the translator.README.txt file in the tools directory for 20032 // more information. 20033 // 20034 // $hash=5e121ff2140e0f1228fd8e2ad632c804ab854210$ 20035 // 20036 20037 extern (C): 20038 20039 /// 20040 /// Structure that supports the reading of zip archives via the zlib unzip API. 20041 /// The functions of this structure should only be called on the thread that 20042 /// creates the object. 20043 /// 20044 struct cef_zip_reader_t 20045 { 20046 /// 20047 /// Base structure. 20048 /// 20049 cef_base_ref_counted_t base; 20050 20051 /// 20052 /// Moves the cursor to the first file in the archive. Returns true (1) if the 20053 /// cursor position was set successfully. 20054 /// 20055 extern(System) int function (cef_zip_reader_t* self) nothrow move_to_first_file; 20056 20057 /// 20058 /// Moves the cursor to the next file in the archive. Returns true (1) if the 20059 /// cursor position was set successfully. 20060 /// 20061 extern(System) int function (cef_zip_reader_t* self) nothrow move_to_next_file; 20062 20063 /// 20064 /// Moves the cursor to the specified file in the archive. If |caseSensitive| 20065 /// is true (1) then the search will be case sensitive. Returns true (1) if 20066 /// the cursor position was set successfully. 20067 /// 20068 extern(System) int function ( 20069 cef_zip_reader_t* self, 20070 const(cef_string_t)* fileName, 20071 int caseSensitive) nothrow move_to_file; 20072 20073 /// 20074 /// Closes the archive. This should be called directly to ensure that cleanup 20075 /// occurs on the correct thread. 20076 /// 20077 extern(System) int function (cef_zip_reader_t* self) nothrow close; 20078 20079 /// 20080 /// Returns the name of the file. 20081 /// 20082 // The resulting string must be freed by calling cef_string_userfree_free(). 20083 extern(System) cef_string_userfree_t function (cef_zip_reader_t* self) nothrow get_file_name; 20084 20085 /// 20086 /// Returns the uncompressed size of the file. 20087 /// 20088 extern(System) int64 function (cef_zip_reader_t* self) nothrow get_file_size; 20089 20090 /// 20091 /// Returns the last modified timestamp for the file. 20092 /// 20093 extern(System) cef_basetime_t function (cef_zip_reader_t* self) nothrow get_file_last_modified; 20094 20095 /// 20096 /// Opens the file for reading of uncompressed data. A read password may 20097 /// optionally be specified. 20098 /// 20099 extern(System) int function ( 20100 cef_zip_reader_t* self, 20101 const(cef_string_t)* password) nothrow open_file; 20102 20103 /// 20104 /// Closes the file. 20105 /// 20106 extern(System) int function (cef_zip_reader_t* self) nothrow close_file; 20107 20108 /// 20109 /// Read uncompressed file contents into the specified buffer. Returns < 0 if 20110 /// an error occurred, 0 if at the end of file, or the number of bytes read. 20111 /// 20112 extern(System) int function ( 20113 cef_zip_reader_t* self, 20114 void* buffer, 20115 size_t bufferSize) nothrow read_file; 20116 20117 /// 20118 /// Returns the current offset in the uncompressed file contents. 20119 /// 20120 extern(System) int64 function (cef_zip_reader_t* self) nothrow tell; 20121 20122 /// 20123 /// Returns true (1) if at end of the file contents. 20124 /// 20125 extern(System) int function (cef_zip_reader_t* self) nothrow eof; 20126 } 20127 20128 20129 20130 /// 20131 /// Create a new cef_zip_reader_t object. The returned object's functions can 20132 /// only be called from the thread that created the object. 20133 /// 20134 cef_zip_reader_t* cef_zip_reader_create (cef_stream_reader_t* stream); 20135 20136 // CEF_INCLUDE_CAPI_CEF_ZIP_READER_CAPI_H_ 20137 } 20138 20139 } 20140 20141 20142 version(Windows) { 20143 20144 /* ************************************ */ 20145 20146 // File generated by idl2d from 20147 // C:\Users\me\source\repos\webviewtest\packages\Microsoft.Web.WebView2.1.0.664.37\WebView2.idl 20148 //module webview2; 20149 20150 public import core.sys.windows.windows; 20151 public import core.sys.windows.unknwn; 20152 public import core.sys.windows.oaidl; 20153 public import core.sys.windows.objidl; 20154 20155 alias EventRegistrationToken = long; 20156 20157 // Copyright (C) Microsoft Corporation. All rights reserved. 20158 // Use of this source code is governed by a BSD-style license that can be 20159 // found in the LICENSE file. 20160 20161 /+ 20162 Copyright (C) Microsoft Corporation. All rights reserved. 20163 20164 Redistribution and use in source and binary forms, with or without 20165 modification, are permitted provided that the following conditions are 20166 met: 20167 20168 * Redistributions of source code must retain the above copyright 20169 notice, this list of conditions and the following disclaimer. 20170 * Redistributions in binary form must reproduce the above 20171 copyright notice, this list of conditions and the following disclaimer 20172 in the documentation and/or other materials provided with the 20173 distribution. 20174 * The name of Microsoft Corporation, or the names of its contributors 20175 may not be used to endorse or promote products derived from this 20176 software without specific prior written permission. 20177 20178 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20179 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20180 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20181 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20182 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20183 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 20184 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20185 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20186 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 20187 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 20188 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 20189 +/ 20190 20191 // # API Review 20192 // All APIs need API review. List API review documents here with the URI to the 20193 // doc and the change ID of the IDL when the document was created. 20194 // API documents: 20195 // * 916246ec [WebView2 API Specification](https://aka.ms/WebView2APISpecification) 20196 // 20197 // # Style 20198 // Follow the [Win32 API Design Guidelines](https://aka.ms/Win32APIDesignGuidelines) 20199 // while editing this file. For any style rules unspecified follow the Anaheim 20200 // style. Specifically, follow Anaheim indenting and line limit style rules in 20201 // this file. 20202 // 20203 // # Documentation 20204 // Please ensure that any new API includes complete documentation in its 20205 // JavaDoc comments in this file and sample usage in the Sample App. 20206 // Comments intended for public API documentation should start with 3 slashes. 20207 // The first sentence is the brief the brief description of the API and 20208 // shouldn't include the name of the API. Use markdown to style your public API 20209 // documentation. 20210 // 20211 // # WebView and JavaScript capitalization 20212 // camel case | webViewExample | javaScriptExample 20213 // Pascal case | WebViewExample | JavaScriptExample 20214 // Upper case | WEBVIEW_EXAMPLE | JAVASCRIPT_EXAMPLE 20215 // 20216 // That said, in API names use the term 'script' rather than 'JavaScript'. 20217 // Script is shorter and there is only one supported scripting language on the 20218 // web so the specificity of JavaScript is unnecessary. 20219 // 20220 // # URI (not URL) 20221 // We use Uri in parameter names and type names 20222 // throughout. URIs identify resources while URLs (a subset of URIs) also 20223 // locates resources. This difference is not generally well understood. Because 20224 // all URLs are URIs we can ignore the conversation of trying to explain the 20225 // difference between the two and still be technically accurate by always using 20226 // the term URI. Additionally, whether a URI is locatable depends on the context 20227 // since end developers can at runtime specify custom URI scheme resolvers. 20228 // 20229 // # Event pattern 20230 // Events have a method to add and to remove event handlers: 20231 // ``` 20232 // HRESULT add_{EventName}( 20233 // ICoreWebView2{EventName}EventHandler* eventHandler, 20234 // EventRegistrationToken* token); 20235 // 20236 // HRESULT remove_{EventName}(EventRegistrationToken token); 20237 // ``` 20238 // Add takes an event handler delegate interface with a single Invoke method. 20239 // ``` 20240 // ICoreWebView2{EventName}EventHandler::Invoke( 20241 // {SenderType}* sender, 20242 // ICoreWebView2{EventHandler}EventArgs* args); 20243 // ``` 20244 // The Invoke method has two parameters. The first is the sender, the object 20245 // which is firing the event. The second is the EventArgs type. It doesn't take 20246 // the event arg parameters directly so we can version interfaces correctly. 20247 // If the event has no properties on its event args type, then the Invoke method 20248 // should take IUnknown* as its event args parameter so it is possible to add 20249 // event args interfaces in the future without requiring a new event. For events 20250 // with no sender (a static event), the Invoke method has only the event args 20251 // parameter. 20252 // 20253 // # Deferrable event pattern 20254 // Generally, events should be deferrable when their event args have settable 20255 // properties. In order for the caller to use asynchronous methods to produce 20256 // the value for those settable properties we must allow the caller to defer 20257 // the WebView reading those properties until asynchronously later. A deferrable 20258 // event should have the following method on its event args interface: 20259 // `HRESULT GetDeferral([out, retval] ICoreWebView2Deferral** deferral);` 20260 // If called, the event is deferred and calling Complete on the 20261 // ICoreWebView2Deferral ends the deferral. 20262 // 20263 // # Asynchronous method pattern 20264 // Async methods take a final parameter that is the completed handler: 20265 // `{MethodName}(..., ICoreWebView2{MethodName}CompletedHandler* handler)` 20266 // The handler has a single Invoke method: 20267 // `ICoreWebView2{MethodName}CompletedHandler::Invoke( 20268 // HRESULT errorCode, {AsyncReturnType});` 20269 // 20270 // # Property pattern 20271 // For properties with getters in IDL you have 20272 // `[propget] HRESULT {PropertyName}([out, retval] {PropertyType}*)` 20273 // And for properties which also have setters in IDL you have 20274 // `[propput] HRESULT {PropertyName}([in] {PropertyType});` 20275 // 20276 // # Versioning 20277 // The loader DLL may be older or newer than the client DLL. We have to deal 20278 // with compatibility across several dimensions: 20279 // * There's the DLL export contract between the loader DLL and the client 20280 // DLL as well as the interfaces defined in this IDL that are built into both 20281 // the app code and the client DLL. 20282 // * There are two kinds of versioned changes we need to be able to make: 20283 // compatible changes and breaking changes. In both cases we need to make the 20284 // change in a safe manner. For compatible that means everything continues to 20285 // work unchanged despite the loader and client being different versions. For 20286 // breaking changes this means the host app is unable to create a 20287 // WebView using the different version browser and receives an associated 20288 // error message (doesn't crash). 20289 // * We also need to consider when the loader and host app is using a newer 20290 // version than the browser and when the loader and host app is using an 20291 // older version than the browser. 20292 // 20293 // ## Scenario 1: Older SDK in host app, Newer browser, Compatible change 20294 // In order to be compatible the newer client DLL must still support the older 20295 // client DLL exports. Similarly for the interfaces - they must all be exactly 20296 // the same with no modified IIDs, no reordered methods, no modified method 20297 // parameters and so on. The client DLL may have more DLL exports and more interfaces 20298 // but no changes to the older shipped DLL export or interfaces. 20299 // App code doesn't need to do anything special in this case. 20300 // 20301 // ## Scenario 2: Older SDK in host app, Newer browser, Breaking change 20302 // For breaking changes in the DLL export, the client DLL must change the DLL 20303 // export name. The old loader will attempt to use the old client DLL export. 20304 // When the loader finds the export missing it will fail. 20305 // For breaking changes in the interface, we must change the IID of the modified 20306 // interface. Additionally the loader DLL must validate that the returned object 20307 // supports the IID it expects and fail otherwise. 20308 // The app code must ensure that WebView objects succeed in their QueryInterface 20309 // calls. Basically the app code must have error handling for objects failing 20310 // QueryInterface and for the initial creation failing in order to handle 20311 // breaking changes gracefully. 20312 // 20313 // ## Scenario 3: Newer SDK in host app, Older browser, Compatible change 20314 // In order to be compatible, the newer loader DLL must fallback to calling the 20315 // older client DLL exports if the client DLL doesn't have the most recent DLL 20316 // exports. 20317 // For interface versioning the loader DLL shouldn't be impacted. 20318 // The app code must not assume an object supports all newer versioned 20319 // interfaces. Ideally it checks the success of QueryInterface for newer 20320 // interfaces and if not supported turns off associated app features or 20321 // otherwise fails gracefully. 20322 // 20323 // ## Scenario 4: Newer SDK in host app, Older browser, Breaking change 20324 // For breaking changes in the DLL export, a new export name will be used after 20325 // a breaking change and the loader DLL will just not check for pre-breaking 20326 // change exports from the client DLL. If the client DLL doesn't have the 20327 // correct exports, then the loader returns failure to the caller. 20328 // For breaking changes in the interface, the IIDs of broken interfaces will 20329 // have been modified. The loader will validate that the 20330 // object returned supports the correct base interface IID and return failure to 20331 // the caller otherwise. 20332 // The app code must allow for QueryInterface calls to fail if the object 20333 // doesn't support the newer IIDs. 20334 // 20335 // ## Actions 20336 // * DLL export compatible changes: Create a new DLL export with a new name. 20337 // Ideally implement the existing DLL export as a call into the new DLL 20338 // export to reduce upkeep burden. 20339 // * DLL export breaking changes: Give the modified DLL export a new name and 20340 // remove all older DLL exports. 20341 // * Interface compatible changes: Don't modify shipped interfaces. Add a new 20342 // interface with an incremented version number suffix 20343 // (ICoreWebView2_3) or feature group name suffix 20344 // (ICoreWebView2WithNavigationHistory). 20345 // * Interface breaking changes: After modifying a shipped interface, give it 20346 // a new IID. 20347 // * Loader: When finding the client DLL export it must check its known range 20348 // of compatible exports in order from newest to oldest and use the newest 20349 // one found. It must not attempt to use an older export from before a 20350 // breaking change. Before returning objects to the caller, the loader must 20351 // validate that the object actually implements the expected interface. 20352 // * App code: Check for error from the DLL export methods as they can fail if 20353 // the loader is used with an old browser from before a breaking change or 20354 // with a newer browser that is after a breaking change. 20355 // Check for errors when calling QueryInterface on a WebView object. The 20356 // QueryInterface call may fail with E_NOINTERFACE if the object is from an 20357 // older browser version that doesn't support the newer interface or if 20358 // using a newer browser version that had a breaking change on that 20359 // interface. 20360 20361 /+[uuid(26d34152-879f-4065-bea2-3daa2cfadfb8), version(1.0)]+/ 20362 /+ library WebView2 +/ 20363 20364 // Interface forward declarations 20365 /+ interface ICoreWebView2AcceleratorKeyPressedEventArgs; +/ 20366 /+ interface ICoreWebView2AcceleratorKeyPressedEventHandler; +/ 20367 /+ interface ICoreWebView2AddScriptToExecuteOnDocumentCreatedCompletedHandler; +/ 20368 /+ interface ICoreWebView2CallDevToolsProtocolMethodCompletedHandler; +/ 20369 /+ interface ICoreWebView2CapturePreviewCompletedHandler; +/ 20370 /+ interface ICoreWebView2; +/ 20371 /+ interface ICoreWebView2Controller; +/ 20372 /+ interface ICoreWebView2ContentLoadingEventArgs; +/ 20373 /+ interface ICoreWebView2ContentLoadingEventHandler; +/ 20374 /+ interface ICoreWebView2DocumentTitleChangedEventHandler; +/ 20375 /+ interface ICoreWebView2ContainsFullScreenElementChangedEventHandler; +/ 20376 /+ interface ICoreWebView2CreateCoreWebView2ControllerCompletedHandler; +/ 20377 /+ interface ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler; +/ 20378 /+ interface ICoreWebView2Deferral; +/ 20379 /+ interface ICoreWebView2DevToolsProtocolEventReceivedEventArgs; +/ 20380 /+ interface ICoreWebView2DevToolsProtocolEventReceivedEventHandler; +/ 20381 /+ interface ICoreWebView2DevToolsProtocolEventReceiver; +/ 20382 /+ interface ICoreWebView2Environment; +/ 20383 /+ interface ICoreWebView2EnvironmentOptions; +/ 20384 /+ interface ICoreWebView2ExecuteScriptCompletedHandler; +/ 20385 /+ interface ICoreWebView2FocusChangedEventHandler; +/ 20386 /+ interface ICoreWebView2HistoryChangedEventHandler; +/ 20387 /+ interface ICoreWebView2HttpHeadersCollectionIterator; +/ 20388 /+ interface ICoreWebView2HttpRequestHeaders; +/ 20389 /+ interface ICoreWebView2HttpResponseHeaders; +/ 20390 /+ interface ICoreWebView2MoveFocusRequestedEventArgs; +/ 20391 /+ interface ICoreWebView2MoveFocusRequestedEventHandler; +/ 20392 /+ interface ICoreWebView2NavigationCompletedEventArgs; +/ 20393 /+ interface ICoreWebView2NavigationCompletedEventHandler; +/ 20394 /+ interface ICoreWebView2NavigationStartingEventArgs; +/ 20395 /+ interface ICoreWebView2NavigationStartingEventHandler; +/ 20396 /+ interface ICoreWebView2NewBrowserVersionAvailableEventHandler; +/ 20397 /+ interface ICoreWebView2NewWindowRequestedEventArgs; +/ 20398 /+ interface ICoreWebView2NewWindowRequestedEventHandler; +/ 20399 /+ interface ICoreWebView2PermissionRequestedEventArgs; +/ 20400 /+ interface ICoreWebView2PermissionRequestedEventHandler; +/ 20401 /+ interface ICoreWebView2ProcessFailedEventArgs; +/ 20402 /+ interface ICoreWebView2ProcessFailedEventHandler; +/ 20403 /+ interface ICoreWebView2ScriptDialogOpeningEventArgs; +/ 20404 /+ interface ICoreWebView2ScriptDialogOpeningEventHandler; +/ 20405 /+ interface ICoreWebView2Settings; +/ 20406 /+ interface ICoreWebView2SourceChangedEventArgs; +/ 20407 /+ interface ICoreWebView2SourceChangedEventHandler; +/ 20408 /+ interface ICoreWebView2WebMessageReceivedEventArgs; +/ 20409 /+ interface ICoreWebView2WebMessageReceivedEventHandler; +/ 20410 /+ interface ICoreWebView2WebResourceRequest; +/ 20411 /+ interface ICoreWebView2WebResourceRequestedEventArgs; +/ 20412 /+ interface ICoreWebView2WebResourceRequestedEventHandler; +/ 20413 /+ interface ICoreWebView2WebResourceResponse; +/ 20414 /+ interface ICoreWebView2WindowCloseRequestedEventHandler; +/ 20415 /+ interface ICoreWebView2WindowFeatures; +/ 20416 /+ interface ICoreWebView2ZoomFactorChangedEventHandler; +/ 20417 20418 // Enums and structs 20419 /// Image format used by the ICoreWebView2::CapturePreview method. 20420 /+[v1_enum]+/ 20421 enum /+ COREWEBVIEW2_CAPTURE_PREVIEW_IMAGE_FORMAT+/ 20422 { 20423 /// PNG image format. 20424 COREWEBVIEW2_CAPTURE_PREVIEW_IMAGE_FORMAT_PNG, 20425 /// JPEG image format. 20426 COREWEBVIEW2_CAPTURE_PREVIEW_IMAGE_FORMAT_JPEG, 20427 } 20428 alias int COREWEBVIEW2_CAPTURE_PREVIEW_IMAGE_FORMAT; 20429 20430 /// Kind of JavaScript dialog used in the 20431 /// ICoreWebView2ScriptDialogOpeningEventHandler interface. 20432 /+[v1_enum]+/ 20433 enum /+ COREWEBVIEW2_SCRIPT_DIALOG_KIND+/ 20434 { 20435 /// A dialog invoked via the window.alert JavaScript function. 20436 COREWEBVIEW2_SCRIPT_DIALOG_KIND_ALERT, 20437 /// A dialog invoked via the window.confirm JavaScript function. 20438 COREWEBVIEW2_SCRIPT_DIALOG_KIND_CONFIRM, 20439 /// A dialog invoked via the window.prompt JavaScript function. 20440 COREWEBVIEW2_SCRIPT_DIALOG_KIND_PROMPT, 20441 /// A dialog invoked via the beforeunload JavaScript event. 20442 COREWEBVIEW2_SCRIPT_DIALOG_KIND_BEFOREUNLOAD, 20443 } 20444 alias int COREWEBVIEW2_SCRIPT_DIALOG_KIND; 20445 20446 /// Kind of process failure used in the ICoreWebView2ProcessFailedEventHandler 20447 /// interface. 20448 /+[v1_enum]+/ 20449 enum /+ COREWEBVIEW2_PROCESS_FAILED_KIND+/ 20450 { 20451 /// Indicates the browser process terminated unexpectedly. 20452 /// The WebView automatically goes into the Closed state. 20453 /// The app has to recreate a new WebView to recover from this failure. 20454 COREWEBVIEW2_PROCESS_FAILED_KIND_BROWSER_PROCESS_EXITED, 20455 20456 /// Indicates the render process terminated unexpectedly. 20457 /// A new render process will be created automatically and navigated to an 20458 /// error page. 20459 /// The app can use Reload to try to recover from this failure. 20460 COREWEBVIEW2_PROCESS_FAILED_KIND_RENDER_PROCESS_EXITED, 20461 20462 /// Indicates the render process becomes unresponsive. 20463 // Note that this does not seem to work right now. 20464 // Does not fire for simple long running script case, the only related test 20465 // SitePerProcessBrowserTest::NoCommitTimeoutForInvisibleWebContents is 20466 // disabled. 20467 COREWEBVIEW2_PROCESS_FAILED_KIND_RENDER_PROCESS_UNRESPONSIVE, 20468 } 20469 alias int COREWEBVIEW2_PROCESS_FAILED_KIND; 20470 20471 /// The type of a permission request. 20472 /+[v1_enum]+/ 20473 enum /+ COREWEBVIEW2_PERMISSION_KIND+/ 20474 { 20475 /// Unknown permission. 20476 COREWEBVIEW2_PERMISSION_KIND_UNKNOWN_PERMISSION, 20477 20478 /// Permission to capture audio. 20479 COREWEBVIEW2_PERMISSION_KIND_MICROPHONE, 20480 20481 /// Permission to capture video. 20482 COREWEBVIEW2_PERMISSION_KIND_CAMERA, 20483 20484 /// Permission to access geolocation. 20485 COREWEBVIEW2_PERMISSION_KIND_GEOLOCATION, 20486 20487 /// Permission to send web notifications. 20488 /// This permission request is currently auto rejected and 20489 /// no event is fired for it. 20490 COREWEBVIEW2_PERMISSION_KIND_NOTIFICATIONS, 20491 20492 /// Permission to access generic sensor. 20493 /// Generic Sensor covering ambient-light-sensor, accelerometer, gyroscope 20494 /// and magnetometer. 20495 COREWEBVIEW2_PERMISSION_KIND_OTHER_SENSORS, 20496 20497 /// Permission to read system clipboard without a user gesture. 20498 COREWEBVIEW2_PERMISSION_KIND_CLIPBOARD_READ, 20499 } 20500 alias int COREWEBVIEW2_PERMISSION_KIND; 20501 20502 /// Response to a permission request. 20503 /+[v1_enum]+/ 20504 enum /+ COREWEBVIEW2_PERMISSION_STATE+/ 20505 { 20506 /// Use default browser behavior, which normally prompt users for decision. 20507 COREWEBVIEW2_PERMISSION_STATE_DEFAULT, 20508 20509 /// Grant the permission request. 20510 COREWEBVIEW2_PERMISSION_STATE_ALLOW, 20511 20512 /// Deny the permission request. 20513 COREWEBVIEW2_PERMISSION_STATE_DENY, 20514 } 20515 alias int COREWEBVIEW2_PERMISSION_STATE; 20516 20517 /// Error status values for web navigations. 20518 /+[v1_enum]+/ 20519 enum /+ COREWEBVIEW2_WEB_ERROR_STATUS+/ 20520 { 20521 /// An unknown error occurred. 20522 COREWEBVIEW2_WEB_ERROR_STATUS_UNKNOWN, 20523 20524 /// The SSL certificate common name does not match the web address. 20525 COREWEBVIEW2_WEB_ERROR_STATUS_CERTIFICATE_COMMON_NAME_IS_INCORRECT, 20526 20527 /// The SSL certificate has expired. 20528 COREWEBVIEW2_WEB_ERROR_STATUS_CERTIFICATE_EXPIRED, 20529 20530 /// The SSL client certificate contains errors. 20531 COREWEBVIEW2_WEB_ERROR_STATUS_CLIENT_CERTIFICATE_CONTAINS_ERRORS, 20532 20533 /// The SSL certificate has been revoked. 20534 COREWEBVIEW2_WEB_ERROR_STATUS_CERTIFICATE_REVOKED, 20535 20536 /// The SSL certificate is invalid -- this could mean the certificate did not 20537 /// match the public key pins for the host name, the certificate is signed by 20538 /// an untrusted authority or using a weak sign algorithm, the certificate 20539 /// claimed DNS names violate name constraints, the certificate contains a 20540 /// weak key, the certificate's validity period is too long, lack of 20541 /// revocation information or revocation mechanism, non-unique host name, lack 20542 /// of certificate transparency information, or the certificate is chained to 20543 /// a [legacy Symantec 20544 /// root](https://security.googleblog.com/2018/03/distrust-of-symantec-pki-immediate.html). 20545 COREWEBVIEW2_WEB_ERROR_STATUS_CERTIFICATE_IS_INVALID, 20546 20547 /// The host is unreachable. 20548 COREWEBVIEW2_WEB_ERROR_STATUS_SERVER_UNREACHABLE, 20549 20550 /// The connection has timed out. 20551 COREWEBVIEW2_WEB_ERROR_STATUS_TIMEOUT, 20552 20553 /// The server returned an invalid or unrecognized response. 20554 COREWEBVIEW2_WEB_ERROR_STATUS_ERROR_HTTP_INVALID_SERVER_RESPONSE, 20555 20556 /// The connection was aborted. 20557 COREWEBVIEW2_WEB_ERROR_STATUS_CONNECTION_ABORTED, 20558 20559 /// The connection was reset. 20560 COREWEBVIEW2_WEB_ERROR_STATUS_CONNECTION_RESET, 20561 20562 /// The Internet connection has been lost. 20563 COREWEBVIEW2_WEB_ERROR_STATUS_DISCONNECTED, 20564 20565 /// Cannot connect to destination. 20566 COREWEBVIEW2_WEB_ERROR_STATUS_CANNOT_CONNECT, 20567 20568 /// Could not resolve provided host name. 20569 COREWEBVIEW2_WEB_ERROR_STATUS_HOST_NAME_NOT_RESOLVED, 20570 20571 /// The operation was canceled. 20572 COREWEBVIEW2_WEB_ERROR_STATUS_OPERATION_CANCELED, 20573 20574 /// The request redirect failed. 20575 COREWEBVIEW2_WEB_ERROR_STATUS_REDIRECT_FAILED, 20576 20577 /// An unexpected error occurred. 20578 COREWEBVIEW2_WEB_ERROR_STATUS_UNEXPECTED_ERROR, 20579 } 20580 alias int COREWEBVIEW2_WEB_ERROR_STATUS; 20581 20582 /// Enum for web resource request contexts. 20583 /+[v1_enum]+/ 20584 enum /+ COREWEBVIEW2_WEB_RESOURCE_CONTEXT+/ 20585 { 20586 /// All resources 20587 COREWEBVIEW2_WEB_RESOURCE_CONTEXT_ALL, 20588 /// Document resources 20589 COREWEBVIEW2_WEB_RESOURCE_CONTEXT_DOCUMENT, 20590 /// CSS resources 20591 COREWEBVIEW2_WEB_RESOURCE_CONTEXT_STYLESHEET, 20592 /// Image resources 20593 COREWEBVIEW2_WEB_RESOURCE_CONTEXT_IMAGE, 20594 /// Other media resources such as videos 20595 COREWEBVIEW2_WEB_RESOURCE_CONTEXT_MEDIA, 20596 /// Font resources 20597 COREWEBVIEW2_WEB_RESOURCE_CONTEXT_FONT, 20598 /// Script resources 20599 COREWEBVIEW2_WEB_RESOURCE_CONTEXT_SCRIPT, 20600 /// XML HTTP requests 20601 COREWEBVIEW2_WEB_RESOURCE_CONTEXT_XML_HTTP_REQUEST, 20602 /// Fetch API communication 20603 COREWEBVIEW2_WEB_RESOURCE_CONTEXT_FETCH, 20604 /// TextTrack resources 20605 COREWEBVIEW2_WEB_RESOURCE_CONTEXT_TEXT_TRACK, 20606 /// EventSource API communication 20607 COREWEBVIEW2_WEB_RESOURCE_CONTEXT_EVENT_SOURCE, 20608 /// WebSocket API communication 20609 COREWEBVIEW2_WEB_RESOURCE_CONTEXT_WEBSOCKET, 20610 /// Web App Manifests 20611 COREWEBVIEW2_WEB_RESOURCE_CONTEXT_MANIFEST, 20612 /// Signed HTTP Exchanges 20613 COREWEBVIEW2_WEB_RESOURCE_CONTEXT_SIGNED_EXCHANGE, 20614 /// Ping requests 20615 COREWEBVIEW2_WEB_RESOURCE_CONTEXT_PING, 20616 /// CSP Violation Reports 20617 COREWEBVIEW2_WEB_RESOURCE_CONTEXT_CSP_VIOLATION_REPORT, 20618 /// Other resources 20619 COREWEBVIEW2_WEB_RESOURCE_CONTEXT_OTHER 20620 } 20621 alias int COREWEBVIEW2_WEB_RESOURCE_CONTEXT; 20622 20623 /// Reason for moving focus. 20624 /+[v1_enum]+/ 20625 enum /+ COREWEBVIEW2_MOVE_FOCUS_REASON+/ 20626 { 20627 /// Code setting focus into WebView. 20628 COREWEBVIEW2_MOVE_FOCUS_REASON_PROGRAMMATIC, 20629 20630 /// Moving focus due to Tab traversal forward. 20631 COREWEBVIEW2_MOVE_FOCUS_REASON_NEXT, 20632 20633 /// Moving focus due to Tab traversal backward. 20634 COREWEBVIEW2_MOVE_FOCUS_REASON_PREVIOUS, 20635 } 20636 alias int COREWEBVIEW2_MOVE_FOCUS_REASON; 20637 20638 /// The type of key event that triggered an AcceleratorKeyPressed event. 20639 /+[v1_enum]+/ 20640 enum /+ COREWEBVIEW2_KEY_EVENT_KIND+/ 20641 { 20642 /// Correspond to window message WM_KEYDOWN. 20643 COREWEBVIEW2_KEY_EVENT_KIND_KEY_DOWN, 20644 20645 /// Correspond to window message WM_KEYUP. 20646 COREWEBVIEW2_KEY_EVENT_KIND_KEY_UP, 20647 20648 /// Correspond to window message WM_SYSKEYDOWN. 20649 COREWEBVIEW2_KEY_EVENT_KIND_SYSTEM_KEY_DOWN, 20650 20651 /// Correspond to window message WM_SYSKEYUP. 20652 COREWEBVIEW2_KEY_EVENT_KIND_SYSTEM_KEY_UP, 20653 } 20654 alias int COREWEBVIEW2_KEY_EVENT_KIND; 20655 20656 /// A structure representing the information packed into the LPARAM given 20657 /// to a Win32 key event. See the documentation for WM_KEYDOWN for details 20658 /// at https://docs.microsoft.com/windows/win32/inputdev/wm-keydown 20659 struct COREWEBVIEW2_PHYSICAL_KEY_STATUS 20660 { 20661 /// The repeat count for the current message. 20662 UINT32 RepeatCount; 20663 /// The scan code. 20664 UINT32 ScanCode; 20665 /// Indicates whether the key is an extended key. 20666 BOOL IsExtendedKey; 20667 /// The context code. 20668 BOOL IsMenuKeyDown; 20669 /// The previous key state. 20670 BOOL WasKeyDown; 20671 /// The transition state. 20672 BOOL IsKeyReleased; 20673 } 20674 // End of enums and structs 20675 20676 /// WebView2 enables you to host web content using the 20677 /// latest Edge web browser technology. 20678 /// 20679 /// ## Navigation events 20680 /// The normal sequence of navigation events is NavigationStarting, 20681 /// SourceChanged, ContentLoading and then NavigationCompleted. 20682 /// The following events describe the state of WebView during each navigation: 20683 /// NavigationStarting: WebView is starting to navigate and the navigation will 20684 /// result in a network request. The host can disallow the request at this time. 20685 /// SourceChanged: The source of WebView is changed to a new URL. This may also 20686 /// be due to a navigation that doesn't cause a network request such as a fragment 20687 /// navigation. 20688 /// HistoryChanged: WebView's history has been updated as a result of 20689 /// the navigation. 20690 /// ContentLoading: WebView has started loading new content. 20691 /// NavigationCompleted: WebView has completed loading content on the new page. 20692 /// Developers can track navigations to each new document by the navigation ID. 20693 /// WebView's navigation ID changes every time there is a successful navigation 20694 /// to a new document. 20695 /// 20696 /// 20697 /// \dot 20698 /// digraph NavigationEvents { 20699 /// node [fontname=Roboto, shape=rectangle] 20700 /// edge [fontname=Roboto] 20701 /// 20702 /// NewDocument -> NavigationStarting; 20703 /// NavigationStarting -> SourceChanged -> ContentLoading [label="New Document"]; 20704 /// ContentLoading -> HistoryChanged; 20705 /// SameDocument -> SourceChanged; 20706 /// SourceChanged -> HistoryChanged [label="Same Document"]; 20707 /// HistoryChanged -> NavigationCompleted; 20708 /// NavigationStarting -> NavigationStarting [label="Redirect"]; 20709 /// NavigationStarting -> NavigationCompleted [label="Failure"]; 20710 /// } 20711 /// \enddot 20712 /// 20713 /// Note that this is for navigation events with the same NavigationId event 20714 /// arg. Navigations events with different NavigationId event args may overlap. 20715 /// For instance, if you start a navigation wait for its NavigationStarting 20716 /// event and then start another navigation you'll see the NavigationStarting 20717 /// for the first navigate followed by the NavigationStarting of the second 20718 /// navigate, followed by the NavigationCompleted for the first navigation and 20719 /// then all the rest of the appropriate navigation events for the second 20720 /// navigation. 20721 /// In error cases there may or may not be a ContentLoading event depending 20722 /// on whether the navigation is continued to an error page. 20723 /// In case of an HTTP redirect, there will be multiple NavigationStarting 20724 /// events in a row, with ones following the first will have their IsRedirect 20725 /// flag set, however navigation ID remains the same. Same document navigations 20726 /// do not result in NavigationStarting event and also do not increment the 20727 /// navigation ID. 20728 /// 20729 /// To monitor or cancel navigations inside subframes in the WebView, use 20730 /// FrameNavigationStarting. 20731 /// 20732 /// ## Process model 20733 /// WebView2 uses the same process model as the Edge web 20734 /// browser. There is one Edge browser process per specified user data directory 20735 /// in a user session that will serve any WebView2 calling 20736 /// process that specifies that user data directory. This means one Edge browser 20737 /// process may be serving multiple calling processes and one calling 20738 /// process may be using multiple Edge browser processes. 20739 /// 20740 /// \dot 20741 /// digraph ProcessModelNClientsNServers { 20742 /// node [fontname=Roboto, shape=rectangle]; 20743 /// edge [fontname=Roboto]; 20744 /// 20745 /// Host1 [label="Calling\nprocess 1"]; 20746 /// Host2 [label="Calling\nprocess 2"]; 20747 /// Browser1 [label="Edge processes\ngroup 1"]; 20748 /// Browser2 [label="Edge processes\ngroup 2"]; 20749 /// 20750 /// Host1 -> Browser1; 20751 /// Host1 -> Browser2; 20752 /// Host2 -> Browser2; 20753 /// } 20754 /// \enddot 20755 /// 20756 /// Associated with each browser process there will be some number of 20757 /// render processes. 20758 /// These are created as 20759 /// necessary to service potentially multiple frames in different WebViews. The 20760 /// number of render processes varies based on the site isolation browser 20761 /// feature and the number of distinct disconnected origins rendered in 20762 /// associated WebViews. 20763 /// 20764 /// \dot 20765 /// digraph ProcessModelClientServer { 20766 /// node [fontname=Roboto, shape=rectangle]; 20767 /// edge [fontname=Roboto]; 20768 /// graph [fontname=Roboto]; 20769 /// 20770 /// Host [label="Calling process"]; 20771 /// subgraph cluster_0 { 20772 /// labeljust = "l"; 20773 /// label = "Edge processes group"; 20774 /// Browser [label="Edge browser\nprocess"]; 20775 /// Render1 [label="Edge render\nprocess 1"]; 20776 /// Render2 [label="Edge render\nprocess 2"]; 20777 /// RenderN [label="Edge render\nprocess N"]; 20778 /// GPU [label="Edge GPU\nprocess"]; 20779 /// } 20780 /// 20781 /// Host -> Browser; 20782 /// Browser -> Render1; 20783 /// Browser -> Render2; 20784 /// Browser -> RenderN; 20785 /// Browser -> GPU; 20786 /// } 20787 /// \enddot 20788 /// 20789 /// You can react to crashes and hangs in these browser and render processes 20790 /// using the ProcessFailure event. 20791 /// 20792 /// You can safely shutdown associated browser and render processes using the 20793 /// Close method. 20794 /// 20795 /// ## Threading model 20796 /// The WebView2 must be created on a UI thread. Specifically a 20797 /// thread with a message pump. All callbacks will occur on that thread and 20798 /// calls into the WebView must be done on that thread. It is not safe to use 20799 /// the WebView from another thread. 20800 /// 20801 /// Callbacks including event handlers and completion handlers execute serially. 20802 /// That is, if you have an event handler running and begin a message loop no 20803 /// other event handlers or completion callbacks will begin executing 20804 /// reentrantly. 20805 /// 20806 /// ## Security 20807 /// Always check the Source property of the WebView before using ExecuteScript, 20808 /// PostWebMessageAsJson, PostWebMessageAsString, or any other method to send 20809 /// information into the WebView. The WebView may have navigated to another page 20810 /// via the end user interacting with the page or script in the page causing 20811 /// navigation. Similarly, be very careful with 20812 /// AddScriptToExecuteOnDocumentCreated. All future navigations will run this 20813 /// script and if it provides access to information intended only for a certain 20814 /// origin, any HTML document may have access. 20815 /// 20816 /// When examining the result of an ExecuteScript method call, a 20817 /// WebMessageReceived event, always check the Source of the sender, or any 20818 /// other mechanism of receiving information from an HTML document in a WebView 20819 /// validate the URI of the HTML document is what you expect. 20820 /// 20821 /// When constructing a message to send into a WebView, prefer using 20822 /// PostWebMessageAsJson and construct the JSON string parameter using a JSON 20823 /// library. This will prevent accidentally encoding information into a JSON string 20824 /// or script, and ensure no attacker controlled input can 20825 /// modify the rest of the JSON message or run arbitrary script. 20826 /// 20827 /// ## String types 20828 /// String out parameters are LPWSTR null terminated strings. The callee 20829 /// allocates the string using CoTaskMemAlloc. Ownership is transferred to the 20830 /// caller and it is up to the caller to free the memory using CoTaskMemFree. 20831 /// 20832 /// String in parameters are LPCWSTR null terminated strings. The caller ensures 20833 /// the string is valid for the duration of the synchronous function call. 20834 /// If the callee needs to retain that value to some point after the function 20835 /// call completes, the callee must allocate its own copy of the string value. 20836 /// 20837 /// ## URI and JSON parsing 20838 /// Various methods provide or accept URIs and JSON as strings. Please use your 20839 /// own preferred library for parsing and generating these strings. 20840 /// 20841 /// If WinRT is available for your app you can use `Windows.Data.Json.JsonObject` 20842 /// and `IJsonObjectStatics` to parse or produce JSON strings or `Windows.Foundation.Uri` 20843 /// and `IUriRuntimeClassFactory` to parse and produce URIs. Both of these work 20844 /// in Win32 apps. 20845 /// 20846 /// If you use IUri and CreateUri to parse URIs you may want to use the 20847 /// following URI creation flags to have CreateUri behavior more closely match 20848 /// the URI parsing in the WebView: 20849 /// `Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME | Uri_CREATE_NO_DECODE_EXTRA_INFO` 20850 /// 20851 /// ## Debugging 20852 /// Open DevTools with the normal shortcuts: `F12` or `Ctrl+Shift+I`. 20853 /// You can use the `--auto-open-devtools-for-tabs` command argument switch to 20854 /// have the DevTools window open immediately when first creating a WebView. See 20855 /// CreateCoreWebView2Controller documentation for how to provide additional command 20856 /// line arguments to the browser process. 20857 /// Check out the LoaderOverride registry key in the CreateCoreWebView2Controller 20858 /// documentation. 20859 /// 20860 /// ## Versioning 20861 /// After you've used a particular version of the SDK to build your app, your 20862 /// app may end up running with an older or newer version of installed browser 20863 /// binaries. Until version 1.0.0.0 of WebView2 there may be breaking changes 20864 /// during updates that will prevent your SDK from working with different 20865 /// versions of installed browser binaries. After version 1.0.0.0 different 20866 /// versions of the SDK can work with different versions of the installed 20867 /// browser by following these best practices: 20868 /// 20869 /// To account for breaking changes to the API be sure to check for failure when 20870 /// calling the DLL export CreateCoreWebView2Environment and when 20871 /// calling QueryInterface on any CoreWebView2 object. A return value of 20872 /// E_NOINTERFACE can indicate the SDK is not compatible with the Edge 20873 /// browser binaries. 20874 /// 20875 /// Checking for failure from QueryInterface will also account for cases where 20876 /// the SDK is newer than the version of the Edge browser and your app attempts 20877 /// to use an interface of which the Edge browser is unaware. 20878 /// 20879 /// When an interface is unavailable, you can consider disabling the associated 20880 /// feature if possible, or otherwise informing the end user they need to update 20881 /// their browser. 20882 const GUID IID_ICoreWebView2 = ICoreWebView2.iid; 20883 20884 interface ICoreWebView2 : IUnknown 20885 { 20886 static const GUID iid = { 0x76eceacb,0x0462,0x4d94,[ 0xac,0x83,0x42,0x3a,0x67,0x93,0x77,0x5e ] }; 20887 extern(Windows): 20888 /// The ICoreWebView2Settings object contains various modifiable settings for 20889 /// the running WebView. 20890 /+[ propget]+/ 20891 HRESULT get_Settings(/+[out, retval]+/ ICoreWebView2Settings * settings); 20892 20893 /// The URI of the current top level document. This value potentially 20894 /// changes as a part of the SourceChanged event firing for some cases 20895 /// such as navigating to a different site or fragment navigations. It will 20896 /// remain the same for other types of navigations such as page reloads or 20897 /// history.pushState with the same URL as the current page. 20898 /// 20899 /// \snippet ControlComponent.cpp SourceChanged 20900 /+[ propget]+/ 20901 HRESULT get_Source(/+[out, retval]+/ LPWSTR* uri); 20902 20903 /// Cause a navigation of the top level document to the specified URI. See 20904 /// the navigation events for more information. Note that this starts a 20905 /// navigation and the corresponding NavigationStarting event will fire 20906 /// sometime after this Navigate call completes. 20907 /// 20908 /// \snippet ControlComponent.cpp Navigate 20909 HRESULT Navigate(in LPCWSTR uri); 20910 20911 /// Initiates a navigation to htmlContent as source HTML of a new 20912 /// document. The htmlContent parameter may not be larger than 2 MB 20913 /// in total size. The origin of the new page will be about:blank. 20914 /// 20915 /// \snippet SettingsComponent.cpp NavigateToString 20916 HRESULT NavigateToString(in LPCWSTR htmlContent); 20917 20918 /// Add an event handler for the NavigationStarting event. 20919 /// NavigationStarting fires when the WebView main frame is 20920 /// requesting permission to navigate to a different URI. This will fire for 20921 /// redirects as well. 20922 /// 20923 /// Corresponding navigations can be blocked until the event handler returns. 20924 /// 20925 /// \snippet SettingsComponent.cpp NavigationStarting 20926 HRESULT add_NavigationStarting( 20927 /+[in]+/ ICoreWebView2NavigationStartingEventHandler eventHandler, 20928 /+[out]+/ EventRegistrationToken* token); 20929 /// Remove an event handler previously added with add_NavigationStarting. 20930 HRESULT remove_NavigationStarting( 20931 in EventRegistrationToken token); 20932 20933 /// Add an event handler for the ContentLoading event. 20934 /// ContentLoading fires before any content is loaded, including scripts added 20935 /// with AddScriptToExecuteOnDocumentCreated. 20936 /// ContentLoading will not fire if a same page navigation occurs 20937 /// (such as through fragment navigations or history.pushState navigations). 20938 /// This follows the NavigationStarting and SourceChanged events and 20939 /// precedes the HistoryChanged and NavigationCompleted events. 20940 HRESULT add_ContentLoading( 20941 /+[in]+/ ICoreWebView2ContentLoadingEventHandler eventHandler, 20942 /+[out]+/ EventRegistrationToken* token); 20943 /// Remove an event handler previously added with add_ContentLoading. 20944 HRESULT remove_ContentLoading( 20945 in EventRegistrationToken token); 20946 20947 /// Add an event handler for the SourceChanged event. 20948 /// SourceChanged fires when the Source property changes. 20949 /// SourceChanged fires for navigating to a different site or fragment 20950 /// navigations. 20951 /// It will not fire for other types of navigations such as page reloads or 20952 /// history.pushState with the same URL as the current page. 20953 /// SourceChanged fires before ContentLoading for navigation to a new document. 20954 /// 20955 /// \snippet ControlComponent.cpp SourceChanged 20956 HRESULT add_SourceChanged( 20957 /+[in]+/ ICoreWebView2SourceChangedEventHandler eventHandler, 20958 /+[out]+/ EventRegistrationToken* token); 20959 /// Remove an event handler previously added with add_SourceChanged. 20960 HRESULT remove_SourceChanged( 20961 in EventRegistrationToken token); 20962 20963 /// Add an event handler for the HistoryChanged event. 20964 /// HistoryChanged listens to the change of navigation history for the top 20965 /// level document. Use HistoryChanged to check if CanGoBack/CanGoForward 20966 /// value has changed. HistoryChanged also fires for using GoBack/GoForward. 20967 /// HistoryChanged fires after SourceChanged and ContentLoading. 20968 /// 20969 /// \snippet ControlComponent.cpp HistoryChanged 20970 HRESULT add_HistoryChanged( 20971 /+[in]+/ ICoreWebView2HistoryChangedEventHandler eventHandler, 20972 /+[out]+/ EventRegistrationToken* token); 20973 /// Remove an event handler previously added with add_HistoryChanged. 20974 HRESULT remove_HistoryChanged( 20975 in EventRegistrationToken token); 20976 20977 /// Add an event handler for the NavigationCompleted event. 20978 /// NavigationCompleted fires when the WebView has completely loaded 20979 /// (body.onload has fired) or loading stopped with error. 20980 /// 20981 /// \snippet ControlComponent.cpp NavigationCompleted 20982 HRESULT add_NavigationCompleted( 20983 /+[in]+/ ICoreWebView2NavigationCompletedEventHandler eventHandler, 20984 /+[out]+/ EventRegistrationToken* token); 20985 /// Remove an event handler previously added with add_NavigationCompleted. 20986 HRESULT remove_NavigationCompleted( 20987 in EventRegistrationToken token); 20988 20989 /// Add an event handler for the FrameNavigationStarting event. 20990 /// FrameNavigationStarting fires when a child frame in the WebView 20991 /// requests permission to navigate to a different URI. This will fire for 20992 /// redirects as well. 20993 /// 20994 /// Corresponding navigations can be blocked until the event handler returns. 20995 /// 20996 /// \snippet SettingsComponent.cpp FrameNavigationStarting 20997 HRESULT add_FrameNavigationStarting( 20998 /+[in]+/ ICoreWebView2NavigationStartingEventHandler eventHandler, 20999 /+[out]+/ EventRegistrationToken* token); 21000 /// Remove an event handler previously added with add_FrameNavigationStarting. 21001 HRESULT remove_FrameNavigationStarting( 21002 in EventRegistrationToken token); 21003 21004 /// Add an event handler for the FrameNavigationCompleted event. 21005 /// FrameNavigationCompleted fires when a child frame has completely 21006 /// loaded (body.onload has fired) or loading stopped with error. 21007 /// 21008 /// \snippet ControlComponent.cpp FrameNavigationCompleted 21009 HRESULT add_FrameNavigationCompleted( 21010 /+[in]+/ ICoreWebView2NavigationCompletedEventHandler eventHandler, 21011 /+[out]+/ EventRegistrationToken* token); 21012 /// Remove an event handler previously added with add_FrameNavigationCompleted. 21013 HRESULT remove_FrameNavigationCompleted( 21014 in EventRegistrationToken token); 21015 21016 /// Add an event handler for the ScriptDialogOpening event. 21017 /// ScriptDialogOpening fires when a JavaScript dialog (alert, confirm, 21018 /// prompt, or beforeunload) will show for the webview. This event only fires 21019 /// if the ICoreWebView2Settings::AreDefaultScriptDialogsEnabled property is 21020 /// set to false. The ScriptDialogOpening event can be used to suppress 21021 /// dialogs or replace default dialogs with custom dialogs. 21022 /// 21023 /// If a deferral is not taken on the event args, the subsequent scripts can be 21024 /// blocked until the event handler returns. If a deferral is taken, then the 21025 /// scripts are blocked until the deferral is completed. 21026 /// 21027 /// \snippet SettingsComponent.cpp ScriptDialogOpening 21028 HRESULT add_ScriptDialogOpening( 21029 /+[in]+/ ICoreWebView2ScriptDialogOpeningEventHandler eventHandler, 21030 /+[out]+/ EventRegistrationToken* token); 21031 /// Remove an event handler previously added with add_ScriptDialogOpening. 21032 HRESULT remove_ScriptDialogOpening( 21033 in EventRegistrationToken token); 21034 21035 /// Add an event handler for the PermissionRequested event. 21036 /// PermissionRequested fires when content in a WebView requests permission to 21037 /// access some privileged resources. 21038 /// 21039 /// If a deferral is not taken on the event args, the subsequent scripts can 21040 /// be blocked until the event handler returns. If a deferral is taken, then 21041 /// the scripts are blocked until the deferral is completed. 21042 /// 21043 /// \snippet SettingsComponent.cpp PermissionRequested 21044 HRESULT add_PermissionRequested( 21045 /+[in]+/ ICoreWebView2PermissionRequestedEventHandler eventHandler, 21046 /+[out]+/ EventRegistrationToken* token); 21047 /// Remove an event handler previously added with add_PermissionRequested. 21048 HRESULT remove_PermissionRequested( 21049 in EventRegistrationToken token); 21050 21051 /// Add an event handler for the ProcessFailed event. 21052 /// ProcessFailed fires when a WebView process is terminated unexpectedly or 21053 /// becomes unresponsive. 21054 /// 21055 /// \snippet ProcessComponent.cpp ProcessFailed 21056 HRESULT add_ProcessFailed( 21057 /+[in]+/ ICoreWebView2ProcessFailedEventHandler eventHandler, 21058 /+[out]+/ EventRegistrationToken* token); 21059 /// Remove an event handler previously added with add_ProcessFailed. 21060 HRESULT remove_ProcessFailed( 21061 in EventRegistrationToken token); 21062 21063 /// Add the provided JavaScript to a list of scripts that should be executed 21064 /// after the global object has been created, but before the HTML document has 21065 /// been parsed and before any other script included by the HTML document is 21066 /// executed. This method injects a script that runs on all top-level document 21067 /// and child frame page navigations. 21068 /// This method runs asynchronously, and you must wait for the completion 21069 /// handler to finish before the injected script is ready to run. When this 21070 /// method completes, the handler's `Invoke` method is called with the `id` of 21071 /// the injected script. `id` is a string. To remove the injected script, use 21072 /// `RemoveScriptToExecuteOnDocumentCreated`. 21073 /// 21074 /// Note that if an HTML document has sandboxing of some kind via 21075 /// [sandbox](https://developer.mozilla.org/docs/Web/HTML/Element/iframe#attr-sandbox) 21076 /// properties or the [Content-Security-Policy HTTP 21077 /// header](https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Security-Policy) 21078 /// this will affect the script run here. So, for example, if the 21079 /// 'allow-modals' keyword is not set then calls to the `alert` function will 21080 /// be ignored. 21081 /// 21082 /// \snippet ScriptComponent.cpp AddScriptToExecuteOnDocumentCreated 21083 HRESULT AddScriptToExecuteOnDocumentCreated( 21084 in LPCWSTR javaScript, 21085 /+[in]+/ ICoreWebView2AddScriptToExecuteOnDocumentCreatedCompletedHandler handler); 21086 21087 /// Remove the corresponding JavaScript added using `AddScriptToExecuteOnDocumentCreated` 21088 /// with the specified script id. 21089 HRESULT RemoveScriptToExecuteOnDocumentCreated(in LPCWSTR id); 21090 21091 /// Execute JavaScript code from the javascript parameter in the 21092 /// current top level document rendered in the WebView. This will execute 21093 /// asynchronously and when complete, if a handler is provided in the 21094 /// ExecuteScriptCompletedHandler parameter, its Invoke method will be 21095 /// called with the result of evaluating the provided JavaScript. The result 21096 /// value is a JSON encoded string. 21097 /// If the result is undefined, contains a reference cycle, or otherwise 21098 /// cannot be encoded into JSON, the JSON null value will be returned as the 21099 /// string 'null'. Note that a function that has no explicit return value 21100 /// returns undefined. 21101 /// If the executed script throws an unhandled exception, then the result is 21102 /// also 'null'. 21103 /// This method is applied asynchronously. If the method is called after 21104 /// NavigationStarting event during a navigation, the script will be executed 21105 /// in the new document when loading it, around the time ContentLoading is 21106 /// fired. ExecuteScript will work even if 21107 /// ICoreWebView2Settings::IsScriptEnabled is set to FALSE. 21108 /// 21109 /// \snippet ScriptComponent.cpp ExecuteScript 21110 HRESULT ExecuteScript( 21111 in LPCWSTR javaScript, 21112 /+[in]+/ ICoreWebView2ExecuteScriptCompletedHandler handler); 21113 21114 /// Capture an image of what WebView is displaying. Specify the 21115 /// format of the image with the imageFormat parameter. 21116 /// The resulting image binary data is written to the provided imageStream 21117 /// parameter. When CapturePreview finishes writing to the stream, the Invoke 21118 /// method on the provided handler parameter is called. 21119 /// 21120 /// \snippet FileComponent.cpp CapturePreview 21121 HRESULT CapturePreview( 21122 in COREWEBVIEW2_CAPTURE_PREVIEW_IMAGE_FORMAT imageFormat, 21123 in IStream* imageStream, 21124 /+[in]+/ ICoreWebView2CapturePreviewCompletedHandler handler); 21125 21126 /// Reload the current page. This is similar to navigating to the URI of 21127 /// current top level document including all navigation events firing and 21128 /// respecting any entries in the HTTP cache. But, the back/forward history 21129 /// will not be modified. 21130 HRESULT Reload(); 21131 21132 /// Post the specified webMessage to the top level document in this WebView. 21133 /// The top level document's window.chrome.webview's message event fires. 21134 /// JavaScript in that document may subscribe and unsubscribe to the event 21135 /// via the following: 21136 /// 21137 /// ``` 21138 /// window.chrome.webview.addEventListener('message', handler) 21139 /// window.chrome.webview.removeEventListener('message', handler) 21140 /// ``` 21141 /// 21142 /// The event args is an instance of `MessageEvent`. 21143 /// The ICoreWebView2Settings::IsWebMessageEnabled setting must be true or 21144 /// this method will fail with E_INVALIDARG. 21145 /// The event arg's data property is the webMessage string parameter parsed 21146 /// as a JSON string into a JavaScript object. 21147 /// The event arg's source property is a reference to the 21148 /// `window.chrome.webview` object. 21149 /// See add_WebMessageReceived for information on sending messages from the 21150 /// HTML document in the WebView to the host. 21151 /// This message is sent asynchronously. If a navigation occurs before the 21152 /// message is posted to the page, then the message will not be sent. 21153 /// 21154 /// \snippet ScenarioWebMessage.cpp WebMessageReceived 21155 HRESULT PostWebMessageAsJson(in LPCWSTR webMessageAsJson); 21156 21157 /// This is a helper for posting a message that is a simple string 21158 /// rather than a JSON string representation of a JavaScript object. This 21159 /// behaves in exactly the same manner as PostWebMessageAsJson but the 21160 /// `window.chrome.webview` message event arg's data property will be a string 21161 /// with the same value as webMessageAsString. Use this instead of 21162 /// PostWebMessageAsJson if you want to communicate via simple strings rather 21163 /// than JSON objects. 21164 HRESULT PostWebMessageAsString(in LPCWSTR webMessageAsString); 21165 21166 /// Add an event handler for the WebMessageReceived event. 21167 /// WebMessageReceived fires when the 21168 /// ICoreWebView2Settings::IsWebMessageEnabled setting is set and the top 21169 /// level document of the WebView calls `window.chrome.webview.postMessage`. 21170 /// The postMessage function is `void postMessage(object)` where 21171 /// object is any object supported by JSON conversion. 21172 /// 21173 /// \snippet ScenarioWebMessage.html chromeWebView 21174 /// 21175 /// When postMessage is called, the handler's Invoke method will be called 21176 /// with the postMessage's object parameter converted to a JSON string. 21177 /// 21178 /// \snippet ScenarioWebMessage.cpp WebMessageReceived 21179 HRESULT add_WebMessageReceived( 21180 /+[in]+/ ICoreWebView2WebMessageReceivedEventHandler handler, 21181 /+[out]+/ EventRegistrationToken* token); 21182 /// Remove an event handler previously added with add_WebMessageReceived. 21183 HRESULT remove_WebMessageReceived( 21184 in EventRegistrationToken token); 21185 21186 /// Call an asynchronous DevToolsProtocol method. See the 21187 /// [DevTools Protocol Viewer](https://aka.ms/DevToolsProtocolDocs) 21188 /// for a list and description of available methods. 21189 /// The methodName parameter is the full name of the method in the format 21190 /// `{domain}.{method}`. 21191 /// The parametersAsJson parameter is a JSON formatted string containing 21192 /// the parameters for the corresponding method. 21193 /// The handler's Invoke method will be called when the method asynchronously 21194 /// completes. Invoke will be called with the method's return object as a 21195 /// JSON string. 21196 /// 21197 /// \snippet ScriptComponent.cpp CallDevToolsProtocolMethod 21198 HRESULT CallDevToolsProtocolMethod( 21199 in LPCWSTR methodName, 21200 in LPCWSTR parametersAsJson, 21201 /+[in]+/ ICoreWebView2CallDevToolsProtocolMethodCompletedHandler handler); 21202 21203 /// The process id of the browser process that hosts the WebView. 21204 /+[ propget]+/ 21205 HRESULT get_BrowserProcessId(/+[out, retval]+/ UINT32* value); 21206 21207 /// Returns true if the WebView can navigate to a previous page in the 21208 /// navigation history. 21209 /// The HistoryChanged event will fire if CanGoBack changes value. 21210 /+[ propget]+/ 21211 HRESULT get_CanGoBack(/+[out, retval]+/ BOOL* canGoBack); 21212 /// Returns true if the WebView can navigate to a next page in the navigation 21213 /// history. 21214 /// The HistoryChanged event will fire if CanGoForward changes value. 21215 /+[ propget]+/ 21216 HRESULT get_CanGoForward(/+[out, retval]+/ BOOL* canGoForward); 21217 /// Navigates the WebView to the previous page in the navigation history. 21218 HRESULT GoBack(); 21219 /// Navigates the WebView to the next page in the navigation history. 21220 HRESULT GoForward(); 21221 21222 /// Get a DevTools Protocol event receiver that allows you to subscribe to 21223 /// a DevTools Protocol event. 21224 /// The eventName parameter is the full name of the event in the format 21225 /// `{domain}.{event}`. 21226 /// See the [DevTools Protocol Viewer](https://aka.ms/DevToolsProtocolDocs) 21227 /// for a list of DevTools Protocol events description, and event args. 21228 /// 21229 /// \snippet ScriptComponent.cpp DevToolsProtocolEventReceived 21230 HRESULT GetDevToolsProtocolEventReceiver( 21231 in LPCWSTR eventName, 21232 /+[out, retval]+/ ICoreWebView2DevToolsProtocolEventReceiver * receiver); 21233 21234 /// Stop all navigations and pending resource fetches. Does not stop 21235 /// scripts. 21236 HRESULT Stop(); 21237 21238 /// Add an event handler for the NewWindowRequested event. 21239 /// NewWindowRequested fires when content inside the WebView requests to open 21240 /// a new window, such as through window.open. The app can pass a target 21241 /// WebView that will be considered the opened window. 21242 /// 21243 /// Scripts resulted in the new window requested can be blocked until the 21244 /// event handler returns if a deferral is not taken on the event args. If a 21245 /// deferral is taken, then scripts are blocked until the deferral is 21246 /// completed. 21247 /// 21248 /// \snippet AppWindow.cpp NewWindowRequested 21249 HRESULT add_NewWindowRequested( 21250 /+[in]+/ ICoreWebView2NewWindowRequestedEventHandler eventHandler, 21251 /+[out]+/ EventRegistrationToken* token); 21252 /// Remove an event handler previously added with add_NewWindowRequested. 21253 HRESULT remove_NewWindowRequested( 21254 in EventRegistrationToken token); 21255 21256 /// Add an event handler for the DocumentTitleChanged event. 21257 /// DocumentTitleChanged fires when the DocumentTitle property of the WebView 21258 /// changes and may fire before or after the NavigationCompleted event. 21259 /// 21260 /// \snippet FileComponent.cpp DocumentTitleChanged 21261 HRESULT add_DocumentTitleChanged( 21262 /+[in]+/ ICoreWebView2DocumentTitleChangedEventHandler eventHandler, 21263 /+[out]+/ EventRegistrationToken* token); 21264 /// Remove an event handler previously added with add_DocumentTitleChanged. 21265 HRESULT remove_DocumentTitleChanged( 21266 in EventRegistrationToken token); 21267 21268 /// The title for the current top level document. 21269 /// If the document has no explicit title or is otherwise empty, 21270 /// a default that may or may not match the URI of the document will be used. 21271 /+[ propget]+/ 21272 HRESULT get_DocumentTitle(/+[out, retval]+/ LPWSTR* title); 21273 21274 /// Add the provided host object to script running in the WebView with the 21275 /// specified name. 21276 /// Host objects are exposed as host object proxies via 21277 /// `window.chrome.webview.hostObjects.<name>`. 21278 /// Host object proxies are promises and will resolve to an object 21279 /// representing the host object. 21280 /// The promise is rejected if the app has not added an object with the name. 21281 /// When JavaScript code access a property or method of the object, a promise 21282 /// is return, which will resolve to the value returned from the host for the 21283 /// property or method, or rejected in case of error such as there is no such 21284 /// property or method on the object or parameters are invalid. 21285 /// For example, when the application code does the following: 21286 /// 21287 /// ``` 21288 /// VARIANT object; 21289 /// object.vt = VT_DISPATCH; 21290 /// object.pdispVal = appObject; 21291 /// webview->AddHostObjectToScript(L"host_object", &host); 21292 /// ``` 21293 /// 21294 /// JavaScript code in the WebView will be able to access appObject as 21295 /// following and then access attributes and methods of appObject: 21296 /// 21297 /// ``` 21298 /// let app_object = await window.chrome.webview.hostObjects.host_object; 21299 /// let attr1 = await app_object.attr1; 21300 /// let result = await app_object.method1(parameters); 21301 /// ``` 21302 /// 21303 /// Note that while simple types, IDispatch and array are supported, generic 21304 /// IUnknown, VT_DECIMAL, or VT_RECORD variant is not supported. 21305 /// Remote JavaScript objects like callback functions are represented as 21306 /// an VT_DISPATCH VARIANT with the object implementing IDispatch. The 21307 /// JavaScript callback method may be invoked using DISPID_VALUE for the 21308 /// DISPID. 21309 /// Nested arrays are supported up to a depth of 3. 21310 /// Arrays of by reference types are not supported. 21311 /// VT_EMPTY and VT_NULL are mapped into JavaScript as null. In JavaScript 21312 /// null and undefined are mapped to VT_EMPTY. 21313 /// 21314 /// Additionally, all host objects are exposed as 21315 /// `window.chrome.webview.hostObjects.sync.<name>`. Here the host 21316 /// objects are exposed as synchronous host object proxies. These are not 21317 /// promises and calls to functions or property access synchronously block 21318 /// running script waiting to communicate cross process for the host code to 21319 /// run. Accordingly this can result in reliability issues and it is 21320 /// recommended that you use the promise based asynchronous 21321 /// `window.chrome.webview.hostObjects.<name>` API described above. 21322 /// 21323 /// Synchronous host object proxies and asynchronous host object proxies 21324 /// can both proxy the same host object. Remote changes made by one proxy 21325 /// will be reflected in any other proxy of that same host object whether 21326 /// the other proxies and synchronous or asynchronous. 21327 /// 21328 /// While JavaScript is blocked on a synchronous call to native code, that 21329 /// native code is unable to call back to JavaScript. Attempts to do so will 21330 /// fail with HRESULT_FROM_WIN32(ERROR_POSSIBLE_DEADLOCK). 21331 /// 21332 /// Host object proxies are JavaScript Proxy objects that intercept all 21333 /// property get, property set, and method invocations. Properties or methods 21334 /// that are a part of the Function or Object prototype are run locally. 21335 /// Additionally any property or method in the array 21336 /// `chrome.webview.hostObjects.options.forceLocalProperties` will also be 21337 /// run locally. This defaults to including optional methods that have 21338 /// meaning in JavaScript like `toJSON` and `Symbol.toPrimitive`. You can add 21339 /// more to this array as required. 21340 /// 21341 /// There's a method `chrome.webview.hostObjects.cleanupSome` that will best 21342 /// effort garbage collect host object proxies. 21343 /// 21344 /// Host object proxies additionally have the following methods which run 21345 /// locally: 21346 /// * applyHostFunction, getHostProperty, setHostProperty: Perform a 21347 /// method invocation, property get, or property set on the host object. 21348 /// You can use these to explicitly force a method or property to run 21349 /// remotely if there is a conflicting local method or property. For 21350 /// instance, `proxy.toString()` will run the local toString method on the 21351 /// proxy object. But ``proxy.applyHostFunction('toString')`` runs 21352 /// `toString` on the host proxied object instead. 21353 /// * getLocalProperty, setLocalProperty: Perform property get, or property 21354 /// set locally. You can use these methods to force getting or setting a 21355 /// property on the host object proxy itself rather than on the host 21356 /// object it represents. For instance, `proxy.unknownProperty` will get the 21357 /// property named `unknownProperty` from the host proxied object. But 21358 /// ``proxy.getLocalProperty('unknownProperty')`` will get the value of the property 21359 /// `unknownProperty` on the proxy object itself. 21360 /// * sync: Asynchronous host object proxies expose a sync method which 21361 /// returns a promise for a synchronous host object proxy for the same 21362 /// host object. For example, 21363 /// `chrome.webview.hostObjects.sample.methodCall()` returns an 21364 /// asynchronous host object proxy. You can use the `sync` method to 21365 /// obtain a synchronous host object proxy instead: 21366 /// `const syncProxy = await chrome.webview.hostObjects.sample.methodCall().sync()` 21367 /// * async: Synchronous host object proxies expose an async method which 21368 /// blocks and returns an asynchronous host object proxy for the same 21369 /// host object. For example, `chrome.webview.hostObjects.sync.sample.methodCall()` returns a 21370 /// synchronous host object proxy. Calling the `async` method on this blocks 21371 /// and then returns an asynchronous host object proxy for the same host object: 21372 /// `const asyncProxy = chrome.webview.hostObjects.sync.sample.methodCall().async()` 21373 /// * then: Asynchronous host object proxies have a then method. This 21374 /// allows them to be awaitable. `then` will return a promise that resolves 21375 /// with a representation of the host object. If the proxy represents a 21376 /// JavaScript literal then a copy of that is returned locally. If 21377 /// the proxy represents a function then a non-awaitable proxy is returned. 21378 /// If the proxy represents a JavaScript object with a mix of literal 21379 /// properties and function properties, then the a copy of the object is 21380 /// returned with some properties as host object proxies. 21381 /// 21382 /// All other property and method invocations (other than the above Remote 21383 /// object proxy methods, forceLocalProperties list, and properties on 21384 /// Function and Object prototypes) are run remotely. Asynchronous host 21385 /// object proxies return a promise representing asynchronous completion of 21386 /// remotely invoking the method, or getting the property. 21387 /// The promise resolves after the remote operations complete and 21388 /// the promises resolve to the resulting value of the operation. 21389 /// Synchronous host object proxies work similarly but block JavaScript 21390 /// execution and wait for the remote operation to complete. 21391 /// 21392 /// Setting a property on an asynchronous host object proxy works slightly 21393 /// differently. The set returns immediately and the return value is the value 21394 /// that will be set. This is a requirement of the JavaScript Proxy object. 21395 /// If you need to asynchronously wait for the property set to complete, use 21396 /// the setHostProperty method which returns a promise as described above. 21397 /// Synchronous object property set property synchronously blocks until the 21398 /// property is set. 21399 /// 21400 /// For example, suppose you have a COM object with the following interface 21401 /// 21402 /// \snippet HostObjectSample.idl AddHostObjectInterface 21403 /// 21404 /// We can add an instance of this interface into our JavaScript with 21405 /// `AddHostObjectToScript`. In this case we name it `sample`: 21406 /// 21407 /// \snippet ScenarioAddHostObject.cpp AddHostObjectToScript 21408 /// 21409 /// Then in the HTML document we can use this COM object via `chrome.webview.hostObjects.sample`: 21410 /// 21411 /// \snippet ScenarioAddHostObject.html HostObjectUsage 21412 /// Exposing host objects to script has security risk. Please follow 21413 /// [best practices](https://docs.microsoft.com/microsoft-edge/webview2/concepts/security). 21414 HRESULT AddHostObjectToScript(in LPCWSTR name, in VARIANT* object); 21415 21416 /// Remove the host object specified by the name so that it is no longer 21417 /// accessible from JavaScript code in the WebView. 21418 /// While new access attempts will be denied, if the object is already 21419 /// obtained by JavaScript code in the WebView, the JavaScript code will 21420 /// continue to have access to that object. 21421 /// Calling this method for a name that is already removed or never added will 21422 /// fail. 21423 HRESULT RemoveHostObjectFromScript(in LPCWSTR name); 21424 21425 /// Opens the DevTools window for the current document in the WebView. 21426 /// Does nothing if called when the DevTools window is already open. 21427 HRESULT OpenDevToolsWindow(); 21428 21429 /// Add an event handler for the ContainsFullScreenElementChanged event. 21430 /// ContainsFullScreenElementChanged fires when the ContainsFullScreenElement 21431 /// property changes. This means that an HTML element inside the WebView is 21432 /// entering fullscreen to the size of the WebView or leaving fullscreen. This 21433 /// event is useful when, for example, a video element requests to go 21434 /// fullscreen. The listener of ContainsFullScreenElementChanged can then 21435 /// resize the WebView in response. 21436 /// 21437 /// \snippet AppWindow.cpp ContainsFullScreenElementChanged 21438 HRESULT add_ContainsFullScreenElementChanged( 21439 /+[in]+/ ICoreWebView2ContainsFullScreenElementChangedEventHandler eventHandler, 21440 /+[out]+/ EventRegistrationToken* token); 21441 /// Remove an event handler previously added with 21442 /// add_ContainsFullScreenElementChanged. 21443 HRESULT remove_ContainsFullScreenElementChanged( 21444 in EventRegistrationToken token); 21445 21446 /// Indicates if the WebView contains a fullscreen HTML element. 21447 /+[ propget]+/ 21448 HRESULT get_ContainsFullScreenElement( 21449 /+[out, retval]+/ BOOL* containsFullScreenElement); 21450 21451 /// Add an event handler for the WebResourceRequested event. 21452 /// WebResourceRequested fires when the WebView is performing a URL request to 21453 /// a matching URL and resource context filter that was added with 21454 /// AddWebResourceRequestedFilter. At least one filter must be added for the 21455 /// event to fire. 21456 /// 21457 /// The web resource requested can be blocked until the event handler returns 21458 /// if a deferral is not taken on the event args. If a deferral is taken, then 21459 /// the web resource requested is blocked until the deferral is completed. 21460 /// 21461 /// \snippet SettingsComponent.cpp WebResourceRequested 21462 HRESULT add_WebResourceRequested( 21463 /+[in]+/ ICoreWebView2WebResourceRequestedEventHandler eventHandler, 21464 /+[out]+/ EventRegistrationToken* token); 21465 /// Remove an event handler previously added with add_WebResourceRequested. 21466 HRESULT remove_WebResourceRequested( 21467 in EventRegistrationToken token); 21468 21469 /// Adds a URI and resource context filter to the WebResourceRequested event. 21470 /// The URI parameter can be a wildcard string ('*': zero or more, '?': 21471 /// exactly one). nullptr is equivalent to L"". 21472 /// See COREWEBVIEW2_WEB_RESOURCE_CONTEXT enum for description of resource 21473 /// context filters. 21474 HRESULT AddWebResourceRequestedFilter( 21475 in LPCWSTR uri, 21476 in COREWEBVIEW2_WEB_RESOURCE_CONTEXT resourceContext); 21477 /// Removes a matching WebResource filter that was previously added for the 21478 /// WebResourceRequested event. If the same filter was added multiple times, 21479 /// then it will need to be removed as many times as it was added for the 21480 /// removal to be effective. Returns E_INVALIDARG for a filter that was never 21481 /// added. 21482 HRESULT RemoveWebResourceRequestedFilter( 21483 in LPCWSTR uri, 21484 in COREWEBVIEW2_WEB_RESOURCE_CONTEXT resourceContext); 21485 21486 /// Add an event handler for the WindowCloseRequested event. 21487 /// WindowCloseRequested fires when content inside the WebView requested to 21488 /// close the window, such as after window.close is called. The app should 21489 /// close the WebView and related app window if that makes sense to the app. 21490 /// 21491 /// \snippet AppWindow.cpp WindowCloseRequested 21492 HRESULT add_WindowCloseRequested( 21493 /+[in]+/ ICoreWebView2WindowCloseRequestedEventHandler eventHandler, 21494 /+[out]+/ EventRegistrationToken* token); 21495 /// Remove an event handler previously added with add_WindowCloseRequested. 21496 HRESULT remove_WindowCloseRequested( 21497 in EventRegistrationToken token); 21498 } 21499 21500 /// This interface is the owner of the CoreWebView2 object, and provides support 21501 /// for resizing, showing and hiding, focusing, and other functionality related 21502 /// to windowing and composition. The CoreWebView2Controller owns the CoreWebView2, 21503 /// and if all references to the CoreWebView2Controller go away, the WebView will 21504 /// be closed. 21505 const GUID IID_ICoreWebView2Controller = ICoreWebView2Controller.iid; 21506 21507 interface ICoreWebView2Controller : IUnknown 21508 { 21509 static const GUID iid = { 0x4d00c0d1,0x9434,0x4eb6,[ 0x80,0x78,0x86,0x97,0xa5,0x60,0x33,0x4f ] }; 21510 extern(Windows): 21511 /// The IsVisible property determines whether to show or hide the WebView. 21512 /// If IsVisible is set to false, the WebView will be transparent and will 21513 /// not be rendered. However, this will not affect the window containing 21514 /// the WebView (the HWND parameter that was passed to CreateCoreWebView2Controller). 21515 /// If you want that window to disappear too, call ShowWindow on it directly 21516 /// in addition to modifying the IsVisible property. 21517 /// WebView as a child window won't get window messages when the top window 21518 /// is minimized or restored. For performance reason, developer should set 21519 /// IsVisible property of the WebView to false when the app window is 21520 /// minimized and back to true when app window is restored. App window can do 21521 /// this by handling SC_MINIMIZE and SC_RESTORE command upon receiving 21522 /// WM_SYSCOMMAND message. 21523 /// 21524 /// \snippet ViewComponent.cpp ToggleIsVisible 21525 /+[ propget]+/ 21526 HRESULT get_IsVisible(/+[out, retval]+/ BOOL* isVisible); 21527 /// Set the IsVisible property. 21528 /// 21529 /// \snippet ViewComponent.cpp ToggleIsVisibleOnMinimize 21530 /+[ propput]+/ 21531 HRESULT put_IsVisible(in BOOL isVisible); 21532 21533 /// The WebView bounds. 21534 /// Bounds are relative to the parent HWND. The app has two ways it can 21535 /// position a WebView: 21536 /// 1. Create a child HWND that is the WebView parent HWND. Position this 21537 /// window where the WebView should be. In this case, use (0, 0) for the 21538 /// WebView's Bound's top left corner (the offset). 21539 /// 2. Use the app's top most window as the WebView parent HWND. Set the 21540 /// WebView's Bound's top left corner so that the WebView is positioned 21541 /// correctly in the app. 21542 /// The Bound's values are in the host's coordinate space. 21543 /+[ propget]+/ 21544 HRESULT get_Bounds(/+[out, retval]+/ RECT* bounds); 21545 /// Set the Bounds property. 21546 /// 21547 /// \snippet ViewComponent.cpp ResizeWebView 21548 /+[ propput]+/ 21549 HRESULT put_Bounds(in RECT bounds); 21550 21551 /// The zoom factor for the WebView. 21552 /// Note that changing zoom factor could cause `window.innerWidth/innerHeight` 21553 /// and page layout to change. 21554 /// A zoom factor that is applied by the host by calling ZoomFactor 21555 /// becomes the new default zoom for the WebView. This zoom factor applies 21556 /// across navigations and is the zoom factor WebView is returned to when the 21557 /// user presses ctrl+0. When the zoom factor is changed by the user 21558 /// (resulting in the app receiving ZoomFactorChanged), that zoom applies 21559 /// only for the current page. Any user applied zoom is only for the current 21560 /// page and is reset on a navigation. 21561 /// Specifying a zoomFactor less than or equal to 0 is not allowed. 21562 /// WebView also has an internal supported zoom factor range. When a specified 21563 /// zoom factor is out of that range, it will be normalized to be within the 21564 /// range, and a ZoomFactorChanged event will be fired for the real 21565 /// applied zoom factor. When this range normalization happens, the 21566 /// ZoomFactor property will report the zoom factor specified during the 21567 /// previous modification of the ZoomFactor property until the 21568 /// ZoomFactorChanged event is received after WebView applies the normalized 21569 /// zoom factor. 21570 /+[ propget]+/ 21571 HRESULT get_ZoomFactor(/+[out, retval]+/ double* zoomFactor); 21572 /// Set the ZoomFactor property. 21573 /+[ propput]+/ 21574 HRESULT put_ZoomFactor(in double zoomFactor); 21575 21576 /// Add an event handler for the ZoomFactorChanged event. 21577 /// ZoomFactorChanged fires when the ZoomFactor property of the WebView changes. 21578 /// The event could fire because the caller modified the ZoomFactor property, 21579 /// or due to the user manually modifying the zoom. When it is modified by the 21580 /// caller via the ZoomFactor property, the internal zoom factor is updated 21581 /// immediately and there will be no ZoomFactorChanged event. 21582 /// WebView associates the last used zoom factor for each site. Therefore, it 21583 /// is possible for the zoom factor to change when navigating to a different 21584 /// page. When the zoom factor changes due to this, the ZoomFactorChanged 21585 /// event fires right after the ContentLoading event. 21586 /// 21587 /// \snippet ViewComponent.cpp ZoomFactorChanged 21588 HRESULT add_ZoomFactorChanged( 21589 /+[in]+/ ICoreWebView2ZoomFactorChangedEventHandler eventHandler, 21590 /+[out]+/ EventRegistrationToken* token); 21591 /// Remove an event handler previously added with add_ZoomFactorChanged. 21592 HRESULT remove_ZoomFactorChanged( 21593 in EventRegistrationToken token); 21594 21595 /// Update Bounds and ZoomFactor properties at the same time. This operation 21596 /// is atomic from the host's perspective. After returning from this function, 21597 /// the Bounds and ZoomFactor properties will have both been updated if the 21598 /// function is successful, or neither will be updated if the function fails. 21599 /// If Bounds and ZoomFactor are both updated by the same scale (i.e. Bounds 21600 /// and ZoomFactor are both doubled), then the page will not see a change in 21601 /// window.innerWidth/innerHeight and the WebView will render the content at 21602 /// the new size and zoom without intermediate renderings. 21603 /// This function can also be used to update just one of ZoomFactor or Bounds 21604 /// by passing in the new value for one and the current value for the other. 21605 /// 21606 /// \snippet ViewComponent.cpp SetBoundsAndZoomFactor 21607 HRESULT SetBoundsAndZoomFactor(in RECT bounds, in double zoomFactor); 21608 21609 /// Move focus into WebView. WebView will get focus and focus will be set to 21610 /// correspondent element in the page hosted in the WebView. 21611 /// For Programmatic reason, focus is set to previously focused element or 21612 /// the default element if there is no previously focused element. 21613 /// For Next reason, focus is set to the first element. 21614 /// For Previous reason, focus is set to the last element. 21615 /// WebView can also got focus through user interaction like clicking into 21616 /// WebView or Tab into it. 21617 /// For tabbing, the app can call MoveFocus with Next or Previous to align 21618 /// with tab and shift+tab respectively when it decides the WebView is the 21619 /// next tabbable element. Or, the app can call IsDialogMessage as part of 21620 /// its message loop to allow the platform to auto handle tabbing. The 21621 /// platform will rotate through all windows with WS_TABSTOP. When the 21622 /// WebView gets focus from IsDialogMessage, it will internally put the focus 21623 /// on the first or last element for tab and shift+tab respectively. 21624 /// 21625 /// \snippet App.cpp MoveFocus0 21626 /// 21627 /// \snippet ControlComponent.cpp MoveFocus1 21628 /// 21629 /// \snippet ControlComponent.cpp MoveFocus2 21630 HRESULT MoveFocus(in COREWEBVIEW2_MOVE_FOCUS_REASON reason); 21631 21632 /// Add an event handler for the MoveFocusRequested event. 21633 /// MoveFocusRequested fires when user tries to tab out of the WebView. 21634 /// The WebView's focus has not changed when this event is fired. 21635 /// 21636 /// \snippet ControlComponent.cpp MoveFocusRequested 21637 HRESULT add_MoveFocusRequested( 21638 /+[in]+/ ICoreWebView2MoveFocusRequestedEventHandler eventHandler, 21639 /+[out]+/ EventRegistrationToken* token); 21640 /// Remove an event handler previously added with add_MoveFocusRequested. 21641 HRESULT remove_MoveFocusRequested( 21642 in EventRegistrationToken token); 21643 21644 /// Add an event handler for the GotFocus event. 21645 /// GotFocus fires when WebView got focus. 21646 HRESULT add_GotFocus( 21647 /+[in]+/ ICoreWebView2FocusChangedEventHandler eventHandler, 21648 /+[out]+/ EventRegistrationToken* token); 21649 /// Remove an event handler previously added with add_GotFocus. 21650 HRESULT remove_GotFocus( 21651 in EventRegistrationToken token); 21652 21653 /// Add an event handler for the LostFocus event. 21654 /// LostFocus fires when WebView lost focus. 21655 /// In the case where MoveFocusRequested event is fired, the focus is still 21656 /// on WebView when MoveFocusRequested event fires. LostFocus only fires 21657 /// afterwards when app's code or default action of MoveFocusRequested event 21658 /// set focus away from WebView. 21659 HRESULT add_LostFocus( 21660 /+[in]+/ ICoreWebView2FocusChangedEventHandler eventHandler, 21661 /+[out]+/ EventRegistrationToken* token); 21662 /// Remove an event handler previously added with add_LostFocus. 21663 HRESULT remove_LostFocus( 21664 in EventRegistrationToken token); 21665 21666 /// Add an event handler for the AcceleratorKeyPressed event. 21667 /// AcceleratorKeyPressed fires when an accelerator key or key combo is 21668 /// pressed or released while the WebView is focused. A key is considered an 21669 /// accelerator if either: 21670 /// 1. Ctrl or Alt is currently being held, or 21671 /// 2. the pressed key does not map to a character. 21672 /// A few specific keys are never considered accelerators, such as Shift. 21673 /// The Escape key is always considered an accelerator. 21674 /// 21675 /// Autorepeated key events caused by holding the key down will also fire this 21676 /// event. You can filter these out by checking the event args' 21677 /// KeyEventLParam or PhysicalKeyStatus. 21678 /// 21679 /// In windowed mode, this event handler is called synchronously. Until you 21680 /// call Handled() on the event args or the event handler returns, the browser 21681 /// process will be blocked and outgoing cross-process COM calls will fail 21682 /// with RPC_E_CANTCALLOUT_ININPUTSYNCCALL. All CoreWebView2 API methods will 21683 /// work, however. 21684 /// 21685 /// In windowless mode, the event handler is called asynchronously. Further 21686 /// input will not reach the browser until the event handler returns or 21687 /// Handled() is called, but the browser process itself will not be blocked, 21688 /// and outgoing COM calls will work normally. 21689 /// 21690 /// It is recommended to call Handled(TRUE) as early as you can know that you want 21691 /// to handle the accelerator key. 21692 /// 21693 /// \snippet ControlComponent.cpp AcceleratorKeyPressed 21694 HRESULT add_AcceleratorKeyPressed( 21695 /+[in]+/ ICoreWebView2AcceleratorKeyPressedEventHandler eventHandler, 21696 /+[out]+/ EventRegistrationToken* token); 21697 /// Remove an event handler previously added with add_AcceleratorKeyPressed. 21698 HRESULT remove_AcceleratorKeyPressed( 21699 in EventRegistrationToken token); 21700 21701 /// The parent window provided by the app that this WebView is using to 21702 /// render content. This API initially returns the window passed into 21703 /// CreateCoreWebView2Controller. 21704 /+[ propget]+/ 21705 HRESULT get_ParentWindow(/+[out, retval]+/ HWND* parentWindow); 21706 21707 /// Set the parent window for the WebView. This will cause the WebView to 21708 /// reparent its window to the newly provided window. 21709 /+[ propput]+/ 21710 HRESULT put_ParentWindow(in HWND parentWindow); 21711 21712 /// This is a notification separate from Bounds that tells WebView its 21713 /// parent (or any ancestor) HWND moved. This is needed for accessibility and 21714 /// certain dialogs in WebView to work correctly. 21715 /// \snippet ViewComponent.cpp NotifyParentWindowPositionChanged 21716 HRESULT NotifyParentWindowPositionChanged(); 21717 21718 /// Closes the WebView and cleans up the underlying browser instance. 21719 /// Cleaning up the browser instance will release the resources powering the WebView. 21720 /// The browser instance will be shut down if there are no other WebViews using it. 21721 /// 21722 /// After calling Close, all method calls will fail and event handlers 21723 /// will stop firing. Specifically, the WebView will release its references 21724 /// to its event handlers when Close is called. 21725 /// 21726 /// Close is implicitly called when the CoreWebView2Controller loses its final 21727 /// reference and is destructed. But it is best practice to explicitly call 21728 /// Close to avoid any accidental cycle of references between the WebView 21729 /// and the app code. Specifically, if you capture a reference to the WebView 21730 /// in an event handler you will create a reference cycle between the WebView 21731 /// and the event handler. Calling Close will break this cycle by releasing 21732 /// all event handlers. But to avoid this situation it is best practice both 21733 /// to explicitly call Close on the WebView and to not capture a reference to 21734 /// the WebView to ensure the WebView can be cleaned up correctly. 21735 /// 21736 /// \snippet AppWindow.cpp Close 21737 HRESULT Close(); 21738 21739 /// Gets the CoreWebView2 associated with this CoreWebView2Controller. 21740 /+[ propget]+/ 21741 HRESULT get_CoreWebView2(/+[out, retval]+/ ICoreWebView2 * coreWebView2); 21742 } 21743 21744 /// This interface is used to complete deferrals on event args that 21745 /// support getting deferrals via their GetDeferral method. 21746 const GUID IID_ICoreWebView2Deferral = ICoreWebView2Deferral.iid; 21747 21748 interface ICoreWebView2Deferral : IUnknown 21749 { 21750 static const GUID iid = { 0xc10e7f7b,0xb585,0x46f0,[ 0xa6,0x23,0x8b,0xef,0xbf,0x3e,0x4e,0xe0 ] }; 21751 extern(Windows): 21752 /// Completes the associated deferred event. Complete should only be 21753 /// called once for each deferral taken. 21754 HRESULT Complete(); 21755 } 21756 21757 /// Defines properties that enable, disable, or modify WebView 21758 /// features. Setting changes made after NavigationStarting event will not 21759 /// apply until the next top level navigation. 21760 const GUID IID_ICoreWebView2Settings = ICoreWebView2Settings.iid; 21761 21762 interface ICoreWebView2Settings : IUnknown 21763 { 21764 static const GUID iid = { 0xe562e4f0,0xd7fa,0x43ac,[ 0x8d,0x71,0xc0,0x51,0x50,0x49,0x9f,0x00 ] }; 21765 extern(Windows): 21766 /// Controls if JavaScript execution is enabled in all future 21767 /// navigations in the WebView. This only affects scripts in the document; 21768 /// scripts injected with ExecuteScript will run even if script is disabled. 21769 /// It is true by default. 21770 /// 21771 /// \snippet SettingsComponent.cpp IsScriptEnabled 21772 /+[ propget]+/ 21773 HRESULT get_IsScriptEnabled( 21774 /+[out, retval]+/ BOOL* isScriptEnabled); 21775 /// Set the IsScriptEnabled property. 21776 /+[ propput]+/ 21777 HRESULT put_IsScriptEnabled(in BOOL isScriptEnabled); 21778 21779 /// The IsWebMessageEnabled property is used when loading a new 21780 /// HTML document. If set to true, communication from the host to the 21781 /// WebView's top level HTML document is allowed via PostWebMessageAsJson, 21782 /// PostWebMessageAsString, and window.chrome.webview's message event 21783 /// (see PostWebMessageAsJson documentation for details). 21784 /// Communication from the WebView's top level HTML document to the host is 21785 /// allowed via window.chrome.webview's postMessage function and 21786 /// add_WebMessageReceived method (see add_WebMessageReceived documentation 21787 /// for details). 21788 /// If set to false, then communication is disallowed. 21789 /// PostWebMessageAsJson and PostWebMessageAsString will 21790 /// fail with E_ACCESSDENIED and window.chrome.webview.postMessage will fail 21791 /// by throwing an instance of an Error object. 21792 /// It is true by default. 21793 /// 21794 /// \snippet ScenarioWebMessage.cpp IsWebMessageEnabled 21795 /+[ propget]+/ 21796 HRESULT get_IsWebMessageEnabled( 21797 /+[out, retval]+/ BOOL* isWebMessageEnabled); 21798 /// Set the IsWebMessageEnabled property. 21799 /+[ propput]+/ 21800 HRESULT put_IsWebMessageEnabled(in BOOL isWebMessageEnabled); 21801 21802 /// AreDefaultScriptDialogsEnabled is used when loading a new HTML document. 21803 /// If set to false, then WebView won't render the default JavaScript dialog 21804 /// box (Specifically those shown by the JavaScript alert, confirm, prompt 21805 /// functions and beforeunload event). Instead, if an event handler is set via 21806 /// add_ScriptDialogOpening, WebView will send an event that will contain all 21807 /// of the information for the dialog and allow the host app to show its own 21808 /// custom UI. It is true by default. 21809 /+[ propget]+/ 21810 HRESULT get_AreDefaultScriptDialogsEnabled( 21811 /+[out, retval]+/ BOOL* areDefaultScriptDialogsEnabled); 21812 /// Set the AreDefaultScriptDialogsEnabled property. 21813 /+[ propput]+/ 21814 HRESULT put_AreDefaultScriptDialogsEnabled( 21815 in BOOL areDefaultScriptDialogsEnabled); 21816 21817 /// IsStatusBarEnabled controls whether the status bar will be displayed. The 21818 /// status bar is usually displayed in the lower left of the WebView and shows 21819 /// things such as the URI of a link when the user hovers over it and other 21820 /// information. It is true by default. 21821 /+[ propget]+/ 21822 HRESULT get_IsStatusBarEnabled(/+[out, retval]+/ BOOL* isStatusBarEnabled); 21823 /// Set the IsStatusBarEnabled property. 21824 /+[ propput]+/ 21825 HRESULT put_IsStatusBarEnabled(in BOOL isStatusBarEnabled); 21826 21827 /// AreDevToolsEnabled controls whether the user is able to use the context 21828 /// menu or keyboard shortcuts to open the DevTools window. 21829 /// It is true by default. 21830 /+[ propget]+/ 21831 HRESULT get_AreDevToolsEnabled(/+[out, retval]+/ BOOL* areDevToolsEnabled); 21832 /// Set the AreDevToolsEnabled property. 21833 /+[ propput]+/ 21834 HRESULT put_AreDevToolsEnabled(in BOOL areDevToolsEnabled); 21835 21836 /// The AreDefaultContextMenusEnabled property is used to prevent 21837 /// default context menus from being shown to user in WebView. 21838 /// It is true by default. 21839 /// 21840 /// \snippet SettingsComponent.cpp DisableContextMenu 21841 /+[ propget]+/ 21842 HRESULT get_AreDefaultContextMenusEnabled(/+[out, retval]+/ BOOL* enabled); 21843 /// Set the AreDefaultContextMenusEnabled property. 21844 /+[ propput]+/ 21845 HRESULT put_AreDefaultContextMenusEnabled(in BOOL enabled); 21846 21847 /// The AreHostObjectsAllowed property is used to control whether 21848 /// host objects are accessible from the page in WebView. 21849 /// It is true by default. 21850 /// 21851 /// \snippet SettingsComponent.cpp HostObjectsAccess 21852 /+[ propget]+/ 21853 HRESULT get_AreHostObjectsAllowed(/+[out, retval]+/ BOOL* allowed); 21854 /// Set the AreHostObjectsAllowed property. 21855 /+[ propput]+/ 21856 HRESULT put_AreHostObjectsAllowed(in BOOL allowed); 21857 21858 /// The IsZoomControlEnabled property is used to prevent the user from 21859 /// impacting the zoom of the WebView. It is true by default. 21860 /// When disabled, user will not be able to zoom using ctrl+/- or 21861 /// ctrl+mouse wheel, but the zoom can be set via ZoomFactor API. 21862 /// 21863 /// \snippet SettingsComponent.cpp DisableZoomControl 21864 /+[ propget]+/ 21865 HRESULT get_IsZoomControlEnabled(/+[out, retval]+/ BOOL* enabled); 21866 /// Set the IsZoomControlEnabled property. 21867 /+[ propput]+/ 21868 HRESULT put_IsZoomControlEnabled(in BOOL enabled); 21869 21870 /// The IsBuiltInErrorPageEnabled property is used to disable built in error 21871 /// page for navigation failure and render process failure. It is true by 21872 /// default. 21873 /// When disabled, blank page will be shown when related error happens. 21874 /// 21875 /// \snippet SettingsComponent.cpp BuiltInErrorPageEnabled 21876 /+[ propget]+/ 21877 HRESULT get_IsBuiltInErrorPageEnabled(/+[out, retval]+/ BOOL* enabled); 21878 /// Set the IsBuiltInErrorPageEnabled property. 21879 /+[ propput]+/ 21880 HRESULT put_IsBuiltInErrorPageEnabled(in BOOL enabled); 21881 } 21882 21883 /// Event args for the ProcessFailed event. 21884 const GUID IID_ICoreWebView2ProcessFailedEventArgs = ICoreWebView2ProcessFailedEventArgs.iid; 21885 21886 interface ICoreWebView2ProcessFailedEventArgs : IUnknown 21887 { 21888 static const GUID iid = { 0x8155a9a4,0x1474,0x4a86,[ 0x8c,0xae,0x15,0x1b,0x0f,0xa6,0xb8,0xca ] }; 21889 extern(Windows): 21890 /// The kind of process failure that has occurred. 21891 /+[ propget]+/ 21892 HRESULT get_ProcessFailedKind( 21893 /+[out, retval]+/ COREWEBVIEW2_PROCESS_FAILED_KIND* processFailedKind); 21894 } 21895 21896 /// The caller implements this interface to receive ProcessFailed events. 21897 const GUID IID_ICoreWebView2ProcessFailedEventHandler = ICoreWebView2ProcessFailedEventHandler.iid; 21898 21899 interface ICoreWebView2ProcessFailedEventHandler : IUnknown 21900 { 21901 static const GUID iid = { 0x79e0aea4,0x990b,0x42d9,[ 0xaa,0x1d,0x0f,0xcc,0x2e,0x5b,0xc7,0xf1 ] }; 21902 extern(Windows): 21903 /// Called to provide the implementer with the event args for the 21904 /// corresponding event. 21905 HRESULT Invoke( 21906 /+[in]+/ ICoreWebView2 sender, 21907 /+[in]+/ ICoreWebView2ProcessFailedEventArgs args); 21908 } 21909 21910 /// The caller implements this interface to receive ZoomFactorChanged 21911 /// events. Use the ICoreWebView2Controller.ZoomFactor property to get the 21912 /// modified zoom factor. 21913 const GUID IID_ICoreWebView2ZoomFactorChangedEventHandler = ICoreWebView2ZoomFactorChangedEventHandler.iid; 21914 21915 interface ICoreWebView2ZoomFactorChangedEventHandler : IUnknown 21916 { 21917 static const GUID iid = { 0xb52d71d6,0xc4df,0x4543,[ 0xa9,0x0c,0x64,0xa3,0xe6,0x0f,0x38,0xcb ] }; 21918 extern(Windows): 21919 /// Called to provide the implementer with the event args for the 21920 /// corresponding event. There are no event args and the args 21921 /// parameter will be null. 21922 HRESULT Invoke(/+[in]+/ ICoreWebView2Controller sender, /+[in]+/ IUnknown args); 21923 } 21924 21925 /// Iterator for a collection of HTTP headers. See ICoreWebView2HttpRequestHeaders 21926 /// and ICoreWebView2HttpResponseHeaders. 21927 /// 21928 /// \snippet ScenarioWebViewEventMonitor.cpp HttpRequestHeaderIterator 21929 const GUID IID_ICoreWebView2HttpHeadersCollectionIterator = ICoreWebView2HttpHeadersCollectionIterator.iid; 21930 21931 interface ICoreWebView2HttpHeadersCollectionIterator : IUnknown 21932 { 21933 static const GUID iid = { 0x0702fc30,0xf43b,0x47bb,[ 0xab,0x52,0xa4,0x2c,0xb5,0x52,0xad,0x9f ] }; 21934 extern(Windows): 21935 /// Get the name and value of the current HTTP header of the iterator. This 21936 /// method will fail if the last call to MoveNext set hasNext to FALSE. 21937 HRESULT GetCurrentHeader(/+[out]+/ LPWSTR* name, 21938 /+[out]+/ LPWSTR* value); 21939 21940 /// True when the iterator hasn't run out of headers. If the collection over 21941 /// which the iterator is iterating is empty or if the iterator has gone past 21942 /// the end of the collection then this is false. 21943 /+[ propget]+/ 21944 HRESULT get_HasCurrentHeader(/+[out, retval]+/ BOOL* hasCurrent); 21945 21946 /// Move the iterator to the next HTTP header in the collection. The hasNext 21947 /// parameter will be set to FALSE if there are no more HTTP headers. After 21948 /// this occurs the GetCurrentHeader method will fail if called. 21949 HRESULT MoveNext(/+[out, retval]+/ BOOL* hasNext); 21950 } 21951 21952 /// HTTP request headers. Used to inspect the HTTP request on 21953 /// WebResourceRequested event and NavigationStarting event. 21954 /// Note, you can modify the HTTP request headers from a WebResourceRequested event, 21955 /// but not from a NavigationStarting event. 21956 const GUID IID_ICoreWebView2HttpRequestHeaders = ICoreWebView2HttpRequestHeaders.iid; 21957 21958 interface ICoreWebView2HttpRequestHeaders : IUnknown 21959 { 21960 static const GUID iid = { 0xe86cac0e,0x5523,0x465c,[ 0xb5,0x36,0x8f,0xb9,0xfc,0x8c,0x8c,0x60 ] }; 21961 extern(Windows): 21962 /// Gets the header value matching the name. 21963 HRESULT GetHeader(in LPCWSTR name, 21964 /+[out, retval]+/ LPWSTR* value); 21965 /// Gets the header value matching the name via an iterator. 21966 HRESULT GetHeaders(in LPCWSTR name, 21967 /+[out, retval]+/ ICoreWebView2HttpHeadersCollectionIterator * iterator); 21968 /// Checks whether the headers contain an entry matching the header name. 21969 HRESULT Contains(in LPCWSTR name, 21970 /+[out, retval]+/ BOOL* contains); 21971 /// Adds or updates header that matches the name. 21972 HRESULT SetHeader(in LPCWSTR name, in LPCWSTR value); 21973 /// Removes header that matches the name. 21974 HRESULT RemoveHeader(in LPCWSTR name); 21975 /// Gets an iterator over the collection of request headers. 21976 HRESULT GetIterator( 21977 /+[out, retval]+/ ICoreWebView2HttpHeadersCollectionIterator * iterator); 21978 } 21979 21980 /// HTTP response headers. Used to construct a WebResourceResponse for the 21981 /// WebResourceRequested event. 21982 const GUID IID_ICoreWebView2HttpResponseHeaders = ICoreWebView2HttpResponseHeaders.iid; 21983 21984 interface ICoreWebView2HttpResponseHeaders : IUnknown 21985 { 21986 static const GUID iid = { 0x03c5ff5a,0x9b45,0x4a88,[ 0x88,0x1c,0x89,0xa9,0xf3,0x28,0x61,0x9c ] }; 21987 extern(Windows): 21988 /// Appends header line with name and value. 21989 HRESULT AppendHeader(in LPCWSTR name, in LPCWSTR value); 21990 /// Checks whether the headers contain entries matching the header name. 21991 HRESULT Contains(in LPCWSTR name, 21992 /+[out, retval]+/ BOOL* contains); 21993 /// Gets the first header value in the collection matching the name. 21994 HRESULT GetHeader(in LPCWSTR name, 21995 /+[out, retval]+/ LPWSTR* value); 21996 /// Gets the header values matching the name. 21997 HRESULT GetHeaders(in LPCWSTR name, 21998 /+[out, retval]+/ ICoreWebView2HttpHeadersCollectionIterator * iterator); 21999 /// Gets an iterator over the collection of entire response headers. 22000 HRESULT GetIterator( 22001 /+[out, retval]+/ ICoreWebView2HttpHeadersCollectionIterator * iterator); 22002 } 22003 22004 /// An HTTP request used with the WebResourceRequested event. 22005 const GUID IID_ICoreWebView2WebResourceRequest = ICoreWebView2WebResourceRequest.iid; 22006 22007 interface ICoreWebView2WebResourceRequest : IUnknown 22008 { 22009 static const GUID iid = { 0x97055cd4,0x512c,0x4264,[ 0x8b,0x5f,0xe3,0xf4,0x46,0xce,0xa6,0xa5 ] }; 22010 extern(Windows): 22011 /// The request URI. 22012 /+[ propget]+/ 22013 HRESULT get_Uri(/+[out, retval]+/ LPWSTR* uri); 22014 /// Set the Uri property. 22015 /+[ propput]+/ 22016 HRESULT put_Uri(in LPCWSTR uri); 22017 22018 /// The HTTP request method. 22019 /+[ propget]+/ 22020 HRESULT get_Method(/+[out, retval]+/ LPWSTR* method); 22021 /// Set the Method property. 22022 /+[ propput]+/ 22023 HRESULT put_Method(in LPCWSTR method); 22024 22025 /// The HTTP request message body as stream. POST data would be here. 22026 /// If a stream is set, which will override the message body, the stream must 22027 /// have all the content data available by the time this 22028 /// response's WebResourceRequested event deferral is completed. Stream 22029 /// should be agile or be created from a background STA to prevent performance 22030 /// impact to the UI thread. Null means no content data. IStream semantics 22031 /// apply (return S_OK to Read calls until all data is exhausted). 22032 /+[ propget]+/ 22033 HRESULT get_Content(/+[out, retval]+/ IStream** content); 22034 /// Set the Content property. 22035 /+[ propput]+/ 22036 HRESULT put_Content(in IStream* content); 22037 22038 /// The mutable HTTP request headers 22039 /+[ propget]+/ 22040 HRESULT get_Headers(/+[out, retval]+/ ICoreWebView2HttpRequestHeaders * headers); 22041 } 22042 22043 /// An HTTP response used with the WebResourceRequested event. 22044 const GUID IID_ICoreWebView2WebResourceResponse = ICoreWebView2WebResourceResponse.iid; 22045 22046 interface ICoreWebView2WebResourceResponse : IUnknown 22047 { 22048 static const GUID iid = { 0xaafcc94f,0xfa27,0x48fd,[ 0x97,0xdf,0x83,0x0e,0xf7,0x5a,0xae,0xc9 ] }; 22049 extern(Windows): 22050 /// HTTP response content as stream. Stream must have all the 22051 /// content data available by the time this response's WebResourceRequested 22052 /// event deferral is completed. Stream should be agile or be created from 22053 /// a background thread to prevent performance impact to the UI thread. 22054 /// Null means no content data. IStream semantics 22055 /// apply (return S_OK to Read calls until all data is exhausted). 22056 /+[ propget]+/ 22057 HRESULT get_Content(/+[out, retval]+/ IStream** content); 22058 /// Set the Content property. 22059 /+[ propput]+/ 22060 HRESULT put_Content(in IStream* content); 22061 22062 /// Overridden HTTP response headers. 22063 /+[ propget]+/ 22064 HRESULT get_Headers(/+[out, retval]+/ ICoreWebView2HttpResponseHeaders * headers); 22065 22066 /// The HTTP response status code. 22067 /+[ propget]+/ 22068 HRESULT get_StatusCode(/+[out, retval]+/ int* statusCode); 22069 /// Set the StatusCode property. 22070 /+[ propput]+/ 22071 HRESULT put_StatusCode(in int statusCode); 22072 22073 /// The HTTP response reason phrase. 22074 /+[ propget]+/ 22075 HRESULT get_ReasonPhrase(/+[out, retval]+/ LPWSTR* reasonPhrase); 22076 /// Set the ReasonPhrase property. 22077 /+[ propput]+/ 22078 HRESULT put_ReasonPhrase(in LPCWSTR reasonPhrase); 22079 } 22080 22081 /// Event args for the NavigationStarting event. 22082 const GUID IID_ICoreWebView2NavigationStartingEventArgs = ICoreWebView2NavigationStartingEventArgs.iid; 22083 22084 interface ICoreWebView2NavigationStartingEventArgs : IUnknown 22085 { 22086 static const GUID iid = { 0x5b495469,0xe119,0x438a,[ 0x9b,0x18,0x76,0x04,0xf2,0x5f,0x2e,0x49 ] }; 22087 extern(Windows): 22088 /// The uri of the requested navigation. 22089 /+[ propget]+/ 22090 HRESULT get_Uri(/+[out, retval]+/ LPWSTR* uri); 22091 22092 /// True when the navigation was initiated through a user gesture as opposed 22093 /// to programmatic navigation. 22094 /+[ propget]+/ 22095 HRESULT get_IsUserInitiated(/+[out, retval]+/ BOOL* isUserInitiated); 22096 22097 /// True when the navigation is redirected. 22098 /+[ propget]+/ 22099 HRESULT get_IsRedirected(/+[out, retval]+/ BOOL* isRedirected); 22100 22101 /// The HTTP request headers for the navigation. 22102 /// Note, you cannot modify the HTTP request headers in a NavigationStarting event. 22103 /+[ propget]+/ 22104 HRESULT get_RequestHeaders(/+[out, retval]+/ ICoreWebView2HttpRequestHeaders * requestHeaders); 22105 22106 /// The host may set this flag to cancel the navigation. 22107 /// If set, it will be as if the navigation never happened and the current 22108 /// page's content will be intact. For performance reasons, GET HTTP requests 22109 /// may happen, while the host is responding. This means cookies can be set 22110 /// and used part of a request for the navigation. 22111 /// Cancellation for navigation to about:blank or frame navigation to srcdoc 22112 /// is not supported. Such attempts will be ignored. 22113 /+[ propget]+/ 22114 HRESULT get_Cancel(/+[out, retval]+/ BOOL* cancel); 22115 /// Set the Cancel property. 22116 /+[ propput]+/ 22117 HRESULT put_Cancel(in BOOL cancel); 22118 22119 /// The ID of the navigation. 22120 /+[ propget]+/ 22121 HRESULT get_NavigationId(/+[out, retval]+/ UINT64* navigationId); 22122 } 22123 22124 /// The caller implements this interface to receive the NavigationStarting 22125 /// event. 22126 const GUID IID_ICoreWebView2NavigationStartingEventHandler = ICoreWebView2NavigationStartingEventHandler.iid; 22127 22128 interface ICoreWebView2NavigationStartingEventHandler : IUnknown 22129 { 22130 static const GUID iid = { 0x9adbe429,0xf36d,0x432b,[ 0x9d,0xdc,0xf8,0x88,0x1f,0xbd,0x76,0xe3 ] }; 22131 extern(Windows): 22132 /// Called to provide the implementer with the event args for the 22133 /// corresponding event. 22134 HRESULT Invoke( 22135 /+[in]+/ ICoreWebView2 sender, 22136 /+[in]+/ ICoreWebView2NavigationStartingEventArgs args); 22137 } 22138 22139 /// Event args for the ContentLoading event. 22140 const GUID IID_ICoreWebView2ContentLoadingEventArgs = ICoreWebView2ContentLoadingEventArgs.iid; 22141 22142 interface ICoreWebView2ContentLoadingEventArgs : IUnknown 22143 { 22144 static const GUID iid = { 0x0c8a1275,0x9b6b,0x4901,[ 0x87,0xad,0x70,0xdf,0x25,0xba,0xfa,0x6e ] }; 22145 extern(Windows): 22146 /// True if the loaded content is an error page. 22147 /+[ propget]+/ 22148 HRESULT get_IsErrorPage(/+[out, retval]+/ BOOL* isErrorPage); 22149 22150 /// The ID of the navigation. 22151 /+[ propget]+/ 22152 HRESULT get_NavigationId(/+[out, retval]+/ UINT64* navigationId); 22153 } 22154 22155 /// The caller implements this interface to receive the ContentLoading event. 22156 const GUID IID_ICoreWebView2ContentLoadingEventHandler = ICoreWebView2ContentLoadingEventHandler.iid; 22157 22158 interface ICoreWebView2ContentLoadingEventHandler : IUnknown 22159 { 22160 static const GUID iid = { 0x364471e7,0xf2be,0x4910,[ 0xbd,0xba,0xd7,0x20,0x77,0xd5,0x1c,0x4b ] }; 22161 extern(Windows): 22162 /// Called to provide the implementer with the event args for the 22163 /// corresponding event. 22164 HRESULT Invoke(/+[in]+/ ICoreWebView2 sender, /+[in]+/ ICoreWebView2ContentLoadingEventArgs args); 22165 } 22166 22167 /// Event args for the SourceChanged event. 22168 const GUID IID_ICoreWebView2SourceChangedEventArgs = ICoreWebView2SourceChangedEventArgs.iid; 22169 22170 interface ICoreWebView2SourceChangedEventArgs : IUnknown 22171 { 22172 static const GUID iid = { 0x31e0e545,0x1dba,0x4266,[ 0x89,0x14,0xf6,0x38,0x48,0xa1,0xf7,0xd7 ] }; 22173 extern(Windows): 22174 /// True if the page being navigated to is a new document. 22175 /+[ propget]+/ 22176 HRESULT get_IsNewDocument(/+[out, retval]+/ BOOL* isNewDocument); 22177 } 22178 22179 /// The caller implements this interface to receive the SourceChanged event. 22180 const GUID IID_ICoreWebView2SourceChangedEventHandler = ICoreWebView2SourceChangedEventHandler.iid; 22181 22182 interface ICoreWebView2SourceChangedEventHandler : IUnknown 22183 { 22184 static const GUID iid = { 0x3c067f9f,0x5388,0x4772,[ 0x8b,0x48,0x79,0xf7,0xef,0x1a,0xb3,0x7c ] }; 22185 extern(Windows): 22186 /// Called to provide the implementer with the event args for the 22187 /// corresponding event. 22188 HRESULT Invoke(/+[in]+/ ICoreWebView2 sender, /+[in]+/ ICoreWebView2SourceChangedEventArgs args); 22189 } 22190 22191 /// The caller implements this interface to receive the HistoryChanged event. 22192 const GUID IID_ICoreWebView2HistoryChangedEventHandler = ICoreWebView2HistoryChangedEventHandler.iid; 22193 22194 interface ICoreWebView2HistoryChangedEventHandler : IUnknown 22195 { 22196 static const GUID iid = { 0xc79a420c,0xefd9,0x4058,[ 0x92,0x95,0x3e,0x8b,0x4b,0xca,0xb6,0x45 ] }; 22197 extern(Windows): 22198 /// There are no event args and the args parameter will be null. 22199 HRESULT Invoke(/+[in]+/ ICoreWebView2 sender, /+[in]+/ IUnknown args); 22200 } 22201 22202 /// Event args for the ScriptDialogOpening event. 22203 const GUID IID_ICoreWebView2ScriptDialogOpeningEventArgs = ICoreWebView2ScriptDialogOpeningEventArgs.iid; 22204 22205 interface ICoreWebView2ScriptDialogOpeningEventArgs : IUnknown 22206 { 22207 static const GUID iid = { 0x7390bb70,0xabe0,0x4843,[ 0x95,0x29,0xf1,0x43,0xb3,0x1b,0x03,0xd6 ] }; 22208 extern(Windows): 22209 /// The URI of the page that requested the dialog box. 22210 /+[ propget]+/ 22211 HRESULT get_Uri(/+[out, retval]+/ LPWSTR* uri); 22212 22213 /// The kind of JavaScript dialog box. Accept, confirm, prompt, or 22214 /// beforeunload. 22215 /+[ propget]+/ 22216 HRESULT get_Kind(/+[out, retval]+/ COREWEBVIEW2_SCRIPT_DIALOG_KIND* kind); 22217 22218 /// The message of the dialog box. From JavaScript this is the first parameter 22219 /// passed to alert, confirm, and prompt and is empty for beforeunload. 22220 /+[ propget]+/ 22221 HRESULT get_Message(/+[out, retval]+/ LPWSTR* message); 22222 22223 /// The host may call this to respond with OK to confirm, prompt, and 22224 /// beforeunload dialogs or not call this method to indicate cancel. From 22225 /// JavaScript, this means that the confirm and beforeunload function returns 22226 /// true if Accept is called. And for the prompt function it returns the value 22227 /// of ResultText if Accept is called and returns false otherwise. 22228 HRESULT Accept(); 22229 22230 /// The second parameter passed to the JavaScript prompt dialog. This is the 22231 /// default value to use for the result of the prompt JavaScript function. 22232 /+[ propget]+/ 22233 HRESULT get_DefaultText(/+[out, retval]+/ LPWSTR* defaultText); 22234 22235 /// The return value from the JavaScript prompt function if Accept is called. 22236 /// This is ignored for dialog kinds other than prompt. If Accept is not 22237 /// called this value is ignored and false is returned from prompt. 22238 /+[ propget]+/ 22239 HRESULT get_ResultText(/+[out, retval]+/ LPWSTR* resultText); 22240 /// Set the ResultText property. 22241 /+[ propput]+/ 22242 HRESULT put_ResultText(in LPCWSTR resultText); 22243 22244 /// GetDeferral can be called to return an ICoreWebView2Deferral object. 22245 /// You can use this to complete the event at a later time. 22246 HRESULT GetDeferral(/+[out, retval]+/ ICoreWebView2Deferral * deferral); 22247 } 22248 22249 /// The caller implements this interface to receive the ScriptDialogOpening 22250 /// event. 22251 const GUID IID_ICoreWebView2ScriptDialogOpeningEventHandler = ICoreWebView2ScriptDialogOpeningEventHandler.iid; 22252 22253 interface ICoreWebView2ScriptDialogOpeningEventHandler : IUnknown 22254 { 22255 static const GUID iid = { 0xef381bf9,0xafa8,0x4e37,[ 0x91,0xc4,0x8a,0xc4,0x85,0x24,0xbd,0xfb ] }; 22256 extern(Windows): 22257 /// Called to provide the implementer with the event args for the 22258 /// corresponding event. 22259 HRESULT Invoke( 22260 /+[in]+/ ICoreWebView2 sender, 22261 /+[in]+/ ICoreWebView2ScriptDialogOpeningEventArgs args); 22262 } 22263 22264 /// Event args for the NavigationCompleted event. 22265 const GUID IID_ICoreWebView2NavigationCompletedEventArgs = ICoreWebView2NavigationCompletedEventArgs.iid; 22266 22267 interface ICoreWebView2NavigationCompletedEventArgs : IUnknown 22268 { 22269 static const GUID iid = { 0x30d68b7d,0x20d9,0x4752,[ 0xa9,0xca,0xec,0x84,0x48,0xfb,0xb5,0xc1 ] }; 22270 extern(Windows): 22271 /// True when the navigation is successful. This 22272 /// is false for a navigation that ended up in an error page (failures due to 22273 /// no network, DNS lookup failure, HTTP server responds with 4xx), but could 22274 /// also be false for additional scenarios such as window.stop() called on 22275 /// navigated page. 22276 /+[ propget]+/ 22277 HRESULT get_IsSuccess(/+[out, retval]+/ BOOL* isSuccess); 22278 22279 /// The error code if the navigation failed. 22280 /+[ propget]+/ 22281 HRESULT get_WebErrorStatus(/+[out, retval]+/ COREWEBVIEW2_WEB_ERROR_STATUS* 22282 webErrorStatus); 22283 22284 /// The ID of the navigation. 22285 /+[ propget]+/ 22286 HRESULT get_NavigationId(/+[out, retval]+/ UINT64* navigationId); 22287 } 22288 22289 /// The caller implements this interface to receive the NavigationCompleted 22290 /// event. 22291 const GUID IID_ICoreWebView2NavigationCompletedEventHandler = ICoreWebView2NavigationCompletedEventHandler.iid; 22292 22293 interface ICoreWebView2NavigationCompletedEventHandler : IUnknown 22294 { 22295 static const GUID iid = { 0xd33a35bf,0x1c49,0x4f98,[ 0x93,0xab,0x00,0x6e,0x05,0x33,0xfe,0x1c ] }; 22296 extern(Windows): 22297 /// Called to provide the implementer with the event args for the 22298 /// corresponding event. 22299 HRESULT Invoke( 22300 /+[in]+/ ICoreWebView2 sender, 22301 /+[in]+/ ICoreWebView2NavigationCompletedEventArgs args); 22302 } 22303 22304 /// Event args for the PermissionRequested event. 22305 const GUID IID_ICoreWebView2PermissionRequestedEventArgs = ICoreWebView2PermissionRequestedEventArgs.iid; 22306 22307 interface ICoreWebView2PermissionRequestedEventArgs : IUnknown 22308 { 22309 static const GUID iid = { 0x973ae2ef,0xff18,0x4894,[ 0x8f,0xb2,0x3c,0x75,0x8f,0x04,0x68,0x10 ] }; 22310 extern(Windows): 22311 /// The origin of the web content that requests the permission. 22312 /+[ propget]+/ 22313 HRESULT get_Uri(/+[out, retval]+/ LPWSTR* uri); 22314 22315 /// The type of the permission that is requested. 22316 /+[ propget]+/ 22317 HRESULT get_PermissionKind(/+[out, retval]+/ COREWEBVIEW2_PERMISSION_KIND* permissionKind); 22318 22319 /// True when the permission request was initiated through a user gesture. 22320 /// Note that being initiated through a user gesture doesn't mean that user 22321 /// intended to access the associated resource. 22322 /+[ propget]+/ 22323 HRESULT get_IsUserInitiated(/+[out, retval]+/ BOOL* isUserInitiated); 22324 22325 /// The status of a permission request, i.e. whether the request is granted. 22326 /// Default value is COREWEBVIEW2_PERMISSION_STATE_DEFAULT. 22327 /+[ propget]+/ 22328 HRESULT get_State(/+[out, retval]+/ COREWEBVIEW2_PERMISSION_STATE* state); 22329 /// Set the State property. 22330 /+[ propput]+/ 22331 HRESULT put_State(in COREWEBVIEW2_PERMISSION_STATE state); 22332 22333 /// GetDeferral can be called to return an ICoreWebView2Deferral object. 22334 /// Developer can use the deferral object to make the permission decision 22335 /// at a later time. 22336 HRESULT GetDeferral(/+[out, retval]+/ ICoreWebView2Deferral * deferral); 22337 } 22338 22339 /// The caller implements this interface to receive the PermissionRequested 22340 /// event. 22341 const GUID IID_ICoreWebView2PermissionRequestedEventHandler = ICoreWebView2PermissionRequestedEventHandler.iid; 22342 22343 interface ICoreWebView2PermissionRequestedEventHandler : IUnknown 22344 { 22345 static const GUID iid = { 0x15e1c6a3,0xc72a,0x4df3,[ 0x91,0xd7,0xd0,0x97,0xfb,0xec,0x6b,0xfd ] }; 22346 extern(Windows): 22347 /// Called to provide the implementer with the event args for the 22348 /// corresponding event. 22349 HRESULT Invoke( 22350 /+[in]+/ ICoreWebView2 sender, 22351 /+[in]+/ ICoreWebView2PermissionRequestedEventArgs args); 22352 } 22353 22354 /// The caller implements this interface to receive the result of the 22355 /// AddScriptToExecuteOnDocumentCreated method. 22356 const GUID IID_ICoreWebView2AddScriptToExecuteOnDocumentCreatedCompletedHandler = ICoreWebView2AddScriptToExecuteOnDocumentCreatedCompletedHandler.iid; 22357 22358 interface ICoreWebView2AddScriptToExecuteOnDocumentCreatedCompletedHandler : IUnknown 22359 { 22360 static const GUID iid = { 0xb99369f3,0x9b11,0x47b5,[ 0xbc,0x6f,0x8e,0x78,0x95,0xfc,0xea,0x17 ] }; 22361 extern(Windows): 22362 /// Called to provide the implementer with the completion status and result 22363 /// of the corresponding asynchronous method call. 22364 HRESULT Invoke(in HRESULT errorCode, in LPCWSTR id); 22365 } 22366 22367 /// The caller implements this interface to receive the result of the 22368 /// ExecuteScript method. 22369 const GUID IID_ICoreWebView2ExecuteScriptCompletedHandler = ICoreWebView2ExecuteScriptCompletedHandler.iid; 22370 22371 interface ICoreWebView2ExecuteScriptCompletedHandler : IUnknown 22372 { 22373 static const GUID iid = { 0x49511172,0xcc67,0x4bca,[ 0x99,0x23,0x13,0x71,0x12,0xf4,0xc4,0xcc ] }; 22374 extern(Windows): 22375 /// Called to provide the implementer with the completion status and result 22376 /// of the corresponding asynchronous method call. 22377 HRESULT Invoke(in HRESULT errorCode, in LPCWSTR resultObjectAsJson); 22378 } 22379 22380 /// Event args for the WebResourceRequested event. 22381 const GUID IID_ICoreWebView2WebResourceRequestedEventArgs = ICoreWebView2WebResourceRequestedEventArgs.iid; 22382 22383 interface ICoreWebView2WebResourceRequestedEventArgs : IUnknown 22384 { 22385 static const GUID iid = { 0x453e667f,0x12c7,0x49d4,[ 0xbe,0x6d,0xdd,0xbe,0x79,0x56,0xf5,0x7a ] }; 22386 extern(Windows): 22387 /// The Web resource request. The request object may be missing some headers 22388 /// that are added by network stack later on. 22389 /+[ propget]+/ 22390 HRESULT get_Request(/+[out, retval]+/ ICoreWebView2WebResourceRequest * request); 22391 22392 /// A placeholder for the web resource response object. If this object is set, the 22393 /// web resource request will be completed with this response. 22394 /+[ propget]+/ 22395 HRESULT get_Response(/+[out, retval]+/ ICoreWebView2WebResourceResponse * response); 22396 /// Set the Response property. An empty Web resource response object can be 22397 /// created with CreateWebResourceResponse and then modified to construct the response. 22398 /+[ propput]+/ 22399 HRESULT put_Response(/+[in]+/ ICoreWebView2WebResourceResponse response); 22400 22401 /// Obtain an ICoreWebView2Deferral object and put the event into a deferred state. 22402 /// You can use the ICoreWebView2Deferral object to complete the request at a 22403 /// later time. 22404 HRESULT GetDeferral(/+[out, retval]+/ ICoreWebView2Deferral * deferral); 22405 22406 /// The web resource request context. 22407 /+[ propget]+/ 22408 HRESULT get_ResourceContext(/+[out, retval]+/ COREWEBVIEW2_WEB_RESOURCE_CONTEXT* context); 22409 } 22410 22411 /// Fires when a URL request (through network, file etc.) is made in the webview 22412 /// for a Web resource matching resource context filter and URL specified in 22413 /// AddWebResourceRequestedFilter. 22414 /// The host can view and modify the request or provide a response in a similar 22415 /// pattern to HTTP, in which case the request immediately completed. 22416 /// This may not contain any request headers that are added by the network 22417 /// stack, such as Authorization headers. 22418 const GUID IID_ICoreWebView2WebResourceRequestedEventHandler = ICoreWebView2WebResourceRequestedEventHandler.iid; 22419 22420 interface ICoreWebView2WebResourceRequestedEventHandler : IUnknown 22421 { 22422 static const GUID iid = { 0xab00b74c,0x15f1,0x4646,[ 0x80,0xe8,0xe7,0x63,0x41,0xd2,0x5d,0x71 ] }; 22423 extern(Windows): 22424 /// Called to provide the implementer with the event args for the 22425 /// corresponding event. 22426 HRESULT Invoke( 22427 /+[in]+/ ICoreWebView2 sender, 22428 /+[in]+/ ICoreWebView2WebResourceRequestedEventArgs args); 22429 } 22430 22431 /// The caller implements this method to receive the result of the 22432 /// CapturePreview method. The result is written to the stream provided in 22433 /// the CapturePreview method call. 22434 const GUID IID_ICoreWebView2CapturePreviewCompletedHandler = ICoreWebView2CapturePreviewCompletedHandler.iid; 22435 22436 interface ICoreWebView2CapturePreviewCompletedHandler : IUnknown 22437 { 22438 static const GUID iid = { 0x697e05e9,0x3d8f,0x45fa,[ 0x96,0xf4,0x8f,0xfe,0x1e,0xde,0xda,0xf5 ] }; 22439 extern(Windows): 22440 /// Called to provide the implementer with the completion status 22441 /// of the corresponding asynchronous method call. 22442 HRESULT Invoke(in HRESULT errorCode); 22443 } 22444 22445 /// The caller implements this method to receive the GotFocus and LostFocus 22446 /// events. There are no event args for this event. 22447 const GUID IID_ICoreWebView2FocusChangedEventHandler = ICoreWebView2FocusChangedEventHandler.iid; 22448 22449 interface ICoreWebView2FocusChangedEventHandler : IUnknown 22450 { 22451 static const GUID iid = { 0x05ea24bd,0x6452,0x4926,[ 0x90,0x14,0x4b,0x82,0xb4,0x98,0x13,0x5d ] }; 22452 extern(Windows): 22453 /// Called to provide the implementer with the event args for the 22454 /// corresponding event. There are no event args and the args 22455 /// parameter will be null. 22456 HRESULT Invoke( 22457 /+[in]+/ ICoreWebView2Controller sender, 22458 /+[in]+/ IUnknown args); 22459 } 22460 22461 /// Event args for the MoveFocusRequested event. 22462 const GUID IID_ICoreWebView2MoveFocusRequestedEventArgs = ICoreWebView2MoveFocusRequestedEventArgs.iid; 22463 22464 interface ICoreWebView2MoveFocusRequestedEventArgs : IUnknown 22465 { 22466 static const GUID iid = { 0x2d6aa13b,0x3839,0x4a15,[ 0x92,0xfc,0xd8,0x8b,0x3c,0x0d,0x9c,0x9d ] }; 22467 extern(Windows): 22468 /// The reason for WebView to fire the MoveFocus Requested event. 22469 /+[ propget]+/ 22470 HRESULT get_Reason(/+[out, retval]+/ COREWEBVIEW2_MOVE_FOCUS_REASON* reason); 22471 22472 /// Indicate whether the event has been handled by the app. 22473 /// If the app has moved the focus to its desired location, it should set 22474 /// Handled property to TRUE. 22475 /// When Handled property is false after the event handler returns, default 22476 /// action will be taken. The default action is to try to find the next tab 22477 /// stop child window in the app and try to move focus to that window. If 22478 /// there is no other such window to move focus to, focus will be cycled 22479 /// within the WebView's web content. 22480 /+[ propget]+/ 22481 HRESULT get_Handled(/+[out, retval]+/ BOOL* value); 22482 /// Set the Handled property. 22483 /+[ propput]+/ 22484 HRESULT put_Handled(in BOOL value); 22485 } 22486 22487 /// The caller implements this method to receive the MoveFocusRequested event. 22488 const GUID IID_ICoreWebView2MoveFocusRequestedEventHandler = ICoreWebView2MoveFocusRequestedEventHandler.iid; 22489 22490 interface ICoreWebView2MoveFocusRequestedEventHandler : IUnknown 22491 { 22492 static const GUID iid = { 0x69035451,0x6dc7,0x4cb8,[ 0x9b,0xce,0xb2,0xbd,0x70,0xad,0x28,0x9f ] }; 22493 extern(Windows): 22494 /// Called to provide the implementer with the event args for the 22495 /// corresponding event. 22496 HRESULT Invoke( 22497 /+[in]+/ ICoreWebView2Controller sender, 22498 /+[in]+/ ICoreWebView2MoveFocusRequestedEventArgs args); 22499 } 22500 22501 /// Event args for the WebMessageReceived event. 22502 const GUID IID_ICoreWebView2WebMessageReceivedEventArgs = ICoreWebView2WebMessageReceivedEventArgs.iid; 22503 22504 interface ICoreWebView2WebMessageReceivedEventArgs : IUnknown 22505 { 22506 static const GUID iid = { 0x0f99a40c,0xe962,0x4207,[ 0x9e,0x92,0xe3,0xd5,0x42,0xef,0xf8,0x49 ] }; 22507 extern(Windows): 22508 /// The URI of the document that sent this web message. 22509 /+[ propget]+/ 22510 HRESULT get_Source(/+[out, retval]+/ LPWSTR* source); 22511 22512 /// The message posted from the WebView content to the host converted to a 22513 /// JSON string. Use this to communicate via JavaScript objects. 22514 /// 22515 /// For example the following postMessage calls result in the 22516 /// following WebMessageAsJson values: 22517 /// 22518 /// ``` 22519 /// postMessage({'a': 'b'}) L"{\"a\": \"b\"}" 22520 /// postMessage(1.2) L"1.2" 22521 /// postMessage('example') L"\"example\"" 22522 /// ``` 22523 /+[ propget]+/ 22524 HRESULT get_WebMessageAsJson(/+[out, retval]+/ LPWSTR* webMessageAsJson); 22525 22526 /// If the message posted from the WebView content to the host is a 22527 /// string type, this method will return the value of that string. If the 22528 /// message posted is some other kind of JavaScript type this method will fail 22529 /// with E_INVALIDARG. Use this to communicate via simple strings. 22530 /// 22531 /// For example the following postMessage calls result in the 22532 /// following WebMessageAsString values: 22533 /// 22534 /// ``` 22535 /// postMessage({'a': 'b'}) E_INVALIDARG 22536 /// postMessage(1.2) E_INVALIDARG 22537 /// postMessage('example') L"example" 22538 /// ``` 22539 HRESULT TryGetWebMessageAsString(/+[out, retval]+/ LPWSTR* webMessageAsString); 22540 } 22541 22542 /// The caller implements this interface to receive the WebMessageReceived 22543 /// event. 22544 const GUID IID_ICoreWebView2WebMessageReceivedEventHandler = ICoreWebView2WebMessageReceivedEventHandler.iid; 22545 22546 interface ICoreWebView2WebMessageReceivedEventHandler : IUnknown 22547 { 22548 static const GUID iid = { 0x57213f19,0x00e6,0x49fa,[ 0x8e,0x07,0x89,0x8e,0xa0,0x1e,0xcb,0xd2 ] }; 22549 extern(Windows): 22550 /// Called to provide the implementer with the event args for the 22551 /// corresponding event. 22552 HRESULT Invoke( 22553 /+[in]+/ ICoreWebView2 sender, 22554 /+[in]+/ ICoreWebView2WebMessageReceivedEventArgs args); 22555 } 22556 22557 /// Event args for the DevToolsProtocolEventReceived event. 22558 const GUID IID_ICoreWebView2DevToolsProtocolEventReceivedEventArgs = ICoreWebView2DevToolsProtocolEventReceivedEventArgs.iid; 22559 22560 interface ICoreWebView2DevToolsProtocolEventReceivedEventArgs : IUnknown 22561 { 22562 static const GUID iid = { 0x653c2959,0xbb3a,0x4377,[ 0x86,0x32,0xb5,0x8a,0xda,0x4e,0x66,0xc4 ] }; 22563 extern(Windows): 22564 /// The parameter object of the corresponding DevToolsProtocol event 22565 /// represented as a JSON string. 22566 /+[ propget]+/ 22567 HRESULT get_ParameterObjectAsJson(/+[out, retval]+/ LPWSTR* 22568 parameterObjectAsJson); 22569 } 22570 22571 /// The caller implements this interface to receive 22572 /// DevToolsProtocolEventReceived events from the WebView. 22573 const GUID IID_ICoreWebView2DevToolsProtocolEventReceivedEventHandler = ICoreWebView2DevToolsProtocolEventReceivedEventHandler.iid; 22574 22575 interface ICoreWebView2DevToolsProtocolEventReceivedEventHandler : IUnknown 22576 { 22577 static const GUID iid = { 0xe2fda4be,0x5456,0x406c,[ 0xa2,0x61,0x3d,0x45,0x21,0x38,0x36,0x2c ] }; 22578 extern(Windows): 22579 /// Called to provide the implementer with the event args for the 22580 /// corresponding event. 22581 HRESULT Invoke( 22582 /+[in]+/ ICoreWebView2 sender, 22583 /+[in]+/ ICoreWebView2DevToolsProtocolEventReceivedEventArgs args); 22584 } 22585 22586 /// The caller implements this interface to receive CallDevToolsProtocolMethod 22587 /// completion results. 22588 const GUID IID_ICoreWebView2CallDevToolsProtocolMethodCompletedHandler = ICoreWebView2CallDevToolsProtocolMethodCompletedHandler.iid; 22589 22590 interface ICoreWebView2CallDevToolsProtocolMethodCompletedHandler : IUnknown 22591 { 22592 static const GUID iid = { 0x5c4889f0,0x5ef6,0x4c5a,[ 0x95,0x2c,0xd8,0xf1,0xb9,0x2d,0x05,0x74 ] }; 22593 extern(Windows): 22594 /// Called to provide the implementer with the completion status and result 22595 /// of the corresponding asynchronous method call. 22596 HRESULT Invoke(in HRESULT errorCode, in LPCWSTR returnObjectAsJson); 22597 } 22598 22599 /// The caller implements this interface to receive the CoreWebView2Controller created 22600 /// via CreateCoreWebView2Controller. 22601 const GUID IID_ICoreWebView2CreateCoreWebView2ControllerCompletedHandler = ICoreWebView2CreateCoreWebView2ControllerCompletedHandler.iid; 22602 22603 interface ICoreWebView2CreateCoreWebView2ControllerCompletedHandler : IUnknown 22604 { 22605 static const GUID iid = { 0x6c4819f3,0xc9b7,0x4260,[ 0x81,0x27,0xc9,0xf5,0xbd,0xe7,0xf6,0x8c ] }; 22606 extern(Windows): 22607 /// Called to provide the implementer with the completion status and result 22608 /// of the corresponding asynchronous method call. 22609 HRESULT Invoke(HRESULT errorCode, ICoreWebView2Controller createdController); 22610 } 22611 22612 /// Event args for the NewWindowRequested event. The event is fired when content 22613 /// inside webview requested to a open a new window (through window.open() and so on.) 22614 const GUID IID_ICoreWebView2NewWindowRequestedEventArgs = ICoreWebView2NewWindowRequestedEventArgs.iid; 22615 22616 interface ICoreWebView2NewWindowRequestedEventArgs : IUnknown 22617 { 22618 static const GUID iid = { 0x34acb11c,0xfc37,0x4418,[ 0x91,0x32,0xf9,0xc2,0x1d,0x1e,0xaf,0xb9 ] }; 22619 extern(Windows): 22620 /// The target uri of the NewWindowRequest. 22621 /+[ propget]+/ 22622 HRESULT get_Uri(/+[out, retval]+/ LPWSTR* uri); 22623 22624 /// Sets a WebView as a result of the NewWindowRequest. The target 22625 /// WebView should not be navigated. If the NewWindow is set, its top level 22626 /// window will return as the opened WindowProxy. 22627 /+[ propput]+/ 22628 HRESULT put_NewWindow(/+[in]+/ ICoreWebView2 newWindow); 22629 /// Gets the new window. 22630 /+[ propget]+/ 22631 HRESULT get_NewWindow(/+[out, retval]+/ ICoreWebView2 * newWindow); 22632 22633 /// Sets whether the NewWindowRequestedEvent is handled by host. If this is false 22634 /// and no NewWindow is set, the WebView will open a popup 22635 /// window and it will be returned as opened WindowProxy. 22636 /// If set to true and no NewWindow is set for a window.open call, the opened 22637 /// WindowProxy will be for an dummy window object and no window will load. 22638 /// Default is false. 22639 /+[ propput]+/ 22640 HRESULT put_Handled(in BOOL handled); 22641 /// Gets whether the NewWindowRequestedEvent is handled by host. 22642 /+[ propget]+/ 22643 HRESULT get_Handled(/+[out, retval]+/ BOOL* handled); 22644 22645 /// IsUserInitiated is true when the new window request was initiated through 22646 /// a user gesture such as clicking an anchor tag with target. The Edge 22647 /// popup blocker is disabled for WebView so the app can use this flag to 22648 /// block non-user initiated popups. 22649 /+[ propget]+/ 22650 HRESULT get_IsUserInitiated(/+[out, retval]+/ BOOL* isUserInitiated); 22651 22652 /// Obtain an ICoreWebView2Deferral object and put the event into a deferred state. 22653 /// You can use the ICoreWebView2Deferral object to complete the window open 22654 /// request at a later time. 22655 /// While this event is deferred the opener window will be returned a WindowProxy 22656 /// to an unnavigated window, which will navigate when the deferral is complete. 22657 HRESULT GetDeferral(/+[out, retval]+/ ICoreWebView2Deferral * deferral); 22658 22659 /// Window features specified by the window.open call. 22660 /// These features can be considered for positioning and sizing of 22661 /// new webview windows. 22662 /+[ propget]+/ 22663 HRESULT get_WindowFeatures(/+[out, retval]+/ ICoreWebView2WindowFeatures * value); 22664 } 22665 22666 /// Window features for a WebView popup window. These fields match the 22667 /// 'windowFeatures' passed to window.open as specified in 22668 /// https://developer.mozilla.org/en-US/docs/Web/API/Window/open#Window_features 22669 /// There is no requirement for you to respect these values. If your app doesn't 22670 /// have corresponding UI features, for example no toolbar, or if all webviews 22671 /// are opened in tabs and so cannot have distinct size or positions, then your 22672 /// app cannot respect these values. You may want to respect values but perhaps 22673 /// only some can apply to your app's UI. Accordingly, it is fine to respect 22674 /// all, some, or none of these properties as appropriate based on your app. 22675 /// For all numeric properties, if the value when passed to window.open is 22676 /// outside the range of an unsigned 32bit int, the value will be mod of the max 22677 /// of unsigned 32bit integer. If the value cannot be parsed as an integer it 22678 /// will be considered 0. If the value is a floating point value, it will be 22679 /// rounded down to an integer. 22680 const GUID IID_ICoreWebView2WindowFeatures = ICoreWebView2WindowFeatures.iid; 22681 22682 interface ICoreWebView2WindowFeatures : IUnknown 22683 { 22684 static const GUID iid = { 0x5eaf559f,0xb46e,0x4397,[ 0x88,0x60,0xe4,0x22,0xf2,0x87,0xff,0x1e ] }; 22685 extern(Windows): 22686 /// True if the Left and Top properties were specified. False if at least one 22687 /// was not specified. 22688 /+[ propget]+/ 22689 HRESULT get_HasPosition(/+[out, retval]+/ BOOL* value); 22690 /// True if the Width and Height properties were specified. False if at least 22691 /// one was not specified. 22692 /+[ propget]+/ 22693 HRESULT get_HasSize(/+[out, retval]+/ BOOL* value); 22694 /// The left position of the window. This will fail if HasPosition is false. 22695 /+[ propget]+/ 22696 HRESULT get_Left(/+[out, retval]+/ UINT32* value); 22697 /// The top position of the window. This will fail if HasPosition is false. 22698 /+[ propget]+/ 22699 HRESULT get_Top(/+[out, retval]+/ UINT32* value); 22700 /// The height of the window. This will fail if HasSize is false. 22701 /+[ propget]+/ 22702 HRESULT get_Height(/+[out, retval]+/ UINT32* value); 22703 /// The width of the window. This will fail if HasSize is false. 22704 /+[ propget]+/ 22705 HRESULT get_Width(/+[out, retval]+/ UINT32* value); 22706 /// Whether or not to display the menu bar. 22707 /+[ propget]+/ 22708 HRESULT get_ShouldDisplayMenuBar(/+[out, retval]+/ BOOL* value); 22709 /// Whether or not to display a status bar. 22710 /+[ propget]+/ 22711 HRESULT get_ShouldDisplayStatus(/+[out, retval]+/ BOOL* value); 22712 /// Whether or not to display a toolbar. 22713 /+[ propget]+/ 22714 HRESULT get_ShouldDisplayToolbar(/+[out, retval]+/ BOOL* value); 22715 /// Whether or not to display scroll bars. 22716 /+[ propget]+/ 22717 HRESULT get_ShouldDisplayScrollBars(/+[out, retval]+/ BOOL* value); 22718 } 22719 22720 /// The caller implements this interface to receive NewWindowRequested 22721 /// events. 22722 const GUID IID_ICoreWebView2NewWindowRequestedEventHandler = ICoreWebView2NewWindowRequestedEventHandler.iid; 22723 22724 interface ICoreWebView2NewWindowRequestedEventHandler : IUnknown 22725 { 22726 static const GUID iid = { 0xd4c185fe,0xc81c,0x4989,[ 0x97,0xaf,0x2d,0x3f,0xa7,0xab,0x56,0x51 ] }; 22727 extern(Windows): 22728 /// Called to provide the implementer with the event args for the 22729 /// corresponding event. 22730 HRESULT Invoke( 22731 /+[in]+/ ICoreWebView2 sender, 22732 /+[in]+/ ICoreWebView2NewWindowRequestedEventArgs args); 22733 } 22734 22735 /// The caller implements this interface to receive DocumentTitleChanged 22736 /// events. Use the DocumentTitle property to get the modified 22737 /// title. 22738 const GUID IID_ICoreWebView2DocumentTitleChangedEventHandler = ICoreWebView2DocumentTitleChangedEventHandler.iid; 22739 22740 interface ICoreWebView2DocumentTitleChangedEventHandler : IUnknown 22741 { 22742 static const GUID iid = { 0xf5f2b923,0x953e,0x4042,[ 0x9f,0x95,0xf3,0xa1,0x18,0xe1,0xaf,0xd4 ] }; 22743 extern(Windows): 22744 /// Called to provide the implementer with the event args for the 22745 /// corresponding event. There are no event args and the args 22746 /// parameter will be null. 22747 HRESULT Invoke(/+[in]+/ ICoreWebView2 sender, /+[in]+/ IUnknown args); 22748 } 22749 22750 /// Event args for the AcceleratorKeyPressed event. 22751 const GUID IID_ICoreWebView2AcceleratorKeyPressedEventArgs = ICoreWebView2AcceleratorKeyPressedEventArgs.iid; 22752 22753 interface ICoreWebView2AcceleratorKeyPressedEventArgs : IUnknown 22754 { 22755 static const GUID iid = { 0x9f760f8a,0xfb79,0x42be,[ 0x99,0x90,0x7b,0x56,0x90,0x0f,0xa9,0xc7 ] }; 22756 extern(Windows): 22757 /// The key event type that caused the event to be fired. 22758 /+[ propget]+/ 22759 HRESULT get_KeyEventKind(/+[out, retval]+/ COREWEBVIEW2_KEY_EVENT_KIND* keyEventKind); 22760 /// The Win32 virtual key code of the key that was pressed or released. 22761 /// This will be one of the Win32 virtual key constants such as VK_RETURN or 22762 /// an (uppercase) ASCII value such as 'A'. You can check whether Ctrl or Alt 22763 /// are pressed by calling GetKeyState(VK_CONTROL) or GetKeyState(VK_MENU). 22764 /+[ propget]+/ 22765 HRESULT get_VirtualKey(/+[out, retval]+/ UINT* virtualKey); 22766 /// The LPARAM value that accompanied the window message. See the 22767 /// documentation for the WM_KEYDOWN and WM_KEYUP messages. 22768 /+[ propget]+/ 22769 HRESULT get_KeyEventLParam(/+[out, retval]+/ INT* lParam); 22770 /// A structure representing the information passed in the LPARAM of the 22771 /// window message. 22772 /+[ propget]+/ 22773 HRESULT get_PhysicalKeyStatus( 22774 /+[out, retval]+/ COREWEBVIEW2_PHYSICAL_KEY_STATUS* physicalKeyStatus); 22775 /// During AcceleratorKeyPressedEvent handler invocation the WebView is blocked 22776 /// waiting for the decision of if the accelerator will be handled by the host 22777 /// or not. If the Handled property is set to TRUE then this will 22778 /// prevent the WebView from performing the default action for this 22779 /// accelerator key. Otherwise the WebView will perform the default action for 22780 /// the accelerator key. 22781 /+[ propget]+/ 22782 HRESULT get_Handled(/+[out, retval]+/ BOOL* handled); 22783 /// Sets the Handled property. 22784 /+[ propput]+/ 22785 HRESULT put_Handled(in BOOL handled); 22786 } 22787 22788 /// The caller implements this interface to receive the AcceleratorKeyPressed 22789 /// event. 22790 const GUID IID_ICoreWebView2AcceleratorKeyPressedEventHandler = ICoreWebView2AcceleratorKeyPressedEventHandler.iid; 22791 22792 interface ICoreWebView2AcceleratorKeyPressedEventHandler : IUnknown 22793 { 22794 static const GUID iid = { 0xb29c7e28,0xfa79,0x41a8,[ 0x8e,0x44,0x65,0x81,0x1c,0x76,0xdc,0xb2 ] }; 22795 extern(Windows): 22796 /// Called to provide the implementer with the event args for the 22797 /// corresponding event. 22798 HRESULT Invoke( 22799 /+[in]+/ ICoreWebView2Controller sender, 22800 /+[in]+/ ICoreWebView2AcceleratorKeyPressedEventArgs args); 22801 } 22802 22803 /// The caller implements this interface to receive NewBrowserVersionAvailable events. 22804 const GUID IID_ICoreWebView2NewBrowserVersionAvailableEventHandler = ICoreWebView2NewBrowserVersionAvailableEventHandler.iid; 22805 22806 interface ICoreWebView2NewBrowserVersionAvailableEventHandler : IUnknown 22807 { 22808 static const GUID iid = { 0xf9a2976e,0xd34e,0x44fc,[ 0xad,0xee,0x81,0xb6,0xb5,0x7c,0xa9,0x14 ] }; 22809 extern(Windows): 22810 /// Called to provide the implementer with the event args for the 22811 /// corresponding event. 22812 HRESULT Invoke(/+[in]+/ ICoreWebView2Environment webviewEnvironment, 22813 /+[in]+/ IUnknown args); 22814 } 22815 22816 /// The caller implements this method to receive the 22817 /// ContainsFullScreenElementChanged events. There are no event args for this 22818 /// event. 22819 const GUID IID_ICoreWebView2ContainsFullScreenElementChangedEventHandler = ICoreWebView2ContainsFullScreenElementChangedEventHandler.iid; 22820 22821 interface ICoreWebView2ContainsFullScreenElementChangedEventHandler : IUnknown 22822 { 22823 static const GUID iid = { 0xe45d98b1,0xafef,0x45be,[ 0x8b,0xaf,0x6c,0x77,0x28,0x86,0x7f,0x73 ] }; 22824 extern(Windows): 22825 /// Called to provide the implementer with the event args for the 22826 /// corresponding event. There are no event args and the args 22827 /// parameter will be null. 22828 HRESULT Invoke(/+[in]+/ ICoreWebView2 sender, /+[in]+/ IUnknown args); 22829 } 22830 22831 /// The caller implements this interface to receive NewWindowRequested 22832 /// events. 22833 const GUID IID_ICoreWebView2WindowCloseRequestedEventHandler = ICoreWebView2WindowCloseRequestedEventHandler.iid; 22834 22835 interface ICoreWebView2WindowCloseRequestedEventHandler : IUnknown 22836 { 22837 static const GUID iid = { 0x5c19e9e0,0x092f,0x486b,[ 0xaf,0xfa,0xca,0x82,0x31,0x91,0x30,0x39 ] }; 22838 extern(Windows): 22839 /// Called to provide the implementer with the event args for the 22840 /// corresponding event. There are no event args and the args 22841 /// parameter will be null. 22842 HRESULT Invoke(/+[in]+/ ICoreWebView2 sender, /+[in]+/ IUnknown args); 22843 } 22844 22845 /// This represents the WebView2 Environment. WebViews created from an 22846 /// environment run on the browser process specified with environment parameters 22847 /// and objects created from an environment should be used in the same environment. 22848 /// Using it in different environments are not guaranteed to be compatible and may fail. 22849 const GUID IID_ICoreWebView2Environment = ICoreWebView2Environment.iid; 22850 22851 interface ICoreWebView2Environment : IUnknown 22852 { 22853 static const GUID iid = { 0xb96d755e,0x0319,0x4e92,[ 0xa2,0x96,0x23,0x43,0x6f,0x46,0xa1,0xfc ] }; 22854 extern(Windows): 22855 /// Asynchronously create a new WebView. 22856 /// 22857 /// parentWindow is the HWND in which the WebView should be displayed and 22858 /// from which receive input. The WebView will add a child window to the 22859 /// provided window during WebView creation. Z-order and other things impacted 22860 /// by sibling window order will be affected accordingly. 22861 /// 22862 /// It is recommended that the application set Application User Model ID for 22863 /// the process or the application window. If none is set, during WebView 22864 /// creation a generated Application User Model ID is set to root window of 22865 /// parentWindow. 22866 /// \snippet AppWindow.cpp CreateCoreWebView2Controller 22867 /// 22868 /// It is recommended that the application handles restart manager messages 22869 /// so that it can be restarted gracefully in the case when the app is using 22870 /// Edge for WebView from a certain installation and that installation is being 22871 /// uninstalled. For example, if a user installs Edge from Dev channel and 22872 /// opts to use Edge from that channel for testing the app, and then uninstalls 22873 /// Edge from that channel without closing the app, the app will be restarted 22874 /// to allow uninstallation of the dev channel to succeed. 22875 /// \snippet AppWindow.cpp RestartManager 22876 /// 22877 /// When the application retries CreateCoreWebView2Controller upon failure, it is 22878 /// recommended that the application restarts from creating a new WebView2 22879 /// Environment. If an Edge update happens, the version associated with a WebView2 22880 /// Environment could have been removed and causing the object to no longer work. 22881 /// Creating a new WebView2 Environment will work as it uses the latest version. 22882 /// 22883 /// WebView creation will fail if there is already a running instance using the same 22884 /// user data folder, and the Environment objects have different EnvironmentOptions. 22885 /// For example, if there is already a WebView created with one language, trying to 22886 /// create a WebView with a different language using the same user data folder will 22887 /// fail. 22888 HRESULT CreateCoreWebView2Controller( 22889 HWND parentWindow, 22890 ICoreWebView2CreateCoreWebView2ControllerCompletedHandler handler); 22891 22892 /// Create a new web resource response object. The headers is the 22893 /// raw response header string delimited by newline. It's also possible to 22894 /// create this object with null headers string and then use the 22895 /// ICoreWebView2HttpResponseHeaders to construct the headers line by line. 22896 /// For information on other parameters see ICoreWebView2WebResourceResponse. 22897 /// 22898 /// \snippet SettingsComponent.cpp WebResourceRequested 22899 HRESULT CreateWebResourceResponse( 22900 in IStream* content, 22901 in int statusCode, 22902 in LPCWSTR reasonPhrase, 22903 in LPCWSTR headers, 22904 /+[out, retval]+/ ICoreWebView2WebResourceResponse * response); 22905 22906 /// The browser version info of the current ICoreWebView2Environment, 22907 /// including channel name if it is not the stable channel. 22908 /// This matches the format of the 22909 /// GetAvailableCoreWebView2BrowserVersionString API. 22910 /// Channel names are 'beta', 'dev', and 'canary'. 22911 /// 22912 /// \snippet AppWindow.cpp GetBrowserVersionString 22913 /+[ propget]+/ 22914 HRESULT get_BrowserVersionString(/+[out, retval]+/ LPWSTR* versionInfo); 22915 22916 /// Add an event handler for the NewBrowserVersionAvailable event. 22917 /// NewBrowserVersionAvailable fires when a newer version of the 22918 /// Edge browser is installed and available for use via WebView2. 22919 /// To use the newer version of the browser you must create a new 22920 /// environment and WebView. 22921 /// This event will only be fired for new version from the same Edge channel 22922 /// that the code is running from. When not running with installed Edge, 22923 /// no event will be fired. 22924 /// 22925 /// Because a user data folder can only be used by one browser process at 22926 /// a time, if you want to use the same user data folder in the WebViews 22927 /// using the new version of the browser, 22928 /// you must close the environment and WebViews that are using the older 22929 /// version of the browser first. Or simply prompt the user to restart the 22930 /// app. 22931 /// 22932 /// \snippet AppWindow.cpp NewBrowserVersionAvailable 22933 /// 22934 HRESULT add_NewBrowserVersionAvailable( 22935 /+[in]+/ ICoreWebView2NewBrowserVersionAvailableEventHandler eventHandler, 22936 /+[out]+/ EventRegistrationToken* token); 22937 22938 /// Remove an event handler previously added with add_NewBrowserVersionAvailable. 22939 HRESULT remove_NewBrowserVersionAvailable( 22940 in EventRegistrationToken token); 22941 } 22942 22943 /// Options used to create WebView2 Environment. 22944 /// 22945 /// \snippet AppWindow.cpp CreateCoreWebView2EnvironmentWithOptions 22946 /// 22947 const GUID IID_ICoreWebView2EnvironmentOptions = ICoreWebView2EnvironmentOptions.iid; 22948 22949 interface ICoreWebView2EnvironmentOptions : IUnknown 22950 { 22951 static const GUID iid = { 0x2fde08a8,0x1e9a,0x4766,[ 0x8c,0x05,0x95,0xa9,0xce,0xb9,0xd1,0xc5 ] }; 22952 extern(Windows): 22953 /// AdditionalBrowserArguments can be specified to change the behavior of the 22954 /// WebView. These will be passed to the browser process as part of 22955 /// the command line. See 22956 /// [Run Chromium with Flags](https://aka.ms/RunChromiumWithFlags) 22957 /// for more information about command line switches to browser 22958 /// process. If the app is launched with a command line switch 22959 /// `--edge-webview-switches=xxx` the value of that switch (xxx in 22960 /// the above example) will also be appended to the browser 22961 /// process command line. Certain switches like `--user-data-dir` are 22962 /// internal and important to WebView. Those switches will be 22963 /// ignored even if specified. If the same switches are specified 22964 /// multiple times, the last one wins. There is no attempt to 22965 /// merge the different values of the same switch, except for disabled 22966 /// and enabled features. The features specified by `--enable-features` 22967 /// and `--disable-features` will be merged with simple logic: the features 22968 /// will be the union of the specified features and built-in features, and if 22969 /// a feature is disabled, it will be removed from the enabled features list. 22970 /// App process's command line `--edge-webview-switches` value are processed 22971 /// after the additionalBrowserArguments parameter is processed. Certain 22972 /// features are disabled internally and can't be enabled. 22973 /// If parsing failed for the specified switches, they will be 22974 /// ignored. Default is to run browser process with no extra flags. 22975 /+[ propget]+/ 22976 HRESULT get_AdditionalBrowserArguments(/+[out, retval]+/ LPWSTR* value); 22977 /// Set the AdditionalBrowserArguments property. 22978 /+[ propput]+/ 22979 HRESULT put_AdditionalBrowserArguments(in LPCWSTR value); 22980 22981 /// The default language that WebView will run with. It applies to browser UIs 22982 /// like context menu and dialogs. It also applies to the accept-languages 22983 /// HTTP header that WebView sends to web sites. 22984 /// It is in the format of `language[-country]` where `language` is the 2 letter 22985 /// code from ISO 639 and `country` is the 2 letter code from ISO 3166. 22986 /+[ propget]+/ 22987 HRESULT get_Language(/+[out, retval]+/ LPWSTR* value); 22988 /// Set the Language property. 22989 /+[ propput]+/ 22990 HRESULT put_Language(in LPCWSTR value); 22991 22992 /// The version of the Edge WebView2 Runtime binaries required to be 22993 /// compatible with the calling application. This defaults to the Edge 22994 /// WebView2 Runtime version 22995 /// that corresponds with the version of the SDK the application is using. 22996 /// The format of this value is the same as the format of the 22997 /// BrowserVersionString property and other BrowserVersion values. 22998 /// Only the version part of the BrowserVersion value is respected. The 22999 /// channel suffix, if it exists, is ignored. 23000 /// The version of the Edge WebView2 Runtime binaries actually used may be 23001 /// different from the specified TargetCompatibleBrowserVersion. They are only 23002 /// guaranteed to be compatible. You can check the actual version on the 23003 /// BrowserVersionString property on the ICoreWebView2Environment. 23004 /+[ propget]+/ 23005 HRESULT get_TargetCompatibleBrowserVersion(/+[out, retval]+/ LPWSTR* value); 23006 /// Set the TargetCompatibleBrowserVersion property. 23007 /+[ propput]+/ 23008 HRESULT put_TargetCompatibleBrowserVersion(in LPCWSTR value); 23009 23010 /// The AllowSingleSignOnUsingOSPrimaryAccount property is used to enable 23011 /// single sign on with Azure Active Directory (AAD) resources inside WebView 23012 /// using the logged in Windows account and single sign on with web sites using 23013 /// Microsoft account associated with the login in Windows account. 23014 /// Default is disabled. 23015 /// Universal Windows Platform apps must also declare enterpriseCloudSSO 23016 /// [restricted capability](https://docs.microsoft.com/windows/uwp/packaging/app-capability-declarations#restricted-capabilities) 23017 /// for the single sign on to work. 23018 /+[ propget]+/ 23019 HRESULT get_AllowSingleSignOnUsingOSPrimaryAccount(/+[out, retval]+/ BOOL* allow); 23020 /// Set the AllowSingleSignOnUsingOSPrimaryAccount property. 23021 /+[ propput]+/ 23022 HRESULT put_AllowSingleSignOnUsingOSPrimaryAccount(in BOOL allow); 23023 } 23024 23025 /// The caller implements this interface to receive the WebView2Environment created 23026 /// via CreateCoreWebView2Environment. 23027 const GUID IID_ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler = ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler.iid; 23028 23029 interface ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler : IUnknown 23030 { 23031 static const GUID iid = { 0x4e8a3389,0xc9d8,0x4bd2,[ 0xb6,0xb5,0x12,0x4f,0xee,0x6c,0xc1,0x4d ] }; 23032 extern(Windows): 23033 /// Called to provide the implementer with the completion status and result 23034 /// of the corresponding asynchronous method call. 23035 HRESULT Invoke(HRESULT errorCode, ICoreWebView2Environment createdEnvironment); 23036 } 23037 23038 /// A Receiver is created for a particular DevTools Protocol event and allows 23039 /// you to subscribe and unsubscribe from that event. 23040 /// Obtained from the WebView object via GetDevToolsProtocolEventReceiver. 23041 const GUID IID_ICoreWebView2DevToolsProtocolEventReceiver = ICoreWebView2DevToolsProtocolEventReceiver.iid; 23042 23043 interface ICoreWebView2DevToolsProtocolEventReceiver : IUnknown 23044 { 23045 static const GUID iid = { 0xb32ca51a,0x8371,0x45e9,[ 0x93,0x17,0xaf,0x02,0x1d,0x08,0x03,0x67 ] }; 23046 extern(Windows): 23047 /// Subscribe to a DevToolsProtocol event. 23048 /// The handler's Invoke method will be called whenever the corresponding 23049 /// DevToolsProtocol event fires. Invoke will be called with 23050 /// an event args object containing the DevTools Protocol event's parameter 23051 /// object as a JSON string. 23052 /// 23053 /// \snippet ScriptComponent.cpp DevToolsProtocolEventReceived 23054 HRESULT add_DevToolsProtocolEventReceived( 23055 /+[in]+/ ICoreWebView2DevToolsProtocolEventReceivedEventHandler handler, 23056 /+[out]+/ EventRegistrationToken* token); 23057 /// Remove an event handler previously added with 23058 /// add_DevToolsProtocolEventReceived. 23059 HRESULT remove_DevToolsProtocolEventReceived( 23060 in EventRegistrationToken token); 23061 } 23062 23063 /// DLL export to create a WebView2 environment with a custom version of Edge, 23064 /// user data directory and/or additional options. 23065 /// 23066 /// The WebView2 environment and all other WebView2 objects are single threaded 23067 /// and have dependencies on Windows components that require COM to be 23068 /// initialized for a single-threaded apartment. The application is expected to 23069 /// call CoInitializeEx before calling CreateCoreWebView2EnvironmentWithOptions. 23070 /// 23071 /// ``` 23072 /// CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); 23073 /// ``` 23074 /// 23075 /// If CoInitializeEx was not called or has been previously called with 23076 /// COINIT_MULTITHREADED, CreateCoreWebView2EnvironmentWithOptions will fail 23077 /// with one of the following errors. 23078 /// 23079 /// ``` 23080 /// CO_E_NOTINITIALIZED (if CoInitializeEx was not called) 23081 /// RPC_E_CHANGED_MODE (if CoInitializeEx was previously called with 23082 /// COINIT_MULTITHREADED) 23083 /// ``` 23084 /// 23085 /// Use `browserExecutableFolder` to specify whether WebView2 controls use a 23086 /// fixed or installed version of the WebView2 Runtime that exists on a client 23087 /// machine. To use a fixed version of the WebView2 Runtime, pass the relative 23088 /// path of the folder that contains the fixed version of the WebView2 Runtime 23089 /// to `browserExecutableFolder`. To create WebView2 controls that use the 23090 /// installed version of the WebView2 Runtime that exists on client machines, 23091 /// pass a null or empty string to `browserExecutableFolder`. In this scenario, 23092 /// the API tries to find a compatible version of the WebView2 Runtime that is 23093 /// installed on the client machine (first at the machine level, and then per 23094 /// user) using the selected channel preference. The path of fixed version of 23095 /// the WebView2 Runtime should not contain `\Edge\Application\`. When such a 23096 /// path is used, the API will fail with ERROR_NOT_SUPPORTED. 23097 /// 23098 /// The default channel search order is the WebView2 Runtime, Beta, Dev, and 23099 /// Canary. 23100 /// When there is an override WEBVIEW2_RELEASE_CHANNEL_PREFERENCE environment 23101 /// variable or applicable releaseChannelPreference registry value 23102 /// with the value of 1, the channel search order is reversed. 23103 /// 23104 /// userDataFolder can be 23105 /// specified to change the default user data folder location for 23106 /// WebView2. The path can be an absolute file path or a relative file path 23107 /// that is interpreted as relative to the current process's executable. 23108 /// Otherwise, for UWP apps, the default user data folder will be 23109 /// the app data folder for the package; for non-UWP apps, 23110 /// the default user data folder `{Executable File Name}.WebView2` 23111 /// will be created in the same directory next to the app executable. 23112 /// WebView2 creation can fail if the executable is running in a directory 23113 /// that the process doesn't have permission to create a new folder in. 23114 /// The app is responsible to clean up its user data folder 23115 /// when it is done. 23116 /// 23117 /// Note that as a browser process might be shared among WebViews, 23118 /// WebView creation will fail with HRESULT_FROM_WIN32(ERROR_INVALID_STATE) if 23119 /// the specified options does not match the options of the WebViews that are 23120 /// currently running in the shared browser process. 23121 /// 23122 /// environmentCreatedHandler is the handler result to the async operation 23123 /// which will contain the WebView2Environment that got created. 23124 /// 23125 /// The browserExecutableFolder, userDataFolder and additionalBrowserArguments 23126 /// of the environmentOptions may be overridden by 23127 /// values either specified in environment variables or in the registry. 23128 /// 23129 /// When creating a WebView2Environment the following environment variables 23130 /// are checked: 23131 /// 23132 /// ``` 23133 /// WEBVIEW2_BROWSER_EXECUTABLE_FOLDER 23134 /// WEBVIEW2_USER_DATA_FOLDER 23135 /// WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS 23136 /// WEBVIEW2_RELEASE_CHANNEL_PREFERENCE 23137 /// ``` 23138 /// 23139 /// If an override environment variable is found then we use the 23140 /// browserExecutableFolder and userDataFolder values as replacements for the 23141 /// corresponding values in CreateCoreWebView2EnvironmentWithOptions parameters. 23142 /// If additionalBrowserArguments specified in environment variable or in the 23143 /// registry, it will be appended to the correspinding values in 23144 /// CreateCoreWebView2EnvironmentWithOptions parameters. 23145 /// 23146 /// While not strictly overrides, there exists additional environment variables 23147 /// that can be set: 23148 /// 23149 /// ``` 23150 /// WEBVIEW2_WAIT_FOR_SCRIPT_DEBUGGER 23151 /// ``` 23152 /// 23153 /// When found with a non-empty value, this indicates that the WebView is being 23154 /// launched under a script debugger. In this case, the WebView will issue a 23155 /// `Page.waitForDebugger` CDP command that will cause script execution inside the 23156 /// WebView to pause on launch, until a debugger issues a corresponding 23157 /// `Runtime.runIfWaitingForDebugger` CDP command to resume execution. 23158 /// Note: There is no registry key equivalent of this environment variable. 23159 /// 23160 /// ``` 23161 /// WEBVIEW2_PIPE_FOR_SCRIPT_DEBUGGER 23162 /// ``` 23163 /// 23164 /// When found with a non-empty value, this indicates that the WebView is being 23165 /// launched under a script debugger that also supports host applications that 23166 /// use multiple WebViews. The value is used as the identifier for a named pipe 23167 /// that will be opened and written to when a new WebView is created by the host 23168 /// application. The payload will match that of the remote-debugging-port JSON 23169 /// target and can be used by the external debugger to attach to a specific 23170 /// WebView instance. 23171 /// The format of the pipe created by the debugger should be: 23172 /// `\\.\pipe\WebView2\Debugger\{app_name}\{pipe_name}` 23173 /// where: 23174 /// 23175 /// - `{app_name}` is the host application exe filename, e.g. WebView2Example.exe 23176 /// - `{pipe_name}` is the value set for WEBVIEW2_PIPE_FOR_SCRIPT_DEBUGGER. 23177 /// 23178 /// To enable debugging of the targets identified by the JSON you will also need 23179 /// to set the WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS environment variable to 23180 /// send `--remote-debugging-port={port_num}` 23181 /// where: 23182 /// 23183 /// - `{port_num}` is the port on which the CDP server will bind. 23184 /// 23185 /// Be aware that setting both the WEBVIEW2_PIPE_FOR_SCRIPT_DEBUGGER and 23186 /// WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS environment variables will cause the 23187 /// WebViews hosted in your application and their contents to be exposed to 23188 /// 3rd party applications such as debuggers. 23189 /// 23190 /// Note: There is no registry key equivalent of this environment variable. 23191 /// 23192 /// If none of those environment variables exist, then the registry is examined next. 23193 /// The following registry values are checked: 23194 /// 23195 /// ``` 23196 /// [{Root}]\Software\Policies\Microsoft\Edge\WebView2\BrowserExecutableFolder 23197 /// "{AppId}"="" 23198 /// 23199 /// [{Root}]\Software\Policies\Microsoft\Edge\WebView2\ReleaseChannelPreference 23200 /// "{AppId}"="" 23201 /// 23202 /// [{Root}]\Software\Policies\Microsoft\Edge\WebView2\AdditionalBrowserArguments 23203 /// "{AppId}"="" 23204 /// 23205 /// [{Root}]\Software\Policies\Microsoft\Edge\WebView2\UserDataFolder 23206 /// "{AppId}"="" 23207 /// ``` 23208 /// 23209 /// browserExecutableFolder and releaseChannelPreference can be configured using 23210 /// group policy under Administrative Templates > Microsoft Edge WebView2. 23211 /// The old registry location will be deprecated soon: 23212 /// 23213 /// ``` 23214 /// [{Root}\Software\Policies\Microsoft\EmbeddedBrowserWebView\LoaderOverride\{AppId}] 23215 /// "ReleaseChannelPreference"=dword:00000000 23216 /// "BrowserExecutableFolder"="" 23217 /// "UserDataFolder"="" 23218 /// "AdditionalBrowserArguments"="" 23219 /// ``` 23220 /// 23221 /// In the unlikely scenario where some instances of WebView are open during 23222 /// a browser update we could end up blocking the deletion of old Edge browsers. 23223 /// To avoid running out of disk space a new WebView creation will fail 23224 /// with the next error if it detects that there are many old versions present. 23225 /// 23226 /// ``` 23227 /// ERROR_DISK_FULL 23228 /// ``` 23229 /// 23230 /// The default maximum number of Edge versions allowed is 20. 23231 /// 23232 /// The maximum number of old Edge versions allowed can be overwritten with the value 23233 /// of the following environment variable. 23234 /// 23235 /// ``` 23236 /// WEBVIEW2_MAX_INSTANCES 23237 /// ``` 23238 /// 23239 /// If the Webview depends on an installed Edge and it is uninstalled 23240 /// any subsequent creation will fail with the next error 23241 /// 23242 /// ``` 23243 /// ERROR_PRODUCT_UNINSTALLED 23244 /// ``` 23245 /// 23246 /// First we check with Root as HKLM and then HKCU. 23247 /// AppId is first set to the Application User Model ID of the caller's process, 23248 /// then if there's no corresponding registry key the AppId is set to the 23249 /// executable name of the caller's process, or if that isn't a registry key 23250 /// then '*'. If an override registry key is found, then we use the 23251 /// browserExecutableFolder and userDataFolder registry values as replacements 23252 /// and append additionalBrowserArguments registry values for the corresponding 23253 /// values in CreateCoreWebView2EnvironmentWithOptions parameters. 23254 extern(Windows) HRESULT CreateCoreWebView2EnvironmentWithOptions(PCWSTR browserExecutableFolder, PCWSTR userDataFolder, ICoreWebView2EnvironmentOptions environmentOptions, ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler environmentCreatedHandler); 23255 23256 /// Creates an evergreen WebView2 Environment using the installed Edge version. 23257 /// This is equivalent to calling CreateCoreWebView2EnvironmentWithOptions with 23258 /// nullptr for browserExecutableFolder, userDataFolder, 23259 /// additionalBrowserArguments. See CreateCoreWebView2EnvironmentWithOptions for 23260 /// more details. 23261 extern(Windows) HRESULT CreateCoreWebView2Environment(ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler environmentCreatedHandler); 23262 23263 /// Get the browser version info including channel name if it is not the stable channel 23264 /// or the Embedded Edge. 23265 /// Channel names are beta, dev, and canary. 23266 /// If an override exists for the browserExecutableFolder or the channel preference, 23267 /// the override will be used. 23268 /// If there isn't an override, then the parameter passed to 23269 /// GetAvailableCoreWebView2BrowserVersionString is used. 23270 extern(Windows) HRESULT GetAvailableCoreWebView2BrowserVersionString(PCWSTR browserExecutableFolder, LPWSTR* versionInfo); 23271 23272 /// This method is for anyone want to compare version correctly to determine 23273 /// which version is newer, older or same. It can be used to determine whether 23274 /// to use webview2 or certain feature base on version. 23275 /// Sets the value of result to -1, 0 or 1 if version1 is less than, equal or 23276 /// greater than version2 respectively. 23277 /// Returns E_INVALIDARG if it fails to parse any of the version strings or any 23278 /// input parameter is null. 23279 /// Input can directly use the versionInfo obtained from 23280 /// GetAvailableCoreWebView2BrowserVersionString, channel info will be ignored. 23281 extern(Windows) HRESULT CompareBrowserVersions(PCWSTR version1, PCWSTR version2, int* result); 23282 23283 }