diff --git a/.github/scripts/assert-win7-installer-content.ps1 b/.github/scripts/assert-win7-installer-content.ps1 index 39510bbd..4059a533 100644 --- a/.github/scripts/assert-win7-installer-content.ps1 +++ b/.github/scripts/assert-win7-installer-content.ps1 @@ -15,7 +15,8 @@ function Find-7Zip { $commonPaths = @( (Join-Path $env:ProgramFiles "7-Zip\7z.exe"), - (Join-Path ${env:ProgramFiles(x86)} "7-Zip\7z.exe") + (Join-Path ${env:ProgramFiles(x86)} "7-Zip\7z.exe"), + "C:\ProgramData\chocolatey\bin\7z.exe" ) foreach ($path in $commonPaths) { diff --git a/.github/scripts/prepare-webview2-win7-loader.ps1 b/.github/scripts/prepare-webview2-win7-loader.ps1 index ad3514a2..5a3fd50c 100644 --- a/.github/scripts/prepare-webview2-win7-loader.ps1 +++ b/.github/scripts/prepare-webview2-win7-loader.ps1 @@ -7,11 +7,12 @@ $ErrorActionPreference = "Stop" # Newer WebView2 static loaders import EventSetInformation, which is not # available on Windows 7. The SDK loader entry points used by webview2-com-sys # are stable enough for this pinned Win7 compatibility build. -$sdkVersion = "1.0.1054.31" -$sdkPackageSha256 = "0afe683aa3d143a5f6330db1ce833c69278b38fe5e1eadec52f26910ad26e22f" -$legacyLoaderSha256 = "76314119685bbf4c2b2423a44e81b57beadc914c943d0e772fd6bc78c8e6b0e8" +$sdkVersion = "1.0.1020.30" +$sdkPackageSha256 = "fbc554d8e06c8c7653cd3adab2afe97faec02a75613bf9f2f8daa5e61348acab" +$legacyLoaderSha256 = "1d8977604839607a0d1563a305862ca31412469dbd88d7652bf42dcbef1dbaef" $knownWebView2ComSysVersion = "0.38.2" $knownUpstreamLoaderSha256 = "0659b741bde6348d4c4a6ec4ceb9af50e3d0048ed9cd3c8659bccbb61fde55ee" +$knownRejectedLoaderSha256 = "76314119685bbf4c2b2423a44e81b57beadc914c943d0e772fd6bc78c8e6b0e8" $repositoryRoot = (Resolve-Path (Join-Path $PSScriptRoot "..\..")).Path $tauriManifest = Join-Path $repositoryRoot "src-tauri\Cargo.toml" @@ -20,6 +21,39 @@ $temporaryRoot = Join-Path ([System.IO.Path]::GetTempPath()) "nyaterm-win7-webvi $packagePath = Join-Path $temporaryRoot "Microsoft.Web.WebView2.$sdkVersion.nupkg" $extractedPath = Join-Path $temporaryRoot "extracted" +function Install-LegacyLoader { + param( + [Parameter(Mandatory = $true)] + [string]$Destination, + + [Parameter(Mandatory = $true)] + [string]$Source + ) + + if (!(Test-Path -LiteralPath $Destination -PathType Leaf)) { + throw "webview2-com-sys static loader does not exist: $Destination" + } + + $existingLoaderSha256 = (Get-FileHash -LiteralPath $Destination -Algorithm SHA256).Hash.ToLowerInvariant() + if ($existingLoaderSha256 -notin @($knownUpstreamLoaderSha256, $legacyLoaderSha256, $knownRejectedLoaderSha256)) { + throw "Refusing to replace unknown webview2-com-sys loader SHA256 at ${Destination}: $existingLoaderSha256" + } + + Set-ItemProperty -LiteralPath $Destination -Name IsReadOnly -Value $false + Copy-Item -LiteralPath $Source -Destination $Destination -Force + + $installedLoaderSha256 = (Get-FileHash -LiteralPath $Destination -Algorithm SHA256).Hash.ToLowerInvariant() + if ($installedLoaderSha256 -ne $legacyLoaderSha256) { + throw "Windows 7 WebView2 loader replacement failed at ${Destination}. Expected $legacyLoaderSha256, got $installedLoaderSha256." + } + + [pscustomobject]@{ + Path = $Destination + PreviousSha256 = $existingLoaderSha256 + InstalledSha256 = $installedLoaderSha256 + } +} + function Get-LockedWebView2ComSysVersion { $lockText = Get-Content -LiteralPath $lockFile -Raw $match = [regex]::Match($lockText, '(?ms)\[\[package\]\]\s+name = "webview2-com-sys"\s+version = "([^"]+)"') @@ -89,24 +123,30 @@ try { throw "webview2-com-sys static loader does not exist: $loaderDestination" } - $existingLoaderSha256 = (Get-FileHash -LiteralPath $loaderDestination -Algorithm SHA256).Hash.ToLowerInvariant() - if ($existingLoaderSha256 -notin @($knownUpstreamLoaderSha256, $legacyLoaderSha256)) { - throw "Refusing to replace unknown webview2-com-sys loader SHA256: $existingLoaderSha256" - } + $installResults = @() + $installResults += Install-LegacyLoader -Destination $loaderDestination -Source $legacyLoader - Set-ItemProperty -LiteralPath $loaderDestination -Name IsReadOnly -Value $false - Copy-Item -LiteralPath $legacyLoader -Destination $loaderDestination -Force + $targetRoot = Join-Path $repositoryRoot "src-tauri\target" + if (Test-Path -LiteralPath $targetRoot -PathType Container) { + $targetLoaders = Get-ChildItem -LiteralPath $targetRoot -Filter "WebView2LoaderStatic.lib" -Recurse -ErrorAction SilentlyContinue | + Where-Object { + ($_.FullName -replace '/', '\') -match '\\build\\webview2-com-sys-[^\\]+\\out\\x64\\WebView2LoaderStatic\.lib$' + } - $installedLoaderSha256 = (Get-FileHash -LiteralPath $loaderDestination -Algorithm SHA256).Hash.ToLowerInvariant() - if ($installedLoaderSha256 -ne $legacyLoaderSha256) { - throw "Windows 7 WebView2 loader replacement failed. Expected $legacyLoaderSha256, got $installedLoaderSha256." + foreach ($targetLoader in $targetLoaders) { + $installResults += Install-LegacyLoader -Destination $targetLoader.FullName -Source $legacyLoader + } } Write-Host "Prepared Windows 7 compatible WebView2 static loader:" Write-Host " SDK version: $sdkVersion" Write-Host " webview2-com-sys: $lockedVersion" - Write-Host " Destination: $loaderDestination" - Write-Host " Loader SHA256: $installedLoaderSha256" + Write-Host " Loader SHA256: $legacyLoaderSha256" + foreach ($result in $installResults) { + Write-Host " Destination: $($result.Path)" + Write-Host " Previous SHA256: $($result.PreviousSha256)" + Write-Host " Installed SHA256: $($result.InstalledSha256)" + } } finally { if (Test-Path -LiteralPath $temporaryRoot) { diff --git a/.github/workflows/windows-7-compat.yml b/.github/workflows/windows-7-compat.yml index a24c7d5b..2f9190b7 100644 --- a/.github/workflows/windows-7-compat.yml +++ b/.github/workflows/windows-7-compat.yml @@ -63,6 +63,22 @@ jobs: env: RUST_CACHE_COMPRESS: true + - name: Enable Win7-only Cargo patches + shell: pwsh + run: | + $ErrorActionPreference = "Stop" + + New-Item -ItemType Directory -Force -Path ".cargo" | Out-Null + @' + [patch.crates-io] + webview2-com-sys = { path = "src-tauri/vendor/webview2-com-sys" } + windows-core = { path = "src-tauri/vendor/windows-core" } + '@ | Set-Content -LiteralPath ".cargo/config.toml" -Encoding UTF8 + + cargo metadata --manifest-path src-tauri/Cargo.toml --format-version 1 | Out-Null + Write-Host "Enabled Win7-only Cargo patches:" + Get-Content -LiteralPath ".cargo/config.toml" + - name: Print build metadata shell: pwsh run: | @@ -264,7 +280,7 @@ jobs: rustToolchain = $env:WIN7_RUST_TOOLCHAIN rustflags = $env:RUSTFLAGS webview2Runtime = "109.0.1518.78" - webview2LoaderSdk = "Microsoft.Web.WebView2 1.0.1054.31" + webview2LoaderSdk = "Microsoft.Web.WebView2 1.0.1020.30" updaterArtifacts = $false win7RuntimeLaunch = "NOT VERIFIED" } @@ -273,6 +289,24 @@ jobs: "path=$installerPath" >> $env:GITHUB_OUTPUT Write-Host "Win7 installer artifact: $installerPath" + - name: Ensure 7-Zip is available + shell: pwsh + run: | + $ErrorActionPreference = "Stop" + + $knownPaths = @( + (Join-Path $env:ProgramFiles "7-Zip\7z.exe"), + (Join-Path ${env:ProgramFiles(x86)} "7-Zip\7z.exe"), + "C:\ProgramData\chocolatey\bin\7z.exe" + ) + + if ((Get-Command 7z.exe -ErrorAction SilentlyContinue) -or ($knownPaths | Where-Object { Test-Path -LiteralPath $_ -PathType Leaf } | Select-Object -First 1)) { + Write-Host "7-Zip is available." + return + } + + choco install 7zip -y --no-progress + - name: Verify Win7 installer content shell: pwsh run: ./.github/scripts/assert-win7-installer-content.ps1 -InstallerPath "${{ steps.installer.outputs.path }}" @@ -283,3 +317,40 @@ jobs: name: nyaterm-windows-7-x64 path: win7-artifacts/* if-no-files-found: error + + modern-windows-regression: + name: Modern Windows x64 regression + runs-on: windows-2022 + + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Install pnpm + uses: pnpm/action-setup@v5 + with: + version: 9 + run_install: false + + - name: Install Node.js + uses: actions/setup-node@v6 + with: + node-version: "20" + cache: pnpm + cache-dependency-path: pnpm-lock.yaml + + - name: Install frontend dependencies + run: pnpm install --frozen-lockfile + + - name: Install stable Rust + uses: dtolnay/rust-toolchain@stable + + - name: Rust cache + uses: swatinem/rust-cache@v2 + with: + workspaces: | + ./src-tauri -> target + key: windows-2022-x86_64-pc-windows-msvc + + - name: Build modern Windows target without bundle + run: pnpm tauri build --target x86_64-pc-windows-msvc --no-bundle --ci diff --git a/src-tauri/.gitignore b/src-tauri/.gitignore index 9f1a0602..b31cdafc 100644 --- a/src-tauri/.gitignore +++ b/src-tauri/.gitignore @@ -2,6 +2,7 @@ # will have compiled files and executables /target/ /crates/*/target/ +/webview2-fixed-runtime/ # Generated by Tauri # will have schema files for capabilities auto-completion diff --git a/src-tauri/vendor/WIN7_PATCHES.md b/src-tauri/vendor/WIN7_PATCHES.md new file mode 100644 index 00000000..5b6ba3a8 --- /dev/null +++ b/src-tauri/vendor/WIN7_PATCHES.md @@ -0,0 +1,29 @@ +# Windows 7 Compatibility Vendor Patches + +This file records dependency patches that are only present because the isolated +`x86_64-win7-windows-msvc` compatibility build found a concrete blocker. + +## windows-core 0.62.2 + +- Source: crates.io `windows-core` 0.62.2. +- Reason: the Win7 PE import audit found `combase.dll` imports from the + `windows 0.62.2` dependency group used by Pageant, SSPI, and IronRDP. +- Patch: link `CoTaskMemAlloc`, `CoTaskMemFree`, and + `CoCreateFreeThreadedMarshaler` from `ole32.dll`, matching the Win7-safe + import library used by `windows-core` 0.61.x. +- Scope: no normal release workflow is changed; this patch is exercised through + Cargo's `[patch.crates-io]` resolution and must remain validated by the + `.github/workflows/windows-7-compat.yml` PE audit. + +## webview2-com-sys 0.38.2 / WebView2 Loader SDK 1.0.1020.30 + +- Source: crates.io `webview2-com-sys` 0.38.2 plus NuGet + `Microsoft.Web.WebView2` 1.0.1020.30 for the x64 static loader. +- Reason: the Win7 PE import audit found `EventSetInformation` in newer + WebView2 static loaders. The original 1.0.1054.31 loader pin still contains + that import; 1.0.1020.30 is the newest stable SDK version checked below that + boundary without the symbol. +- Patch: the crate is vendored so raw Win7 probe builds link the known-good x64 + loader from source. `.github/scripts/prepare-webview2-win7-loader.ps1` also + verifies/reinstalls that loader and replaces already-copied Cargo + `target/**/out/x64` build outputs with the same pinned binary. diff --git a/src-tauri/vendor/webview2-com-sys/.cargo-ok b/src-tauri/vendor/webview2-com-sys/.cargo-ok new file mode 100644 index 00000000..5f8b7958 --- /dev/null +++ b/src-tauri/vendor/webview2-com-sys/.cargo-ok @@ -0,0 +1 @@ +{"v":1} \ No newline at end of file diff --git a/src-tauri/vendor/webview2-com-sys/.cargo_vcs_info.json b/src-tauri/vendor/webview2-com-sys/.cargo_vcs_info.json new file mode 100644 index 00000000..d23451c6 --- /dev/null +++ b/src-tauri/vendor/webview2-com-sys/.cargo_vcs_info.json @@ -0,0 +1,6 @@ +{ + "git": { + "sha1": "b74dc5e2b394044bea5191052868ce7a106c202c" + }, + "path_in_vcs": "crates/bindings" +} \ No newline at end of file diff --git a/src-tauri/vendor/webview2-com-sys/CHANGELOG.md b/src-tauri/vendor/webview2-com-sys/CHANGELOG.md new file mode 100644 index 00000000..8cc19838 --- /dev/null +++ b/src-tauri/vendor/webview2-com-sys/CHANGELOG.md @@ -0,0 +1,20 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [0.38.2](https://github.com/wravery/webview2-rs/compare/webview2-com-sys-v0.38.1...webview2-com-sys-v0.38.2) - 2026-01-07 + +### Other + +- update WebView2 SDK to 1.0.3650.58 + +## [0.38.1](https://github.com/wravery/webview2-rs/compare/webview2-com-sys-v0.38.0...webview2-com-sys-v0.38.1) - 2026-01-07 + +### Added + +- update bindings to 1.0.3351.48 diff --git a/src-tauri/vendor/webview2-com-sys/Cargo.lock b/src-tauri/vendor/webview2-com-sys/Cargo.lock new file mode 100644 index 00000000..171e3042 --- /dev/null +++ b/src-tauri/vendor/webview2-com-sys/Cargo.lock @@ -0,0 +1,168 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "proc-macro2" +version = "1.0.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "syn" +version = "2.0.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "thiserror" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "unicode-ident" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" + +[[package]] +name = "webview2-com-sys" +version = "0.38.2" +dependencies = [ + "thiserror", + "windows", + "windows-core", +] + +[[package]] +name = "windows" +version = "0.61.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5ee8f3d025738cb02bad7868bbb5f8a6327501e870bf51f1b455b0a2454a419" +dependencies = [ + "windows-collections", + "windows-core", + "windows-future", + "windows-link", + "windows-numerics", +] + +[[package]] +name = "windows-collections" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8" +dependencies = [ + "windows-core", +] + +[[package]] +name = "windows-core" +version = "0.61.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4763c1de310c86d75a878046489e2e5ba02c649d185f21c67d4cf8a56d098980" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-future" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a1d6bbefcb7b60acd19828e1bc965da6fcf18a7e39490c5f8be71e54a19ba32" +dependencies = [ + "windows-core", + "windows-link", +] + +[[package]] +name = "windows-implement" +version = "0.60.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.59.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-link" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" + +[[package]] +name = "windows-numerics" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" +dependencies = [ + "windows-core", + "windows-link", +] + +[[package]] +name = "windows-result" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c64fd11a4fd95df68efcfee5f44a294fe71b8bc6a91993e2791938abcc712252" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2ba9642430ee452d5a7aa78d72907ebe8cfda358e8cb7918a2050581322f97" +dependencies = [ + "windows-link", +] diff --git a/src-tauri/vendor/webview2-com-sys/Cargo.toml b/src-tauri/vendor/webview2-com-sys/Cargo.toml new file mode 100644 index 00000000..770e17d5 --- /dev/null +++ b/src-tauri/vendor/webview2-com-sys/Cargo.toml @@ -0,0 +1,62 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO +# +# When uploading crates to the registry Cargo will automatically +# "normalize" Cargo.toml files for maximal compatibility +# with all versions of Cargo and also rewrite `path` dependencies +# to registry (e.g., crates.io) dependencies. +# +# If you are reading this file be aware that the original Cargo.toml +# will likely look very different (and much more reasonable). +# See Cargo.toml.orig for the original contents. + +[package] +edition = "2021" +rust-version = "1.74" +name = "webview2-com-sys" +version = "0.38.2" +build = "build.rs" +autolib = false +autobins = false +autoexamples = false +autotests = false +autobenches = false +description = "Bindings generated with the windows crate for the WebView2 COM APIs" +readme = "README.md" +keywords = [ + "win32", + "webview2", +] +categories = ["os::windows-apis"] +license = "MIT" +repository = "https://github.com/wravery/webview2-rs" + +[package.metadata.docs.rs] +default-target = "x86_64-pc-windows-msvc" +targets = [ + "i686-pc-windows-msvc", + "aarch64-pc-windows-msvc", + "x86_64-pc-windows-gnu", + "i686-pc-windows-gnu", +] + +[lib] +name = "webview2_com_sys" +path = "src/lib.rs" + +[dependencies.windows] +version = "0.61" +features = [ + "Win32_Foundation", + "Win32_Globalization", + "Win32_System_Com", + "Win32_System_Ole", + "Win32_System_Variant", + "Win32_System_WinRT", + "Win32_UI_WindowsAndMessaging", +] + +[dependencies.windows-core] +version = "0.61" + +[build-dependencies.thiserror] +version = "2" diff --git a/src-tauri/vendor/webview2-com-sys/Cargo.toml.orig b/src-tauri/vendor/webview2-com-sys/Cargo.toml.orig new file mode 100644 index 00000000..f229a893 --- /dev/null +++ b/src-tauri/vendor/webview2-com-sys/Cargo.toml.orig @@ -0,0 +1,27 @@ +[package] +name = "webview2-com-sys" +description = "Bindings generated with the windows crate for the WebView2 COM APIs" + +edition.workspace = true +rust-version.workspace = true +repository.workspace = true +license.workspace = true +keywords.workspace = true +categories.workspace = true +version.workspace = true + +[package.metadata.docs.rs] +default-target = "x86_64-pc-windows-msvc" +targets = [ + "i686-pc-windows-msvc", + "aarch64-pc-windows-msvc", + "x86_64-pc-windows-gnu", + "i686-pc-windows-gnu", +] + +[dependencies] +windows-core.workspace = true +windows.workspace = true + +[build-dependencies] +thiserror.workspace = true diff --git a/src-tauri/vendor/webview2-com-sys/README.md b/src-tauri/vendor/webview2-com-sys/README.md new file mode 100644 index 00000000..6d18cdce --- /dev/null +++ b/src-tauri/vendor/webview2-com-sys/README.md @@ -0,0 +1,5 @@ +# webview2-com-sys +This crate implements unsafe Rust bindings for the [WebView2](https://aka.ms/webview2) COM APIs using the [Windows](https://github.com/microsoft/windows-rs) crate. + +## Getting Started +This crate has a friendlier wrapper in [webview2-com](https://crates.io/crates/webview2-com). diff --git a/src-tauri/vendor/webview2-com-sys/arm64/WebView2Loader.dll b/src-tauri/vendor/webview2-com-sys/arm64/WebView2Loader.dll new file mode 100644 index 00000000..de13158d Binary files /dev/null and b/src-tauri/vendor/webview2-com-sys/arm64/WebView2Loader.dll differ diff --git a/src-tauri/vendor/webview2-com-sys/arm64/WebView2Loader.dll.lib b/src-tauri/vendor/webview2-com-sys/arm64/WebView2Loader.dll.lib new file mode 100644 index 00000000..15b5a0ae Binary files /dev/null and b/src-tauri/vendor/webview2-com-sys/arm64/WebView2Loader.dll.lib differ diff --git a/src-tauri/vendor/webview2-com-sys/arm64/WebView2LoaderStatic.lib b/src-tauri/vendor/webview2-com-sys/arm64/WebView2LoaderStatic.lib new file mode 100644 index 00000000..ca112571 Binary files /dev/null and b/src-tauri/vendor/webview2-com-sys/arm64/WebView2LoaderStatic.lib differ diff --git a/src-tauri/vendor/webview2-com-sys/build.rs b/src-tauri/vendor/webview2-com-sys/build.rs new file mode 100644 index 00000000..be3d387b --- /dev/null +++ b/src-tauri/vendor/webview2-com-sys/build.rs @@ -0,0 +1,91 @@ +fn main() -> Result<()> { + webview2_link::update_rustc_flags(webview2_link::output_libs( + webview2_path::get_manifest_dir()?, + webview2_path::get_out_dir()?, + )?)?; + + println!("cargo:rustc-link-lib=advapi32"); + Ok(()) +} + +#[derive(Debug, Error)] +pub enum Error { + #[error(transparent)] + Io(#[from] std::io::Error), + #[error(transparent)] + Var(#[from] std::env::VarError), +} + +pub type Result = std::result::Result; + +#[macro_use] +extern crate thiserror; + +mod webview2_path { + use std::{convert::From, env, path::PathBuf}; + + pub fn get_out_dir() -> super::Result { + Ok(PathBuf::from(env::var("OUT_DIR")?)) + } + + pub fn get_manifest_dir() -> super::Result { + Ok(PathBuf::from(env::var("CARGO_MANIFEST_DIR")?)) + } +} + +mod webview2_link { + use std::{env, path::PathBuf}; + + pub fn output_libs(manifest_dir: PathBuf, out_dir: PathBuf) -> super::Result { + const WEBVIEW2_LIBS: &[&str] = &[ + "WebView2Loader.dll", + "WebView2Loader.dll.lib", + "WebView2LoaderStatic.lib", + ]; + const WEBVIEW2_TARGETS: &[&str] = &["arm64", "x64", "x86"]; + + for target in WEBVIEW2_TARGETS { + for lib in WEBVIEW2_LIBS { + use std::fs; + + let mut lib_src = manifest_dir.clone(); + lib_src.push(target); + lib_src.push(lib); + + let mut lib_dest = out_dir.clone(); + lib_dest.push(target); + if !lib_dest.is_dir() { + fs::create_dir(lib_dest.as_path())?; + } + + lib_dest.push(lib); + eprintln!("Copy from {:?} -> {:?}", lib_src, lib_dest); + fs::copy(lib_src.as_path(), lib_dest.as_path())?; + } + } + + Ok(out_dir) + } + + pub fn update_rustc_flags(lib_path: PathBuf) -> super::Result<()> { + let target_arch = match env::var("CARGO_CFG_TARGET_ARCH")?.as_str() { + "x86_64" => "x64", + "x86" => "x86", + "arm" => "arm", + "aarch64" => "arm64", + unimplemented => unimplemented!( + "`{}` architecture set by `CARGO_CFG_TARGET_ARCH`", + unimplemented + ), + }; + let mut lib_path = lib_path; + lib_path.push(target_arch); + + match lib_path.to_str() { + Some(path) if lib_path.exists() => println!("cargo:rustc-link-search=native={path}"), + _ => unimplemented!("`{}` is not supported by WebView2", target_arch), + }; + + Ok(()) + } +} diff --git a/src-tauri/vendor/webview2-com-sys/src/bindings.rs b/src-tauri/vendor/webview2-com-sys/src/bindings.rs new file mode 100644 index 00000000..bc0b3e74 --- /dev/null +++ b/src-tauri/vendor/webview2-com-sys/src/bindings.rs @@ -0,0 +1,43991 @@ +// Bindings generated by `windows-bindgen` 0.62.1 + +#[inline] +pub unsafe fn CompareBrowserVersions( + version1: P0, + version2: P1, + result: *mut i32, +) -> windows_core::Result<()> +where + P0: windows_core::Param, + P1: windows_core::Param, +{ + windows_link::link!("webview2loader" "system" fn CompareBrowserVersions(version1 : windows_core::PCWSTR, version2 : windows_core::PCWSTR, result : *mut i32) -> windows_core::HRESULT); + unsafe { + CompareBrowserVersions(version1.param().abi(), version2.param().abi(), result as _).ok() + } +} +#[inline] +pub unsafe fn CreateCoreWebView2Environment( + environmentcreatedhandler: P0, +) -> windows_core::Result<()> +where + P0: windows_core::Param, +{ + windows_link::link!("webview2loader" "system" fn CreateCoreWebView2Environment(environmentcreatedhandler : * mut core::ffi::c_void) -> windows_core::HRESULT); + unsafe { CreateCoreWebView2Environment(environmentcreatedhandler.param().abi()).ok() } +} +#[inline] +pub unsafe fn CreateCoreWebView2EnvironmentWithOptions( + browserexecutablefolder: P0, + userdatafolder: P1, + environmentoptions: P2, + environmentcreatedhandler: P3, +) -> windows_core::Result<()> +where + P0: windows_core::Param, + P1: windows_core::Param, + P2: windows_core::Param, + P3: windows_core::Param, +{ + windows_link::link!("webview2loader" "system" fn CreateCoreWebView2EnvironmentWithOptions(browserexecutablefolder : windows_core::PCWSTR, userdatafolder : windows_core::PCWSTR, environmentoptions : * mut core::ffi::c_void, environmentcreatedhandler : * mut core::ffi::c_void) -> windows_core::HRESULT); + unsafe { + CreateCoreWebView2EnvironmentWithOptions( + browserexecutablefolder.param().abi(), + userdatafolder.param().abi(), + environmentoptions.param().abi(), + environmentcreatedhandler.param().abi(), + ) + .ok() + } +} +#[inline] +pub unsafe fn GetAvailableCoreWebView2BrowserVersionString( + browserexecutablefolder: P0, + versioninfo: *mut windows_core::PWSTR, +) -> windows_core::Result<()> +where + P0: windows_core::Param, +{ + windows_link::link!("webview2loader" "system" fn GetAvailableCoreWebView2BrowserVersionString(browserexecutablefolder : windows_core::PCWSTR, versioninfo : *mut windows_core::PWSTR) -> windows_core::HRESULT); + unsafe { + GetAvailableCoreWebView2BrowserVersionString( + browserexecutablefolder.param().abi(), + versioninfo as _, + ) + .ok() + } +} +#[inline] +pub unsafe fn GetAvailableCoreWebView2BrowserVersionStringWithOptions( + browserexecutablefolder: P0, + environmentoptions: P1, + versioninfo: *mut windows_core::PWSTR, +) -> windows_core::Result<()> +where + P0: windows_core::Param, + P1: windows_core::Param, +{ + windows_link::link!("webview2loader" "system" fn GetAvailableCoreWebView2BrowserVersionStringWithOptions(browserexecutablefolder : windows_core::PCWSTR, environmentoptions : * mut core::ffi::c_void, versioninfo : *mut windows_core::PWSTR) -> windows_core::HRESULT); + unsafe { + GetAvailableCoreWebView2BrowserVersionStringWithOptions( + browserexecutablefolder.param().abi(), + environmentoptions.param().abi(), + versioninfo as _, + ) + .ok() + } +} +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_BOUNDS_MODE(pub i32); +pub const COREWEBVIEW2_BOUNDS_MODE_USE_RASTERIZATION_SCALE: COREWEBVIEW2_BOUNDS_MODE = + COREWEBVIEW2_BOUNDS_MODE(1i32); +pub const COREWEBVIEW2_BOUNDS_MODE_USE_RAW_PIXELS: COREWEBVIEW2_BOUNDS_MODE = + COREWEBVIEW2_BOUNDS_MODE(0i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_BROWSER_PROCESS_EXIT_KIND(pub i32); +pub const COREWEBVIEW2_BROWSER_PROCESS_EXIT_KIND_FAILED: COREWEBVIEW2_BROWSER_PROCESS_EXIT_KIND = + COREWEBVIEW2_BROWSER_PROCESS_EXIT_KIND(1i32); +pub const COREWEBVIEW2_BROWSER_PROCESS_EXIT_KIND_NORMAL: COREWEBVIEW2_BROWSER_PROCESS_EXIT_KIND = + COREWEBVIEW2_BROWSER_PROCESS_EXIT_KIND(0i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_BROWSING_DATA_KINDS(pub i32); +impl COREWEBVIEW2_BROWSING_DATA_KINDS { + pub const fn contains(&self, other: Self) -> bool { + self.0 & other.0 == other.0 + } +} +impl core::ops::BitOr for COREWEBVIEW2_BROWSING_DATA_KINDS { + type Output = Self; + fn bitor(self, other: Self) -> Self { + Self(self.0 | other.0) + } +} +impl core::ops::BitAnd for COREWEBVIEW2_BROWSING_DATA_KINDS { + type Output = Self; + fn bitand(self, other: Self) -> Self { + Self(self.0 & other.0) + } +} +impl core::ops::BitOrAssign for COREWEBVIEW2_BROWSING_DATA_KINDS { + fn bitor_assign(&mut self, other: Self) { + self.0.bitor_assign(other.0) + } +} +impl core::ops::BitAndAssign for COREWEBVIEW2_BROWSING_DATA_KINDS { + fn bitand_assign(&mut self, other: Self) { + self.0.bitand_assign(other.0) + } +} +impl core::ops::Not for COREWEBVIEW2_BROWSING_DATA_KINDS { + type Output = Self; + fn not(self) -> Self { + Self(self.0.not()) + } +} +pub const COREWEBVIEW2_BROWSING_DATA_KINDS_ALL_DOM_STORAGE: COREWEBVIEW2_BROWSING_DATA_KINDS = + COREWEBVIEW2_BROWSING_DATA_KINDS(32i32); +pub const COREWEBVIEW2_BROWSING_DATA_KINDS_ALL_PROFILE: COREWEBVIEW2_BROWSING_DATA_KINDS = + COREWEBVIEW2_BROWSING_DATA_KINDS(16384i32); +pub const COREWEBVIEW2_BROWSING_DATA_KINDS_ALL_SITE: COREWEBVIEW2_BROWSING_DATA_KINDS = + COREWEBVIEW2_BROWSING_DATA_KINDS(128i32); +pub const COREWEBVIEW2_BROWSING_DATA_KINDS_BROWSING_HISTORY: COREWEBVIEW2_BROWSING_DATA_KINDS = + COREWEBVIEW2_BROWSING_DATA_KINDS(4096i32); +pub const COREWEBVIEW2_BROWSING_DATA_KINDS_CACHE_STORAGE: COREWEBVIEW2_BROWSING_DATA_KINDS = + COREWEBVIEW2_BROWSING_DATA_KINDS(16i32); +pub const COREWEBVIEW2_BROWSING_DATA_KINDS_COOKIES: COREWEBVIEW2_BROWSING_DATA_KINDS = + COREWEBVIEW2_BROWSING_DATA_KINDS(64i32); +pub const COREWEBVIEW2_BROWSING_DATA_KINDS_DISK_CACHE: COREWEBVIEW2_BROWSING_DATA_KINDS = + COREWEBVIEW2_BROWSING_DATA_KINDS(256i32); +pub const COREWEBVIEW2_BROWSING_DATA_KINDS_DOWNLOAD_HISTORY: COREWEBVIEW2_BROWSING_DATA_KINDS = + COREWEBVIEW2_BROWSING_DATA_KINDS(512i32); +pub const COREWEBVIEW2_BROWSING_DATA_KINDS_FILE_SYSTEMS: COREWEBVIEW2_BROWSING_DATA_KINDS = + COREWEBVIEW2_BROWSING_DATA_KINDS(1i32); +pub const COREWEBVIEW2_BROWSING_DATA_KINDS_GENERAL_AUTOFILL: COREWEBVIEW2_BROWSING_DATA_KINDS = + COREWEBVIEW2_BROWSING_DATA_KINDS(1024i32); +pub const COREWEBVIEW2_BROWSING_DATA_KINDS_INDEXED_DB: COREWEBVIEW2_BROWSING_DATA_KINDS = + COREWEBVIEW2_BROWSING_DATA_KINDS(2i32); +pub const COREWEBVIEW2_BROWSING_DATA_KINDS_LOCAL_STORAGE: COREWEBVIEW2_BROWSING_DATA_KINDS = + COREWEBVIEW2_BROWSING_DATA_KINDS(4i32); +pub const COREWEBVIEW2_BROWSING_DATA_KINDS_PASSWORD_AUTOSAVE: COREWEBVIEW2_BROWSING_DATA_KINDS = + COREWEBVIEW2_BROWSING_DATA_KINDS(2048i32); +pub const COREWEBVIEW2_BROWSING_DATA_KINDS_SERVICE_WORKERS: COREWEBVIEW2_BROWSING_DATA_KINDS = + COREWEBVIEW2_BROWSING_DATA_KINDS(32768i32); +pub const COREWEBVIEW2_BROWSING_DATA_KINDS_SETTINGS: COREWEBVIEW2_BROWSING_DATA_KINDS = + COREWEBVIEW2_BROWSING_DATA_KINDS(8192i32); +pub const COREWEBVIEW2_BROWSING_DATA_KINDS_WEB_SQL: COREWEBVIEW2_BROWSING_DATA_KINDS = + COREWEBVIEW2_BROWSING_DATA_KINDS(8i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_CAPTURE_PREVIEW_IMAGE_FORMAT(pub i32); +pub const COREWEBVIEW2_CAPTURE_PREVIEW_IMAGE_FORMAT_JPEG: + COREWEBVIEW2_CAPTURE_PREVIEW_IMAGE_FORMAT = COREWEBVIEW2_CAPTURE_PREVIEW_IMAGE_FORMAT(1i32); +pub const COREWEBVIEW2_CAPTURE_PREVIEW_IMAGE_FORMAT_PNG: COREWEBVIEW2_CAPTURE_PREVIEW_IMAGE_FORMAT = + COREWEBVIEW2_CAPTURE_PREVIEW_IMAGE_FORMAT(0i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_CHANNEL_SEARCH_KIND(pub i32); +pub const COREWEBVIEW2_CHANNEL_SEARCH_KIND_LEAST_STABLE: COREWEBVIEW2_CHANNEL_SEARCH_KIND = + COREWEBVIEW2_CHANNEL_SEARCH_KIND(1i32); +pub const COREWEBVIEW2_CHANNEL_SEARCH_KIND_MOST_STABLE: COREWEBVIEW2_CHANNEL_SEARCH_KIND = + COREWEBVIEW2_CHANNEL_SEARCH_KIND(0i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_CLIENT_CERTIFICATE_KIND(pub i32); +pub const COREWEBVIEW2_CLIENT_CERTIFICATE_KIND_OTHER: COREWEBVIEW2_CLIENT_CERTIFICATE_KIND = + COREWEBVIEW2_CLIENT_CERTIFICATE_KIND(2i32); +pub const COREWEBVIEW2_CLIENT_CERTIFICATE_KIND_PIN: COREWEBVIEW2_CLIENT_CERTIFICATE_KIND = + COREWEBVIEW2_CLIENT_CERTIFICATE_KIND(1i32); +pub const COREWEBVIEW2_CLIENT_CERTIFICATE_KIND_SMART_CARD: COREWEBVIEW2_CLIENT_CERTIFICATE_KIND = + COREWEBVIEW2_CLIENT_CERTIFICATE_KIND(0i32); +#[repr(C)] +#[derive(Clone, Copy, Debug, Default, PartialEq)] +pub struct COREWEBVIEW2_COLOR { + pub A: u8, + pub R: u8, + pub G: u8, + pub B: u8, +} +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND(pub i32); +pub const COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND_CHECK_BOX: COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND = + COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND(1i32); +pub const COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND_COMMAND: COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND = + COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND(0i32); +pub const COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND_RADIO: COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND = + COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND(2i32); +pub const COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND_SEPARATOR: COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND = + COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND(3i32); +pub const COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND_SUBMENU: COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND = + COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND(4i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_CONTEXT_MENU_TARGET_KIND(pub i32); +pub const COREWEBVIEW2_CONTEXT_MENU_TARGET_KIND_AUDIO: COREWEBVIEW2_CONTEXT_MENU_TARGET_KIND = + COREWEBVIEW2_CONTEXT_MENU_TARGET_KIND(3i32); +pub const COREWEBVIEW2_CONTEXT_MENU_TARGET_KIND_IMAGE: COREWEBVIEW2_CONTEXT_MENU_TARGET_KIND = + COREWEBVIEW2_CONTEXT_MENU_TARGET_KIND(1i32); +pub const COREWEBVIEW2_CONTEXT_MENU_TARGET_KIND_PAGE: COREWEBVIEW2_CONTEXT_MENU_TARGET_KIND = + COREWEBVIEW2_CONTEXT_MENU_TARGET_KIND(0i32); +pub const COREWEBVIEW2_CONTEXT_MENU_TARGET_KIND_SELECTED_TEXT: + COREWEBVIEW2_CONTEXT_MENU_TARGET_KIND = COREWEBVIEW2_CONTEXT_MENU_TARGET_KIND(2i32); +pub const COREWEBVIEW2_CONTEXT_MENU_TARGET_KIND_VIDEO: COREWEBVIEW2_CONTEXT_MENU_TARGET_KIND = + COREWEBVIEW2_CONTEXT_MENU_TARGET_KIND(4i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_COOKIE_SAME_SITE_KIND(pub i32); +pub const COREWEBVIEW2_COOKIE_SAME_SITE_KIND_LAX: COREWEBVIEW2_COOKIE_SAME_SITE_KIND = + COREWEBVIEW2_COOKIE_SAME_SITE_KIND(1i32); +pub const COREWEBVIEW2_COOKIE_SAME_SITE_KIND_NONE: COREWEBVIEW2_COOKIE_SAME_SITE_KIND = + COREWEBVIEW2_COOKIE_SAME_SITE_KIND(0i32); +pub const COREWEBVIEW2_COOKIE_SAME_SITE_KIND_STRICT: COREWEBVIEW2_COOKIE_SAME_SITE_KIND = + COREWEBVIEW2_COOKIE_SAME_SITE_KIND(2i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_DEFAULT_DOWNLOAD_DIALOG_CORNER_ALIGNMENT(pub i32); +pub const COREWEBVIEW2_DEFAULT_DOWNLOAD_DIALOG_CORNER_ALIGNMENT_BOTTOM_LEFT: + COREWEBVIEW2_DEFAULT_DOWNLOAD_DIALOG_CORNER_ALIGNMENT = + COREWEBVIEW2_DEFAULT_DOWNLOAD_DIALOG_CORNER_ALIGNMENT(2i32); +pub const COREWEBVIEW2_DEFAULT_DOWNLOAD_DIALOG_CORNER_ALIGNMENT_BOTTOM_RIGHT: + COREWEBVIEW2_DEFAULT_DOWNLOAD_DIALOG_CORNER_ALIGNMENT = + COREWEBVIEW2_DEFAULT_DOWNLOAD_DIALOG_CORNER_ALIGNMENT(3i32); +pub const COREWEBVIEW2_DEFAULT_DOWNLOAD_DIALOG_CORNER_ALIGNMENT_TOP_LEFT: + COREWEBVIEW2_DEFAULT_DOWNLOAD_DIALOG_CORNER_ALIGNMENT = + COREWEBVIEW2_DEFAULT_DOWNLOAD_DIALOG_CORNER_ALIGNMENT(0i32); +pub const COREWEBVIEW2_DEFAULT_DOWNLOAD_DIALOG_CORNER_ALIGNMENT_TOP_RIGHT: + COREWEBVIEW2_DEFAULT_DOWNLOAD_DIALOG_CORNER_ALIGNMENT = + COREWEBVIEW2_DEFAULT_DOWNLOAD_DIALOG_CORNER_ALIGNMENT(1i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON(pub i32); +pub const COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_DOWNLOAD_PROCESS_CRASHED: + COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON = COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON(29i32); +pub const COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_FILE_ACCESS_DENIED: + COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON = COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON(2i32); +pub const COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_FILE_BLOCKED_BY_POLICY: + COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON = COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON(8i32); +pub const COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_FILE_FAILED: + COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON = COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON(1i32); +pub const COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_FILE_HASH_MISMATCH: + COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON = COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON(11i32); +pub const COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_FILE_MALICIOUS: + COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON = COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON(6i32); +pub const COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_FILE_NAME_TOO_LONG: + COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON = COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON(4i32); +pub const COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_FILE_NO_SPACE: + COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON = COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON(3i32); +pub const COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_FILE_SECURITY_CHECK_FAILED: + COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON = COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON(9i32); +pub const COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_FILE_TOO_LARGE: + COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON = COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON(5i32); +pub const COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_FILE_TOO_SHORT: + COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON = COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON(10i32); +pub const COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_FILE_TRANSIENT_ERROR: + COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON = COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON(7i32); +pub const COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_NETWORK_DISCONNECTED: + COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON = COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON(14i32); +pub const COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_NETWORK_FAILED: + COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON = COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON(12i32); +pub const COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_NETWORK_INVALID_REQUEST: + COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON = COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON(16i32); +pub const COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_NETWORK_SERVER_DOWN: + COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON = COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON(15i32); +pub const COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_NETWORK_TIMEOUT: + COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON = COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON(13i32); +pub const COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_NONE: COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON = + COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON(0i32); +pub const COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_SERVER_BAD_CONTENT: + COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON = COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON(19i32); +pub const COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_SERVER_CERTIFICATE_PROBLEM: + COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON = COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON(21i32); +pub const COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_SERVER_CONTENT_LENGTH_MISMATCH: + COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON = COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON(24i32); +pub const COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_SERVER_CROSS_ORIGIN_REDIRECT: + COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON = COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON(25i32); +pub const COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_SERVER_FAILED: + COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON = COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON(17i32); +pub const COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_SERVER_FORBIDDEN: + COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON = COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON(22i32); +pub const COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_SERVER_NO_RANGE: + COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON = COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON(18i32); +pub const COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_SERVER_UNAUTHORIZED: + COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON = COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON(20i32); +pub const COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_SERVER_UNEXPECTED_RESPONSE: + COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON = COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON(23i32); +pub const COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_USER_CANCELED: + COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON = COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON(26i32); +pub const COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_USER_PAUSED: + COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON = COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON(28i32); +pub const COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON_USER_SHUTDOWN: + COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON = COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON(27i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_DOWNLOAD_STATE(pub i32); +pub const COREWEBVIEW2_DOWNLOAD_STATE_COMPLETED: COREWEBVIEW2_DOWNLOAD_STATE = + COREWEBVIEW2_DOWNLOAD_STATE(2i32); +pub const COREWEBVIEW2_DOWNLOAD_STATE_INTERRUPTED: COREWEBVIEW2_DOWNLOAD_STATE = + COREWEBVIEW2_DOWNLOAD_STATE(1i32); +pub const COREWEBVIEW2_DOWNLOAD_STATE_IN_PROGRESS: COREWEBVIEW2_DOWNLOAD_STATE = + COREWEBVIEW2_DOWNLOAD_STATE(0i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_FAVICON_IMAGE_FORMAT(pub i32); +pub const COREWEBVIEW2_FAVICON_IMAGE_FORMAT_JPEG: COREWEBVIEW2_FAVICON_IMAGE_FORMAT = + COREWEBVIEW2_FAVICON_IMAGE_FORMAT(1i32); +pub const COREWEBVIEW2_FAVICON_IMAGE_FORMAT_PNG: COREWEBVIEW2_FAVICON_IMAGE_FORMAT = + COREWEBVIEW2_FAVICON_IMAGE_FORMAT(0i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_FILE_SYSTEM_HANDLE_KIND(pub i32); +pub const COREWEBVIEW2_FILE_SYSTEM_HANDLE_KIND_DIRECTORY: COREWEBVIEW2_FILE_SYSTEM_HANDLE_KIND = + COREWEBVIEW2_FILE_SYSTEM_HANDLE_KIND(1i32); +pub const COREWEBVIEW2_FILE_SYSTEM_HANDLE_KIND_FILE: COREWEBVIEW2_FILE_SYSTEM_HANDLE_KIND = + COREWEBVIEW2_FILE_SYSTEM_HANDLE_KIND(0i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_FILE_SYSTEM_HANDLE_PERMISSION(pub i32); +pub const COREWEBVIEW2_FILE_SYSTEM_HANDLE_PERMISSION_READ_ONLY: + COREWEBVIEW2_FILE_SYSTEM_HANDLE_PERMISSION = COREWEBVIEW2_FILE_SYSTEM_HANDLE_PERMISSION(0i32); +pub const COREWEBVIEW2_FILE_SYSTEM_HANDLE_PERMISSION_READ_WRITE: + COREWEBVIEW2_FILE_SYSTEM_HANDLE_PERMISSION = COREWEBVIEW2_FILE_SYSTEM_HANDLE_PERMISSION(1i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_FRAME_KIND(pub i32); +pub const COREWEBVIEW2_FRAME_KIND_EMBED: COREWEBVIEW2_FRAME_KIND = COREWEBVIEW2_FRAME_KIND(3i32); +pub const COREWEBVIEW2_FRAME_KIND_IFRAME: COREWEBVIEW2_FRAME_KIND = COREWEBVIEW2_FRAME_KIND(2i32); +pub const COREWEBVIEW2_FRAME_KIND_MAIN_FRAME: COREWEBVIEW2_FRAME_KIND = + COREWEBVIEW2_FRAME_KIND(1i32); +pub const COREWEBVIEW2_FRAME_KIND_OBJECT: COREWEBVIEW2_FRAME_KIND = COREWEBVIEW2_FRAME_KIND(4i32); +pub const COREWEBVIEW2_FRAME_KIND_UNKNOWN: COREWEBVIEW2_FRAME_KIND = COREWEBVIEW2_FRAME_KIND(0i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_HOST_RESOURCE_ACCESS_KIND(pub i32); +pub const COREWEBVIEW2_HOST_RESOURCE_ACCESS_KIND_ALLOW: COREWEBVIEW2_HOST_RESOURCE_ACCESS_KIND = + COREWEBVIEW2_HOST_RESOURCE_ACCESS_KIND(1i32); +pub const COREWEBVIEW2_HOST_RESOURCE_ACCESS_KIND_DENY: COREWEBVIEW2_HOST_RESOURCE_ACCESS_KIND = + COREWEBVIEW2_HOST_RESOURCE_ACCESS_KIND(0i32); +pub const COREWEBVIEW2_HOST_RESOURCE_ACCESS_KIND_DENY_CORS: COREWEBVIEW2_HOST_RESOURCE_ACCESS_KIND = + COREWEBVIEW2_HOST_RESOURCE_ACCESS_KIND(2i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_KEY_EVENT_KIND(pub i32); +pub const COREWEBVIEW2_KEY_EVENT_KIND_KEY_DOWN: COREWEBVIEW2_KEY_EVENT_KIND = + COREWEBVIEW2_KEY_EVENT_KIND(0i32); +pub const COREWEBVIEW2_KEY_EVENT_KIND_KEY_UP: COREWEBVIEW2_KEY_EVENT_KIND = + COREWEBVIEW2_KEY_EVENT_KIND(1i32); +pub const COREWEBVIEW2_KEY_EVENT_KIND_SYSTEM_KEY_DOWN: COREWEBVIEW2_KEY_EVENT_KIND = + COREWEBVIEW2_KEY_EVENT_KIND(2i32); +pub const COREWEBVIEW2_KEY_EVENT_KIND_SYSTEM_KEY_UP: COREWEBVIEW2_KEY_EVENT_KIND = + COREWEBVIEW2_KEY_EVENT_KIND(3i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL(pub i32); +pub const COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL_LOW: COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL = + COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL(1i32); +pub const COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL_NORMAL: COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL = + COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL(0i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_MOUSE_EVENT_KIND(pub i32); +pub const COREWEBVIEW2_MOUSE_EVENT_KIND_HORIZONTAL_WHEEL: COREWEBVIEW2_MOUSE_EVENT_KIND = + COREWEBVIEW2_MOUSE_EVENT_KIND(526i32); +pub const COREWEBVIEW2_MOUSE_EVENT_KIND_LEAVE: COREWEBVIEW2_MOUSE_EVENT_KIND = + COREWEBVIEW2_MOUSE_EVENT_KIND(675i32); +pub const COREWEBVIEW2_MOUSE_EVENT_KIND_LEFT_BUTTON_DOUBLE_CLICK: COREWEBVIEW2_MOUSE_EVENT_KIND = + COREWEBVIEW2_MOUSE_EVENT_KIND(515i32); +pub const COREWEBVIEW2_MOUSE_EVENT_KIND_LEFT_BUTTON_DOWN: COREWEBVIEW2_MOUSE_EVENT_KIND = + COREWEBVIEW2_MOUSE_EVENT_KIND(513i32); +pub const COREWEBVIEW2_MOUSE_EVENT_KIND_LEFT_BUTTON_UP: COREWEBVIEW2_MOUSE_EVENT_KIND = + COREWEBVIEW2_MOUSE_EVENT_KIND(514i32); +pub const COREWEBVIEW2_MOUSE_EVENT_KIND_MIDDLE_BUTTON_DOUBLE_CLICK: COREWEBVIEW2_MOUSE_EVENT_KIND = + COREWEBVIEW2_MOUSE_EVENT_KIND(521i32); +pub const COREWEBVIEW2_MOUSE_EVENT_KIND_MIDDLE_BUTTON_DOWN: COREWEBVIEW2_MOUSE_EVENT_KIND = + COREWEBVIEW2_MOUSE_EVENT_KIND(519i32); +pub const COREWEBVIEW2_MOUSE_EVENT_KIND_MIDDLE_BUTTON_UP: COREWEBVIEW2_MOUSE_EVENT_KIND = + COREWEBVIEW2_MOUSE_EVENT_KIND(520i32); +pub const COREWEBVIEW2_MOUSE_EVENT_KIND_MOVE: COREWEBVIEW2_MOUSE_EVENT_KIND = + COREWEBVIEW2_MOUSE_EVENT_KIND(512i32); +pub const COREWEBVIEW2_MOUSE_EVENT_KIND_NON_CLIENT_RIGHT_BUTTON_DOWN: + COREWEBVIEW2_MOUSE_EVENT_KIND = COREWEBVIEW2_MOUSE_EVENT_KIND(164i32); +pub const COREWEBVIEW2_MOUSE_EVENT_KIND_NON_CLIENT_RIGHT_BUTTON_UP: COREWEBVIEW2_MOUSE_EVENT_KIND = + COREWEBVIEW2_MOUSE_EVENT_KIND(165i32); +pub const COREWEBVIEW2_MOUSE_EVENT_KIND_RIGHT_BUTTON_DOUBLE_CLICK: COREWEBVIEW2_MOUSE_EVENT_KIND = + COREWEBVIEW2_MOUSE_EVENT_KIND(518i32); +pub const COREWEBVIEW2_MOUSE_EVENT_KIND_RIGHT_BUTTON_DOWN: COREWEBVIEW2_MOUSE_EVENT_KIND = + COREWEBVIEW2_MOUSE_EVENT_KIND(516i32); +pub const COREWEBVIEW2_MOUSE_EVENT_KIND_RIGHT_BUTTON_UP: COREWEBVIEW2_MOUSE_EVENT_KIND = + COREWEBVIEW2_MOUSE_EVENT_KIND(517i32); +pub const COREWEBVIEW2_MOUSE_EVENT_KIND_WHEEL: COREWEBVIEW2_MOUSE_EVENT_KIND = + COREWEBVIEW2_MOUSE_EVENT_KIND(522i32); +pub const COREWEBVIEW2_MOUSE_EVENT_KIND_X_BUTTON_DOUBLE_CLICK: COREWEBVIEW2_MOUSE_EVENT_KIND = + COREWEBVIEW2_MOUSE_EVENT_KIND(525i32); +pub const COREWEBVIEW2_MOUSE_EVENT_KIND_X_BUTTON_DOWN: COREWEBVIEW2_MOUSE_EVENT_KIND = + COREWEBVIEW2_MOUSE_EVENT_KIND(523i32); +pub const COREWEBVIEW2_MOUSE_EVENT_KIND_X_BUTTON_UP: COREWEBVIEW2_MOUSE_EVENT_KIND = + COREWEBVIEW2_MOUSE_EVENT_KIND(524i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS(pub i32); +impl COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS { + pub const fn contains(&self, other: Self) -> bool { + self.0 & other.0 == other.0 + } +} +impl core::ops::BitOr for COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS { + type Output = Self; + fn bitor(self, other: Self) -> Self { + Self(self.0 | other.0) + } +} +impl core::ops::BitAnd for COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS { + type Output = Self; + fn bitand(self, other: Self) -> Self { + Self(self.0 & other.0) + } +} +impl core::ops::BitOrAssign for COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS { + fn bitor_assign(&mut self, other: Self) { + self.0.bitor_assign(other.0) + } +} +impl core::ops::BitAndAssign for COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS { + fn bitand_assign(&mut self, other: Self) { + self.0.bitand_assign(other.0) + } +} +impl core::ops::Not for COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS { + type Output = Self; + fn not(self) -> Self { + Self(self.0.not()) + } +} +pub const COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS_CONTROL: COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS = + COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS(8i32); +pub const COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS_LEFT_BUTTON: COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS = + COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS(1i32); +pub const COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS_MIDDLE_BUTTON: + COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS = COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS(16i32); +pub const COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS_NONE: COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS = + COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS(0i32); +pub const COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS_RIGHT_BUTTON: + COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS = COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS(2i32); +pub const COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS_SHIFT: COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS = + COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS(4i32); +pub const COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS_X_BUTTON1: COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS = + COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS(32i32); +pub const COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS_X_BUTTON2: COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS = + COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS(64i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_MOVE_FOCUS_REASON(pub i32); +pub const COREWEBVIEW2_MOVE_FOCUS_REASON_NEXT: COREWEBVIEW2_MOVE_FOCUS_REASON = + COREWEBVIEW2_MOVE_FOCUS_REASON(1i32); +pub const COREWEBVIEW2_MOVE_FOCUS_REASON_PREVIOUS: COREWEBVIEW2_MOVE_FOCUS_REASON = + COREWEBVIEW2_MOVE_FOCUS_REASON(2i32); +pub const COREWEBVIEW2_MOVE_FOCUS_REASON_PROGRAMMATIC: COREWEBVIEW2_MOVE_FOCUS_REASON = + COREWEBVIEW2_MOVE_FOCUS_REASON(0i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_NAVIGATION_KIND(pub i32); +pub const COREWEBVIEW2_NAVIGATION_KIND_BACK_OR_FORWARD: COREWEBVIEW2_NAVIGATION_KIND = + COREWEBVIEW2_NAVIGATION_KIND(1i32); +pub const COREWEBVIEW2_NAVIGATION_KIND_NEW_DOCUMENT: COREWEBVIEW2_NAVIGATION_KIND = + COREWEBVIEW2_NAVIGATION_KIND(2i32); +pub const COREWEBVIEW2_NAVIGATION_KIND_RELOAD: COREWEBVIEW2_NAVIGATION_KIND = + COREWEBVIEW2_NAVIGATION_KIND(0i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_NON_CLIENT_REGION_KIND(pub i32); +pub const COREWEBVIEW2_NON_CLIENT_REGION_KIND_CAPTION: COREWEBVIEW2_NON_CLIENT_REGION_KIND = + COREWEBVIEW2_NON_CLIENT_REGION_KIND(2i32); +pub const COREWEBVIEW2_NON_CLIENT_REGION_KIND_CLIENT: COREWEBVIEW2_NON_CLIENT_REGION_KIND = + COREWEBVIEW2_NON_CLIENT_REGION_KIND(1i32); +pub const COREWEBVIEW2_NON_CLIENT_REGION_KIND_CLOSE: COREWEBVIEW2_NON_CLIENT_REGION_KIND = + COREWEBVIEW2_NON_CLIENT_REGION_KIND(20i32); +pub const COREWEBVIEW2_NON_CLIENT_REGION_KIND_MAXIMIZE: COREWEBVIEW2_NON_CLIENT_REGION_KIND = + COREWEBVIEW2_NON_CLIENT_REGION_KIND(9i32); +pub const COREWEBVIEW2_NON_CLIENT_REGION_KIND_MINIMIZE: COREWEBVIEW2_NON_CLIENT_REGION_KIND = + COREWEBVIEW2_NON_CLIENT_REGION_KIND(8i32); +pub const COREWEBVIEW2_NON_CLIENT_REGION_KIND_NOWHERE: COREWEBVIEW2_NON_CLIENT_REGION_KIND = + COREWEBVIEW2_NON_CLIENT_REGION_KIND(0i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_PDF_TOOLBAR_ITEMS(pub i32); +impl COREWEBVIEW2_PDF_TOOLBAR_ITEMS { + pub const fn contains(&self, other: Self) -> bool { + self.0 & other.0 == other.0 + } +} +impl core::ops::BitOr for COREWEBVIEW2_PDF_TOOLBAR_ITEMS { + type Output = Self; + fn bitor(self, other: Self) -> Self { + Self(self.0 | other.0) + } +} +impl core::ops::BitAnd for COREWEBVIEW2_PDF_TOOLBAR_ITEMS { + type Output = Self; + fn bitand(self, other: Self) -> Self { + Self(self.0 & other.0) + } +} +impl core::ops::BitOrAssign for COREWEBVIEW2_PDF_TOOLBAR_ITEMS { + fn bitor_assign(&mut self, other: Self) { + self.0.bitor_assign(other.0) + } +} +impl core::ops::BitAndAssign for COREWEBVIEW2_PDF_TOOLBAR_ITEMS { + fn bitand_assign(&mut self, other: Self) { + self.0.bitand_assign(other.0) + } +} +impl core::ops::Not for COREWEBVIEW2_PDF_TOOLBAR_ITEMS { + type Output = Self; + fn not(self) -> Self { + Self(self.0.not()) + } +} +pub const COREWEBVIEW2_PDF_TOOLBAR_ITEMS_BOOKMARKS: COREWEBVIEW2_PDF_TOOLBAR_ITEMS = + COREWEBVIEW2_PDF_TOOLBAR_ITEMS(256i32); +pub const COREWEBVIEW2_PDF_TOOLBAR_ITEMS_FIT_PAGE: COREWEBVIEW2_PDF_TOOLBAR_ITEMS = + COREWEBVIEW2_PDF_TOOLBAR_ITEMS(64i32); +pub const COREWEBVIEW2_PDF_TOOLBAR_ITEMS_FULL_SCREEN: COREWEBVIEW2_PDF_TOOLBAR_ITEMS = + COREWEBVIEW2_PDF_TOOLBAR_ITEMS(2048i32); +pub const COREWEBVIEW2_PDF_TOOLBAR_ITEMS_MORE_SETTINGS: COREWEBVIEW2_PDF_TOOLBAR_ITEMS = + COREWEBVIEW2_PDF_TOOLBAR_ITEMS(4096i32); +pub const COREWEBVIEW2_PDF_TOOLBAR_ITEMS_NONE: COREWEBVIEW2_PDF_TOOLBAR_ITEMS = + COREWEBVIEW2_PDF_TOOLBAR_ITEMS(0i32); +pub const COREWEBVIEW2_PDF_TOOLBAR_ITEMS_PAGE_LAYOUT: COREWEBVIEW2_PDF_TOOLBAR_ITEMS = + COREWEBVIEW2_PDF_TOOLBAR_ITEMS(128i32); +pub const COREWEBVIEW2_PDF_TOOLBAR_ITEMS_PAGE_SELECTOR: COREWEBVIEW2_PDF_TOOLBAR_ITEMS = + COREWEBVIEW2_PDF_TOOLBAR_ITEMS(512i32); +pub const COREWEBVIEW2_PDF_TOOLBAR_ITEMS_PRINT: COREWEBVIEW2_PDF_TOOLBAR_ITEMS = + COREWEBVIEW2_PDF_TOOLBAR_ITEMS(2i32); +pub const COREWEBVIEW2_PDF_TOOLBAR_ITEMS_ROTATE: COREWEBVIEW2_PDF_TOOLBAR_ITEMS = + COREWEBVIEW2_PDF_TOOLBAR_ITEMS(32i32); +pub const COREWEBVIEW2_PDF_TOOLBAR_ITEMS_SAVE: COREWEBVIEW2_PDF_TOOLBAR_ITEMS = + COREWEBVIEW2_PDF_TOOLBAR_ITEMS(1i32); +pub const COREWEBVIEW2_PDF_TOOLBAR_ITEMS_SAVE_AS: COREWEBVIEW2_PDF_TOOLBAR_ITEMS = + COREWEBVIEW2_PDF_TOOLBAR_ITEMS(4i32); +pub const COREWEBVIEW2_PDF_TOOLBAR_ITEMS_SEARCH: COREWEBVIEW2_PDF_TOOLBAR_ITEMS = + COREWEBVIEW2_PDF_TOOLBAR_ITEMS(1024i32); +pub const COREWEBVIEW2_PDF_TOOLBAR_ITEMS_ZOOM_IN: COREWEBVIEW2_PDF_TOOLBAR_ITEMS = + COREWEBVIEW2_PDF_TOOLBAR_ITEMS(8i32); +pub const COREWEBVIEW2_PDF_TOOLBAR_ITEMS_ZOOM_OUT: COREWEBVIEW2_PDF_TOOLBAR_ITEMS = + COREWEBVIEW2_PDF_TOOLBAR_ITEMS(16i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_PERMISSION_KIND(pub i32); +pub const COREWEBVIEW2_PERMISSION_KIND_AUTOPLAY: COREWEBVIEW2_PERMISSION_KIND = + COREWEBVIEW2_PERMISSION_KIND(9i32); +pub const COREWEBVIEW2_PERMISSION_KIND_CAMERA: COREWEBVIEW2_PERMISSION_KIND = + COREWEBVIEW2_PERMISSION_KIND(2i32); +pub const COREWEBVIEW2_PERMISSION_KIND_CLIPBOARD_READ: COREWEBVIEW2_PERMISSION_KIND = + COREWEBVIEW2_PERMISSION_KIND(6i32); +pub const COREWEBVIEW2_PERMISSION_KIND_FILE_READ_WRITE: COREWEBVIEW2_PERMISSION_KIND = + COREWEBVIEW2_PERMISSION_KIND(8i32); +pub const COREWEBVIEW2_PERMISSION_KIND_GEOLOCATION: COREWEBVIEW2_PERMISSION_KIND = + COREWEBVIEW2_PERMISSION_KIND(3i32); +pub const COREWEBVIEW2_PERMISSION_KIND_LOCAL_FONTS: COREWEBVIEW2_PERMISSION_KIND = + COREWEBVIEW2_PERMISSION_KIND(10i32); +pub const COREWEBVIEW2_PERMISSION_KIND_MICROPHONE: COREWEBVIEW2_PERMISSION_KIND = + COREWEBVIEW2_PERMISSION_KIND(1i32); +pub const COREWEBVIEW2_PERMISSION_KIND_MIDI_SYSTEM_EXCLUSIVE_MESSAGES: + COREWEBVIEW2_PERMISSION_KIND = COREWEBVIEW2_PERMISSION_KIND(11i32); +pub const COREWEBVIEW2_PERMISSION_KIND_MULTIPLE_AUTOMATIC_DOWNLOADS: COREWEBVIEW2_PERMISSION_KIND = + COREWEBVIEW2_PERMISSION_KIND(7i32); +pub const COREWEBVIEW2_PERMISSION_KIND_NOTIFICATIONS: COREWEBVIEW2_PERMISSION_KIND = + COREWEBVIEW2_PERMISSION_KIND(4i32); +pub const COREWEBVIEW2_PERMISSION_KIND_OTHER_SENSORS: COREWEBVIEW2_PERMISSION_KIND = + COREWEBVIEW2_PERMISSION_KIND(5i32); +pub const COREWEBVIEW2_PERMISSION_KIND_UNKNOWN_PERMISSION: COREWEBVIEW2_PERMISSION_KIND = + COREWEBVIEW2_PERMISSION_KIND(0i32); +pub const COREWEBVIEW2_PERMISSION_KIND_WINDOW_MANAGEMENT: COREWEBVIEW2_PERMISSION_KIND = + COREWEBVIEW2_PERMISSION_KIND(12i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_PERMISSION_STATE(pub i32); +pub const COREWEBVIEW2_PERMISSION_STATE_ALLOW: COREWEBVIEW2_PERMISSION_STATE = + COREWEBVIEW2_PERMISSION_STATE(1i32); +pub const COREWEBVIEW2_PERMISSION_STATE_DEFAULT: COREWEBVIEW2_PERMISSION_STATE = + COREWEBVIEW2_PERMISSION_STATE(0i32); +pub const COREWEBVIEW2_PERMISSION_STATE_DENY: COREWEBVIEW2_PERMISSION_STATE = + COREWEBVIEW2_PERMISSION_STATE(2i32); +#[repr(C)] +#[derive(Clone, Copy, Debug, Default, PartialEq)] +pub struct COREWEBVIEW2_PHYSICAL_KEY_STATUS { + pub RepeatCount: u32, + pub ScanCode: u32, + pub IsExtendedKey: windows_core::BOOL, + pub IsMenuKeyDown: windows_core::BOOL, + pub WasKeyDown: windows_core::BOOL, + pub IsKeyReleased: windows_core::BOOL, +} +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_POINTER_EVENT_KIND(pub i32); +pub const COREWEBVIEW2_POINTER_EVENT_KIND_ACTIVATE: COREWEBVIEW2_POINTER_EVENT_KIND = + COREWEBVIEW2_POINTER_EVENT_KIND(587i32); +pub const COREWEBVIEW2_POINTER_EVENT_KIND_DOWN: COREWEBVIEW2_POINTER_EVENT_KIND = + COREWEBVIEW2_POINTER_EVENT_KIND(582i32); +pub const COREWEBVIEW2_POINTER_EVENT_KIND_ENTER: COREWEBVIEW2_POINTER_EVENT_KIND = + COREWEBVIEW2_POINTER_EVENT_KIND(585i32); +pub const COREWEBVIEW2_POINTER_EVENT_KIND_LEAVE: COREWEBVIEW2_POINTER_EVENT_KIND = + COREWEBVIEW2_POINTER_EVENT_KIND(586i32); +pub const COREWEBVIEW2_POINTER_EVENT_KIND_UP: COREWEBVIEW2_POINTER_EVENT_KIND = + COREWEBVIEW2_POINTER_EVENT_KIND(583i32); +pub const COREWEBVIEW2_POINTER_EVENT_KIND_UPDATE: COREWEBVIEW2_POINTER_EVENT_KIND = + COREWEBVIEW2_POINTER_EVENT_KIND(581i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_PREFERRED_COLOR_SCHEME(pub i32); +pub const COREWEBVIEW2_PREFERRED_COLOR_SCHEME_AUTO: COREWEBVIEW2_PREFERRED_COLOR_SCHEME = + COREWEBVIEW2_PREFERRED_COLOR_SCHEME(0i32); +pub const COREWEBVIEW2_PREFERRED_COLOR_SCHEME_DARK: COREWEBVIEW2_PREFERRED_COLOR_SCHEME = + COREWEBVIEW2_PREFERRED_COLOR_SCHEME(2i32); +pub const COREWEBVIEW2_PREFERRED_COLOR_SCHEME_LIGHT: COREWEBVIEW2_PREFERRED_COLOR_SCHEME = + COREWEBVIEW2_PREFERRED_COLOR_SCHEME(1i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_PRINT_COLLATION(pub i32); +pub const COREWEBVIEW2_PRINT_COLLATION_COLLATED: COREWEBVIEW2_PRINT_COLLATION = + COREWEBVIEW2_PRINT_COLLATION(1i32); +pub const COREWEBVIEW2_PRINT_COLLATION_DEFAULT: COREWEBVIEW2_PRINT_COLLATION = + COREWEBVIEW2_PRINT_COLLATION(0i32); +pub const COREWEBVIEW2_PRINT_COLLATION_UNCOLLATED: COREWEBVIEW2_PRINT_COLLATION = + COREWEBVIEW2_PRINT_COLLATION(2i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_PRINT_COLOR_MODE(pub i32); +pub const COREWEBVIEW2_PRINT_COLOR_MODE_COLOR: COREWEBVIEW2_PRINT_COLOR_MODE = + COREWEBVIEW2_PRINT_COLOR_MODE(1i32); +pub const COREWEBVIEW2_PRINT_COLOR_MODE_DEFAULT: COREWEBVIEW2_PRINT_COLOR_MODE = + COREWEBVIEW2_PRINT_COLOR_MODE(0i32); +pub const COREWEBVIEW2_PRINT_COLOR_MODE_GRAYSCALE: COREWEBVIEW2_PRINT_COLOR_MODE = + COREWEBVIEW2_PRINT_COLOR_MODE(2i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_PRINT_DIALOG_KIND(pub i32); +pub const COREWEBVIEW2_PRINT_DIALOG_KIND_BROWSER: COREWEBVIEW2_PRINT_DIALOG_KIND = + COREWEBVIEW2_PRINT_DIALOG_KIND(0i32); +pub const COREWEBVIEW2_PRINT_DIALOG_KIND_SYSTEM: COREWEBVIEW2_PRINT_DIALOG_KIND = + COREWEBVIEW2_PRINT_DIALOG_KIND(1i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_PRINT_DUPLEX(pub i32); +pub const COREWEBVIEW2_PRINT_DUPLEX_DEFAULT: COREWEBVIEW2_PRINT_DUPLEX = + COREWEBVIEW2_PRINT_DUPLEX(0i32); +pub const COREWEBVIEW2_PRINT_DUPLEX_ONE_SIDED: COREWEBVIEW2_PRINT_DUPLEX = + COREWEBVIEW2_PRINT_DUPLEX(1i32); +pub const COREWEBVIEW2_PRINT_DUPLEX_TWO_SIDED_LONG_EDGE: COREWEBVIEW2_PRINT_DUPLEX = + COREWEBVIEW2_PRINT_DUPLEX(2i32); +pub const COREWEBVIEW2_PRINT_DUPLEX_TWO_SIDED_SHORT_EDGE: COREWEBVIEW2_PRINT_DUPLEX = + COREWEBVIEW2_PRINT_DUPLEX(3i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_PRINT_MEDIA_SIZE(pub i32); +pub const COREWEBVIEW2_PRINT_MEDIA_SIZE_CUSTOM: COREWEBVIEW2_PRINT_MEDIA_SIZE = + COREWEBVIEW2_PRINT_MEDIA_SIZE(1i32); +pub const COREWEBVIEW2_PRINT_MEDIA_SIZE_DEFAULT: COREWEBVIEW2_PRINT_MEDIA_SIZE = + COREWEBVIEW2_PRINT_MEDIA_SIZE(0i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_PRINT_ORIENTATION(pub i32); +pub const COREWEBVIEW2_PRINT_ORIENTATION_LANDSCAPE: COREWEBVIEW2_PRINT_ORIENTATION = + COREWEBVIEW2_PRINT_ORIENTATION(1i32); +pub const COREWEBVIEW2_PRINT_ORIENTATION_PORTRAIT: COREWEBVIEW2_PRINT_ORIENTATION = + COREWEBVIEW2_PRINT_ORIENTATION(0i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_PRINT_STATUS(pub i32); +pub const COREWEBVIEW2_PRINT_STATUS_OTHER_ERROR: COREWEBVIEW2_PRINT_STATUS = + COREWEBVIEW2_PRINT_STATUS(2i32); +pub const COREWEBVIEW2_PRINT_STATUS_PRINTER_UNAVAILABLE: COREWEBVIEW2_PRINT_STATUS = + COREWEBVIEW2_PRINT_STATUS(1i32); +pub const COREWEBVIEW2_PRINT_STATUS_SUCCEEDED: COREWEBVIEW2_PRINT_STATUS = + COREWEBVIEW2_PRINT_STATUS(0i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_PROCESS_FAILED_KIND(pub i32); +pub const COREWEBVIEW2_PROCESS_FAILED_KIND_BROWSER_PROCESS_EXITED: + COREWEBVIEW2_PROCESS_FAILED_KIND = COREWEBVIEW2_PROCESS_FAILED_KIND(0i32); +pub const COREWEBVIEW2_PROCESS_FAILED_KIND_FRAME_RENDER_PROCESS_EXITED: + COREWEBVIEW2_PROCESS_FAILED_KIND = COREWEBVIEW2_PROCESS_FAILED_KIND(3i32); +pub const COREWEBVIEW2_PROCESS_FAILED_KIND_GPU_PROCESS_EXITED: COREWEBVIEW2_PROCESS_FAILED_KIND = + COREWEBVIEW2_PROCESS_FAILED_KIND(6i32); +pub const COREWEBVIEW2_PROCESS_FAILED_KIND_PPAPI_BROKER_PROCESS_EXITED: + COREWEBVIEW2_PROCESS_FAILED_KIND = COREWEBVIEW2_PROCESS_FAILED_KIND(8i32); +pub const COREWEBVIEW2_PROCESS_FAILED_KIND_PPAPI_PLUGIN_PROCESS_EXITED: + COREWEBVIEW2_PROCESS_FAILED_KIND = COREWEBVIEW2_PROCESS_FAILED_KIND(7i32); +pub const COREWEBVIEW2_PROCESS_FAILED_KIND_RENDER_PROCESS_EXITED: COREWEBVIEW2_PROCESS_FAILED_KIND = + COREWEBVIEW2_PROCESS_FAILED_KIND(1i32); +pub const COREWEBVIEW2_PROCESS_FAILED_KIND_RENDER_PROCESS_UNRESPONSIVE: + COREWEBVIEW2_PROCESS_FAILED_KIND = COREWEBVIEW2_PROCESS_FAILED_KIND(2i32); +pub const COREWEBVIEW2_PROCESS_FAILED_KIND_SANDBOX_HELPER_PROCESS_EXITED: + COREWEBVIEW2_PROCESS_FAILED_KIND = COREWEBVIEW2_PROCESS_FAILED_KIND(5i32); +pub const COREWEBVIEW2_PROCESS_FAILED_KIND_UNKNOWN_PROCESS_EXITED: + COREWEBVIEW2_PROCESS_FAILED_KIND = COREWEBVIEW2_PROCESS_FAILED_KIND(9i32); +pub const COREWEBVIEW2_PROCESS_FAILED_KIND_UTILITY_PROCESS_EXITED: + COREWEBVIEW2_PROCESS_FAILED_KIND = COREWEBVIEW2_PROCESS_FAILED_KIND(4i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_PROCESS_FAILED_REASON(pub i32); +pub const COREWEBVIEW2_PROCESS_FAILED_REASON_CRASHED: COREWEBVIEW2_PROCESS_FAILED_REASON = + COREWEBVIEW2_PROCESS_FAILED_REASON(3i32); +pub const COREWEBVIEW2_PROCESS_FAILED_REASON_LAUNCH_FAILED: COREWEBVIEW2_PROCESS_FAILED_REASON = + COREWEBVIEW2_PROCESS_FAILED_REASON(4i32); +pub const COREWEBVIEW2_PROCESS_FAILED_REASON_OUT_OF_MEMORY: COREWEBVIEW2_PROCESS_FAILED_REASON = + COREWEBVIEW2_PROCESS_FAILED_REASON(5i32); +pub const COREWEBVIEW2_PROCESS_FAILED_REASON_PROFILE_DELETED: COREWEBVIEW2_PROCESS_FAILED_REASON = + COREWEBVIEW2_PROCESS_FAILED_REASON(6i32); +pub const COREWEBVIEW2_PROCESS_FAILED_REASON_TERMINATED: COREWEBVIEW2_PROCESS_FAILED_REASON = + COREWEBVIEW2_PROCESS_FAILED_REASON(2i32); +pub const COREWEBVIEW2_PROCESS_FAILED_REASON_UNEXPECTED: COREWEBVIEW2_PROCESS_FAILED_REASON = + COREWEBVIEW2_PROCESS_FAILED_REASON(0i32); +pub const COREWEBVIEW2_PROCESS_FAILED_REASON_UNRESPONSIVE: COREWEBVIEW2_PROCESS_FAILED_REASON = + COREWEBVIEW2_PROCESS_FAILED_REASON(1i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_PROCESS_KIND(pub i32); +pub const COREWEBVIEW2_PROCESS_KIND_BROWSER: COREWEBVIEW2_PROCESS_KIND = + COREWEBVIEW2_PROCESS_KIND(0i32); +pub const COREWEBVIEW2_PROCESS_KIND_GPU: COREWEBVIEW2_PROCESS_KIND = + COREWEBVIEW2_PROCESS_KIND(4i32); +pub const COREWEBVIEW2_PROCESS_KIND_PPAPI_BROKER: COREWEBVIEW2_PROCESS_KIND = + COREWEBVIEW2_PROCESS_KIND(6i32); +pub const COREWEBVIEW2_PROCESS_KIND_PPAPI_PLUGIN: COREWEBVIEW2_PROCESS_KIND = + COREWEBVIEW2_PROCESS_KIND(5i32); +pub const COREWEBVIEW2_PROCESS_KIND_RENDERER: COREWEBVIEW2_PROCESS_KIND = + COREWEBVIEW2_PROCESS_KIND(1i32); +pub const COREWEBVIEW2_PROCESS_KIND_SANDBOX_HELPER: COREWEBVIEW2_PROCESS_KIND = + COREWEBVIEW2_PROCESS_KIND(3i32); +pub const COREWEBVIEW2_PROCESS_KIND_UTILITY: COREWEBVIEW2_PROCESS_KIND = + COREWEBVIEW2_PROCESS_KIND(2i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_RELEASE_CHANNELS(pub i32); +impl COREWEBVIEW2_RELEASE_CHANNELS { + pub const fn contains(&self, other: Self) -> bool { + self.0 & other.0 == other.0 + } +} +impl core::ops::BitOr for COREWEBVIEW2_RELEASE_CHANNELS { + type Output = Self; + fn bitor(self, other: Self) -> Self { + Self(self.0 | other.0) + } +} +impl core::ops::BitAnd for COREWEBVIEW2_RELEASE_CHANNELS { + type Output = Self; + fn bitand(self, other: Self) -> Self { + Self(self.0 & other.0) + } +} +impl core::ops::BitOrAssign for COREWEBVIEW2_RELEASE_CHANNELS { + fn bitor_assign(&mut self, other: Self) { + self.0.bitor_assign(other.0) + } +} +impl core::ops::BitAndAssign for COREWEBVIEW2_RELEASE_CHANNELS { + fn bitand_assign(&mut self, other: Self) { + self.0.bitand_assign(other.0) + } +} +impl core::ops::Not for COREWEBVIEW2_RELEASE_CHANNELS { + type Output = Self; + fn not(self) -> Self { + Self(self.0.not()) + } +} +pub const COREWEBVIEW2_RELEASE_CHANNELS_BETA: COREWEBVIEW2_RELEASE_CHANNELS = + COREWEBVIEW2_RELEASE_CHANNELS(2i32); +pub const COREWEBVIEW2_RELEASE_CHANNELS_CANARY: COREWEBVIEW2_RELEASE_CHANNELS = + COREWEBVIEW2_RELEASE_CHANNELS(8i32); +pub const COREWEBVIEW2_RELEASE_CHANNELS_DEV: COREWEBVIEW2_RELEASE_CHANNELS = + COREWEBVIEW2_RELEASE_CHANNELS(4i32); +pub const COREWEBVIEW2_RELEASE_CHANNELS_NONE: COREWEBVIEW2_RELEASE_CHANNELS = + COREWEBVIEW2_RELEASE_CHANNELS(0i32); +pub const COREWEBVIEW2_RELEASE_CHANNELS_STABLE: COREWEBVIEW2_RELEASE_CHANNELS = + COREWEBVIEW2_RELEASE_CHANNELS(1i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_SAVE_AS_KIND(pub i32); +pub const COREWEBVIEW2_SAVE_AS_KIND_COMPLETE: COREWEBVIEW2_SAVE_AS_KIND = + COREWEBVIEW2_SAVE_AS_KIND(3i32); +pub const COREWEBVIEW2_SAVE_AS_KIND_DEFAULT: COREWEBVIEW2_SAVE_AS_KIND = + COREWEBVIEW2_SAVE_AS_KIND(0i32); +pub const COREWEBVIEW2_SAVE_AS_KIND_HTML_ONLY: COREWEBVIEW2_SAVE_AS_KIND = + COREWEBVIEW2_SAVE_AS_KIND(1i32); +pub const COREWEBVIEW2_SAVE_AS_KIND_SINGLE_FILE: COREWEBVIEW2_SAVE_AS_KIND = + COREWEBVIEW2_SAVE_AS_KIND(2i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_SAVE_AS_UI_RESULT(pub i32); +pub const COREWEBVIEW2_SAVE_AS_UI_RESULT_CANCELLED: COREWEBVIEW2_SAVE_AS_UI_RESULT = + COREWEBVIEW2_SAVE_AS_UI_RESULT(4i32); +pub const COREWEBVIEW2_SAVE_AS_UI_RESULT_FILE_ALREADY_EXISTS: COREWEBVIEW2_SAVE_AS_UI_RESULT = + COREWEBVIEW2_SAVE_AS_UI_RESULT(2i32); +pub const COREWEBVIEW2_SAVE_AS_UI_RESULT_INVALID_PATH: COREWEBVIEW2_SAVE_AS_UI_RESULT = + COREWEBVIEW2_SAVE_AS_UI_RESULT(1i32); +pub const COREWEBVIEW2_SAVE_AS_UI_RESULT_KIND_NOT_SUPPORTED: COREWEBVIEW2_SAVE_AS_UI_RESULT = + COREWEBVIEW2_SAVE_AS_UI_RESULT(3i32); +pub const COREWEBVIEW2_SAVE_AS_UI_RESULT_SUCCESS: COREWEBVIEW2_SAVE_AS_UI_RESULT = + COREWEBVIEW2_SAVE_AS_UI_RESULT(0i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_SCRIPT_DIALOG_KIND(pub i32); +pub const COREWEBVIEW2_SCRIPT_DIALOG_KIND_ALERT: COREWEBVIEW2_SCRIPT_DIALOG_KIND = + COREWEBVIEW2_SCRIPT_DIALOG_KIND(0i32); +pub const COREWEBVIEW2_SCRIPT_DIALOG_KIND_BEFOREUNLOAD: COREWEBVIEW2_SCRIPT_DIALOG_KIND = + COREWEBVIEW2_SCRIPT_DIALOG_KIND(3i32); +pub const COREWEBVIEW2_SCRIPT_DIALOG_KIND_CONFIRM: COREWEBVIEW2_SCRIPT_DIALOG_KIND = + COREWEBVIEW2_SCRIPT_DIALOG_KIND(1i32); +pub const COREWEBVIEW2_SCRIPT_DIALOG_KIND_PROMPT: COREWEBVIEW2_SCRIPT_DIALOG_KIND = + COREWEBVIEW2_SCRIPT_DIALOG_KIND(2i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_SCROLLBAR_STYLE(pub i32); +pub const COREWEBVIEW2_SCROLLBAR_STYLE_DEFAULT: COREWEBVIEW2_SCROLLBAR_STYLE = + COREWEBVIEW2_SCROLLBAR_STYLE(0i32); +pub const COREWEBVIEW2_SCROLLBAR_STYLE_FLUENT_OVERLAY: COREWEBVIEW2_SCROLLBAR_STYLE = + COREWEBVIEW2_SCROLLBAR_STYLE(1i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_SERVER_CERTIFICATE_ERROR_ACTION(pub i32); +pub const COREWEBVIEW2_SERVER_CERTIFICATE_ERROR_ACTION_ALWAYS_ALLOW: + COREWEBVIEW2_SERVER_CERTIFICATE_ERROR_ACTION = + COREWEBVIEW2_SERVER_CERTIFICATE_ERROR_ACTION(0i32); +pub const COREWEBVIEW2_SERVER_CERTIFICATE_ERROR_ACTION_CANCEL: + COREWEBVIEW2_SERVER_CERTIFICATE_ERROR_ACTION = + COREWEBVIEW2_SERVER_CERTIFICATE_ERROR_ACTION(1i32); +pub const COREWEBVIEW2_SERVER_CERTIFICATE_ERROR_ACTION_DEFAULT: + COREWEBVIEW2_SERVER_CERTIFICATE_ERROR_ACTION = + COREWEBVIEW2_SERVER_CERTIFICATE_ERROR_ACTION(2i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_SHARED_BUFFER_ACCESS(pub i32); +pub const COREWEBVIEW2_SHARED_BUFFER_ACCESS_READ_ONLY: COREWEBVIEW2_SHARED_BUFFER_ACCESS = + COREWEBVIEW2_SHARED_BUFFER_ACCESS(0i32); +pub const COREWEBVIEW2_SHARED_BUFFER_ACCESS_READ_WRITE: COREWEBVIEW2_SHARED_BUFFER_ACCESS = + COREWEBVIEW2_SHARED_BUFFER_ACCESS(1i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_TEXT_DIRECTION_KIND(pub i32); +pub const COREWEBVIEW2_TEXT_DIRECTION_KIND_DEFAULT: COREWEBVIEW2_TEXT_DIRECTION_KIND = + COREWEBVIEW2_TEXT_DIRECTION_KIND(0i32); +pub const COREWEBVIEW2_TEXT_DIRECTION_KIND_LEFT_TO_RIGHT: COREWEBVIEW2_TEXT_DIRECTION_KIND = + COREWEBVIEW2_TEXT_DIRECTION_KIND(1i32); +pub const COREWEBVIEW2_TEXT_DIRECTION_KIND_RIGHT_TO_LEFT: COREWEBVIEW2_TEXT_DIRECTION_KIND = + COREWEBVIEW2_TEXT_DIRECTION_KIND(2i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_TRACKING_PREVENTION_LEVEL(pub i32); +pub const COREWEBVIEW2_TRACKING_PREVENTION_LEVEL_BALANCED: COREWEBVIEW2_TRACKING_PREVENTION_LEVEL = + COREWEBVIEW2_TRACKING_PREVENTION_LEVEL(2i32); +pub const COREWEBVIEW2_TRACKING_PREVENTION_LEVEL_BASIC: COREWEBVIEW2_TRACKING_PREVENTION_LEVEL = + COREWEBVIEW2_TRACKING_PREVENTION_LEVEL(1i32); +pub const COREWEBVIEW2_TRACKING_PREVENTION_LEVEL_NONE: COREWEBVIEW2_TRACKING_PREVENTION_LEVEL = + COREWEBVIEW2_TRACKING_PREVENTION_LEVEL(0i32); +pub const COREWEBVIEW2_TRACKING_PREVENTION_LEVEL_STRICT: COREWEBVIEW2_TRACKING_PREVENTION_LEVEL = + COREWEBVIEW2_TRACKING_PREVENTION_LEVEL(3i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_WEB_ERROR_STATUS(pub i32); +pub const COREWEBVIEW2_WEB_ERROR_STATUS_CANNOT_CONNECT: COREWEBVIEW2_WEB_ERROR_STATUS = + COREWEBVIEW2_WEB_ERROR_STATUS(12i32); +pub const COREWEBVIEW2_WEB_ERROR_STATUS_CERTIFICATE_COMMON_NAME_IS_INCORRECT: + COREWEBVIEW2_WEB_ERROR_STATUS = COREWEBVIEW2_WEB_ERROR_STATUS(1i32); +pub const COREWEBVIEW2_WEB_ERROR_STATUS_CERTIFICATE_EXPIRED: COREWEBVIEW2_WEB_ERROR_STATUS = + COREWEBVIEW2_WEB_ERROR_STATUS(2i32); +pub const COREWEBVIEW2_WEB_ERROR_STATUS_CERTIFICATE_IS_INVALID: COREWEBVIEW2_WEB_ERROR_STATUS = + COREWEBVIEW2_WEB_ERROR_STATUS(5i32); +pub const COREWEBVIEW2_WEB_ERROR_STATUS_CERTIFICATE_REVOKED: COREWEBVIEW2_WEB_ERROR_STATUS = + COREWEBVIEW2_WEB_ERROR_STATUS(4i32); +pub const COREWEBVIEW2_WEB_ERROR_STATUS_CLIENT_CERTIFICATE_CONTAINS_ERRORS: + COREWEBVIEW2_WEB_ERROR_STATUS = COREWEBVIEW2_WEB_ERROR_STATUS(3i32); +pub const COREWEBVIEW2_WEB_ERROR_STATUS_CONNECTION_ABORTED: COREWEBVIEW2_WEB_ERROR_STATUS = + COREWEBVIEW2_WEB_ERROR_STATUS(9i32); +pub const COREWEBVIEW2_WEB_ERROR_STATUS_CONNECTION_RESET: COREWEBVIEW2_WEB_ERROR_STATUS = + COREWEBVIEW2_WEB_ERROR_STATUS(10i32); +pub const COREWEBVIEW2_WEB_ERROR_STATUS_DISCONNECTED: COREWEBVIEW2_WEB_ERROR_STATUS = + COREWEBVIEW2_WEB_ERROR_STATUS(11i32); +pub const COREWEBVIEW2_WEB_ERROR_STATUS_ERROR_HTTP_INVALID_SERVER_RESPONSE: + COREWEBVIEW2_WEB_ERROR_STATUS = COREWEBVIEW2_WEB_ERROR_STATUS(8i32); +pub const COREWEBVIEW2_WEB_ERROR_STATUS_HOST_NAME_NOT_RESOLVED: COREWEBVIEW2_WEB_ERROR_STATUS = + COREWEBVIEW2_WEB_ERROR_STATUS(13i32); +pub const COREWEBVIEW2_WEB_ERROR_STATUS_OPERATION_CANCELED: COREWEBVIEW2_WEB_ERROR_STATUS = + COREWEBVIEW2_WEB_ERROR_STATUS(14i32); +pub const COREWEBVIEW2_WEB_ERROR_STATUS_REDIRECT_FAILED: COREWEBVIEW2_WEB_ERROR_STATUS = + COREWEBVIEW2_WEB_ERROR_STATUS(15i32); +pub const COREWEBVIEW2_WEB_ERROR_STATUS_SERVER_UNREACHABLE: COREWEBVIEW2_WEB_ERROR_STATUS = + COREWEBVIEW2_WEB_ERROR_STATUS(6i32); +pub const COREWEBVIEW2_WEB_ERROR_STATUS_TIMEOUT: COREWEBVIEW2_WEB_ERROR_STATUS = + COREWEBVIEW2_WEB_ERROR_STATUS(7i32); +pub const COREWEBVIEW2_WEB_ERROR_STATUS_UNEXPECTED_ERROR: COREWEBVIEW2_WEB_ERROR_STATUS = + COREWEBVIEW2_WEB_ERROR_STATUS(16i32); +pub const COREWEBVIEW2_WEB_ERROR_STATUS_UNKNOWN: COREWEBVIEW2_WEB_ERROR_STATUS = + COREWEBVIEW2_WEB_ERROR_STATUS(0i32); +pub const COREWEBVIEW2_WEB_ERROR_STATUS_VALID_AUTHENTICATION_CREDENTIALS_REQUIRED: + COREWEBVIEW2_WEB_ERROR_STATUS = COREWEBVIEW2_WEB_ERROR_STATUS(17i32); +pub const COREWEBVIEW2_WEB_ERROR_STATUS_VALID_PROXY_AUTHENTICATION_REQUIRED: + COREWEBVIEW2_WEB_ERROR_STATUS = COREWEBVIEW2_WEB_ERROR_STATUS(18i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_WEB_RESOURCE_CONTEXT(pub i32); +pub const COREWEBVIEW2_WEB_RESOURCE_CONTEXT_ALL: COREWEBVIEW2_WEB_RESOURCE_CONTEXT = + COREWEBVIEW2_WEB_RESOURCE_CONTEXT(0i32); +pub const COREWEBVIEW2_WEB_RESOURCE_CONTEXT_CSP_VIOLATION_REPORT: + COREWEBVIEW2_WEB_RESOURCE_CONTEXT = COREWEBVIEW2_WEB_RESOURCE_CONTEXT(15i32); +pub const COREWEBVIEW2_WEB_RESOURCE_CONTEXT_DOCUMENT: COREWEBVIEW2_WEB_RESOURCE_CONTEXT = + COREWEBVIEW2_WEB_RESOURCE_CONTEXT(1i32); +pub const COREWEBVIEW2_WEB_RESOURCE_CONTEXT_EVENT_SOURCE: COREWEBVIEW2_WEB_RESOURCE_CONTEXT = + COREWEBVIEW2_WEB_RESOURCE_CONTEXT(10i32); +pub const COREWEBVIEW2_WEB_RESOURCE_CONTEXT_FETCH: COREWEBVIEW2_WEB_RESOURCE_CONTEXT = + COREWEBVIEW2_WEB_RESOURCE_CONTEXT(8i32); +pub const COREWEBVIEW2_WEB_RESOURCE_CONTEXT_FONT: COREWEBVIEW2_WEB_RESOURCE_CONTEXT = + COREWEBVIEW2_WEB_RESOURCE_CONTEXT(5i32); +pub const COREWEBVIEW2_WEB_RESOURCE_CONTEXT_IMAGE: COREWEBVIEW2_WEB_RESOURCE_CONTEXT = + COREWEBVIEW2_WEB_RESOURCE_CONTEXT(3i32); +pub const COREWEBVIEW2_WEB_RESOURCE_CONTEXT_MANIFEST: COREWEBVIEW2_WEB_RESOURCE_CONTEXT = + COREWEBVIEW2_WEB_RESOURCE_CONTEXT(12i32); +pub const COREWEBVIEW2_WEB_RESOURCE_CONTEXT_MEDIA: COREWEBVIEW2_WEB_RESOURCE_CONTEXT = + COREWEBVIEW2_WEB_RESOURCE_CONTEXT(4i32); +pub const COREWEBVIEW2_WEB_RESOURCE_CONTEXT_OTHER: COREWEBVIEW2_WEB_RESOURCE_CONTEXT = + COREWEBVIEW2_WEB_RESOURCE_CONTEXT(16i32); +pub const COREWEBVIEW2_WEB_RESOURCE_CONTEXT_PING: COREWEBVIEW2_WEB_RESOURCE_CONTEXT = + COREWEBVIEW2_WEB_RESOURCE_CONTEXT(14i32); +pub const COREWEBVIEW2_WEB_RESOURCE_CONTEXT_SCRIPT: COREWEBVIEW2_WEB_RESOURCE_CONTEXT = + COREWEBVIEW2_WEB_RESOURCE_CONTEXT(6i32); +pub const COREWEBVIEW2_WEB_RESOURCE_CONTEXT_SIGNED_EXCHANGE: COREWEBVIEW2_WEB_RESOURCE_CONTEXT = + COREWEBVIEW2_WEB_RESOURCE_CONTEXT(13i32); +pub const COREWEBVIEW2_WEB_RESOURCE_CONTEXT_STYLESHEET: COREWEBVIEW2_WEB_RESOURCE_CONTEXT = + COREWEBVIEW2_WEB_RESOURCE_CONTEXT(2i32); +pub const COREWEBVIEW2_WEB_RESOURCE_CONTEXT_TEXT_TRACK: COREWEBVIEW2_WEB_RESOURCE_CONTEXT = + COREWEBVIEW2_WEB_RESOURCE_CONTEXT(9i32); +pub const COREWEBVIEW2_WEB_RESOURCE_CONTEXT_WEBSOCKET: COREWEBVIEW2_WEB_RESOURCE_CONTEXT = + COREWEBVIEW2_WEB_RESOURCE_CONTEXT(11i32); +pub const COREWEBVIEW2_WEB_RESOURCE_CONTEXT_XML_HTTP_REQUEST: COREWEBVIEW2_WEB_RESOURCE_CONTEXT = + COREWEBVIEW2_WEB_RESOURCE_CONTEXT(7i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS(pub i32); +impl COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS { + pub const fn contains(&self, other: Self) -> bool { + self.0 & other.0 == other.0 + } +} +impl core::ops::BitOr for COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS { + type Output = Self; + fn bitor(self, other: Self) -> Self { + Self(self.0 | other.0) + } +} +impl core::ops::BitAnd for COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS { + type Output = Self; + fn bitand(self, other: Self) -> Self { + Self(self.0 & other.0) + } +} +impl core::ops::BitOrAssign for COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS { + fn bitor_assign(&mut self, other: Self) { + self.0.bitor_assign(other.0) + } +} +impl core::ops::BitAndAssign for COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS { + fn bitand_assign(&mut self, other: Self) { + self.0.bitand_assign(other.0) + } +} +impl core::ops::Not for COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS { + type Output = Self; + fn not(self) -> Self { + Self(self.0.not()) + } +} +pub const COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS_ALL: + COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS = + COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS(-1i32); +pub const COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS_DOCUMENT: + COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS = + COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS(1i32); +pub const COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS_NONE: + COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS = + COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS(0i32); +pub const COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS_SERVICE_WORKER: + COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS = + COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS(4i32); +pub const COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS_SHARED_WORKER: + COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS = + COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS(2i32); +pub const CORE_WEBVIEW_TARGET_PRODUCT_VERSION: windows_core::PCWSTR = + windows_core::w!("143.0.3650.58"); +windows_core::imp::define_interface!( + ICoreWebView2, + ICoreWebView2_Vtbl, + 0x76eceacb_0462_4d94_ac83_423a6793775e +); +windows_core::imp::interface_hierarchy!(ICoreWebView2, windows_core::IUnknown); +impl ICoreWebView2 { + pub unsafe fn Settings(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).Settings)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } + pub unsafe fn Source(&self, uri: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Source)( + windows_core::Interface::as_raw(self), + uri as _, + ) + .ok() + } + } + pub unsafe fn Navigate(&self, uri: P0) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Navigate)( + windows_core::Interface::as_raw(self), + uri.param().abi(), + ) + .ok() + } + } + pub unsafe fn NavigateToString(&self, htmlcontent: P0) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).NavigateToString)( + windows_core::Interface::as_raw(self), + htmlcontent.param().abi(), + ) + .ok() + } + } + pub unsafe fn add_NavigationStarting( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_NavigationStarting)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_NavigationStarting(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_NavigationStarting)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } + pub unsafe fn add_ContentLoading( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_ContentLoading)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_ContentLoading(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_ContentLoading)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } + pub unsafe fn add_SourceChanged( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_SourceChanged)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_SourceChanged(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_SourceChanged)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } + pub unsafe fn add_HistoryChanged( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_HistoryChanged)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_HistoryChanged(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_HistoryChanged)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } + pub unsafe fn add_NavigationCompleted( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_NavigationCompleted)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_NavigationCompleted(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_NavigationCompleted)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } + pub unsafe fn add_FrameNavigationStarting( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_FrameNavigationStarting)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_FrameNavigationStarting(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_FrameNavigationStarting)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } + pub unsafe fn add_FrameNavigationCompleted( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_FrameNavigationCompleted)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_FrameNavigationCompleted(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_FrameNavigationCompleted)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } + pub unsafe fn add_ScriptDialogOpening( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_ScriptDialogOpening)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_ScriptDialogOpening(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_ScriptDialogOpening)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } + pub unsafe fn add_PermissionRequested( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_PermissionRequested)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_PermissionRequested(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_PermissionRequested)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } + pub unsafe fn add_ProcessFailed( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_ProcessFailed)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_ProcessFailed(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_ProcessFailed)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } + pub unsafe fn AddScriptToExecuteOnDocumentCreated( + &self, + javascript: P0, + handler: P1, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).AddScriptToExecuteOnDocumentCreated)( + windows_core::Interface::as_raw(self), + javascript.param().abi(), + handler.param().abi(), + ) + .ok() + } + } + pub unsafe fn RemoveScriptToExecuteOnDocumentCreated( + &self, + id: P0, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).RemoveScriptToExecuteOnDocumentCreated)( + windows_core::Interface::as_raw(self), + id.param().abi(), + ) + .ok() + } + } + pub unsafe fn ExecuteScript( + &self, + javascript: P0, + handler: P1, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).ExecuteScript)( + windows_core::Interface::as_raw(self), + javascript.param().abi(), + handler.param().abi(), + ) + .ok() + } + } + pub unsafe fn CapturePreview( + &self, + imageformat: COREWEBVIEW2_CAPTURE_PREVIEW_IMAGE_FORMAT, + imagestream: P1, + handler: P2, + ) -> windows_core::Result<()> + where + P1: windows_core::Param, + P2: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).CapturePreview)( + windows_core::Interface::as_raw(self), + imageformat, + imagestream.param().abi(), + handler.param().abi(), + ) + .ok() + } + } + pub unsafe fn Reload(&self) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Reload)(windows_core::Interface::as_raw(self)) + .ok() + } + } + pub unsafe fn PostWebMessageAsJson(&self, webmessageasjson: P0) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).PostWebMessageAsJson)( + windows_core::Interface::as_raw(self), + webmessageasjson.param().abi(), + ) + .ok() + } + } + pub unsafe fn PostWebMessageAsString( + &self, + webmessageasstring: P0, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).PostWebMessageAsString)( + windows_core::Interface::as_raw(self), + webmessageasstring.param().abi(), + ) + .ok() + } + } + pub unsafe fn add_WebMessageReceived( + &self, + handler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_WebMessageReceived)( + windows_core::Interface::as_raw(self), + handler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_WebMessageReceived(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_WebMessageReceived)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } + pub unsafe fn CallDevToolsProtocolMethod( + &self, + methodname: P0, + parametersasjson: P1, + handler: P2, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + P2: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).CallDevToolsProtocolMethod)( + windows_core::Interface::as_raw(self), + methodname.param().abi(), + parametersasjson.param().abi(), + handler.param().abi(), + ) + .ok() + } + } + pub unsafe fn BrowserProcessId(&self, value: *mut u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).BrowserProcessId)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn CanGoBack(&self, cangoback: *mut windows_core::BOOL) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).CanGoBack)( + windows_core::Interface::as_raw(self), + cangoback as _, + ) + .ok() + } + } + pub unsafe fn CanGoForward( + &self, + cangoforward: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).CanGoForward)( + windows_core::Interface::as_raw(self), + cangoforward as _, + ) + .ok() + } + } + pub unsafe fn GoBack(&self) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).GoBack)(windows_core::Interface::as_raw(self)) + .ok() + } + } + pub unsafe fn GoForward(&self) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).GoForward)(windows_core::Interface::as_raw(self)) + .ok() + } + } + pub unsafe fn GetDevToolsProtocolEventReceiver( + &self, + eventname: P0, + ) -> windows_core::Result + where + P0: windows_core::Param, + { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).GetDevToolsProtocolEventReceiver)( + windows_core::Interface::as_raw(self), + eventname.param().abi(), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } + pub unsafe fn Stop(&self) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Stop)(windows_core::Interface::as_raw(self)).ok() + } + } + pub unsafe fn add_NewWindowRequested( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_NewWindowRequested)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_NewWindowRequested(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_NewWindowRequested)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } + pub unsafe fn add_DocumentTitleChanged( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_DocumentTitleChanged)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_DocumentTitleChanged(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_DocumentTitleChanged)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } + pub unsafe fn DocumentTitle( + &self, + title: *mut windows_core::PWSTR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).DocumentTitle)( + windows_core::Interface::as_raw(self), + title as _, + ) + .ok() + } + } + pub unsafe fn AddHostObjectToScript( + &self, + name: P0, + object: *mut windows::Win32::System::Variant::VARIANT, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).AddHostObjectToScript)( + windows_core::Interface::as_raw(self), + name.param().abi(), + core::mem::transmute(object), + ) + .ok() + } + } + pub unsafe fn RemoveHostObjectFromScript(&self, name: P0) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).RemoveHostObjectFromScript)( + windows_core::Interface::as_raw(self), + name.param().abi(), + ) + .ok() + } + } + pub unsafe fn OpenDevToolsWindow(&self) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).OpenDevToolsWindow)( + windows_core::Interface::as_raw(self), + ) + .ok() + } + } + pub unsafe fn add_ContainsFullScreenElementChanged( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_ContainsFullScreenElementChanged)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_ContainsFullScreenElementChanged( + &self, + token: i64, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_ContainsFullScreenElementChanged)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } + pub unsafe fn ContainsFullScreenElement( + &self, + containsfullscreenelement: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ContainsFullScreenElement)( + windows_core::Interface::as_raw(self), + containsfullscreenelement as _, + ) + .ok() + } + } + pub unsafe fn add_WebResourceRequested( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_WebResourceRequested)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_WebResourceRequested(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_WebResourceRequested)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } + pub unsafe fn AddWebResourceRequestedFilter( + &self, + uri: P0, + resourcecontext: COREWEBVIEW2_WEB_RESOURCE_CONTEXT, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).AddWebResourceRequestedFilter)( + windows_core::Interface::as_raw(self), + uri.param().abi(), + resourcecontext, + ) + .ok() + } + } + pub unsafe fn RemoveWebResourceRequestedFilter( + &self, + uri: P0, + resourcecontext: COREWEBVIEW2_WEB_RESOURCE_CONTEXT, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).RemoveWebResourceRequestedFilter)( + windows_core::Interface::as_raw(self), + uri.param().abi(), + resourcecontext, + ) + .ok() + } + } + pub unsafe fn add_WindowCloseRequested( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_WindowCloseRequested)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_WindowCloseRequested(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_WindowCloseRequested)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Settings: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub Source: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub Navigate: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + ) -> windows_core::HRESULT, + pub NavigateToString: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + ) -> windows_core::HRESULT, + pub add_NavigationStarting: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_NavigationStarting: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, + pub add_ContentLoading: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_ContentLoading: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, + pub add_SourceChanged: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_SourceChanged: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, + pub add_HistoryChanged: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_HistoryChanged: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, + pub add_NavigationCompleted: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_NavigationCompleted: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, + pub add_FrameNavigationStarting: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_FrameNavigationStarting: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, + pub add_FrameNavigationCompleted: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_FrameNavigationCompleted: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, + pub add_ScriptDialogOpening: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_ScriptDialogOpening: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, + pub add_PermissionRequested: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_PermissionRequested: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, + pub add_ProcessFailed: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_ProcessFailed: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, + pub AddScriptToExecuteOnDocumentCreated: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + *mut core::ffi::c_void, + ) + -> windows_core::HRESULT, + pub RemoveScriptToExecuteOnDocumentCreated: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + ) + -> windows_core::HRESULT, + pub ExecuteScript: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub CapturePreview: unsafe extern "system" fn( + *mut core::ffi::c_void, + COREWEBVIEW2_CAPTURE_PREVIEW_IMAGE_FORMAT, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub Reload: unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT, + pub PostWebMessageAsJson: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + ) -> windows_core::HRESULT, + pub PostWebMessageAsString: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + ) -> windows_core::HRESULT, + pub add_WebMessageReceived: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_WebMessageReceived: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, + pub CallDevToolsProtocolMethod: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + windows_core::PCWSTR, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub BrowserProcessId: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut u32) -> windows_core::HRESULT, + pub CanGoBack: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub CanGoForward: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub GoBack: unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT, + pub GoForward: unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT, + pub GetDevToolsProtocolEventReceiver: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub Stop: unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT, + pub add_NewWindowRequested: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_NewWindowRequested: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, + pub add_DocumentTitleChanged: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_DocumentTitleChanged: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, + pub DocumentTitle: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub AddHostObjectToScript: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + *mut windows::Win32::System::Variant::VARIANT, + ) -> windows_core::HRESULT, + pub RemoveHostObjectFromScript: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + ) -> windows_core::HRESULT, + pub OpenDevToolsWindow: + unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT, + pub add_ContainsFullScreenElementChanged: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) + -> windows_core::HRESULT, + pub remove_ContainsFullScreenElementChanged: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, + pub ContainsFullScreenElement: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub add_WebResourceRequested: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_WebResourceRequested: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, + pub AddWebResourceRequestedFilter: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + COREWEBVIEW2_WEB_RESOURCE_CONTEXT, + ) -> windows_core::HRESULT, + pub RemoveWebResourceRequestedFilter: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + COREWEBVIEW2_WEB_RESOURCE_CONTEXT, + ) -> windows_core::HRESULT, + pub add_WindowCloseRequested: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_WindowCloseRequested: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, +} +pub trait ICoreWebView2_Impl: windows_core::IUnknownImpl { + fn Settings(&self) -> windows_core::Result; + fn Source(&self, uri: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn Navigate(&self, uri: &windows_core::PCWSTR) -> windows_core::Result<()>; + fn NavigateToString(&self, htmlcontent: &windows_core::PCWSTR) -> windows_core::Result<()>; + fn add_NavigationStarting( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2NavigationStartingEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_NavigationStarting(&self, token: i64) -> windows_core::Result<()>; + fn add_ContentLoading( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2ContentLoadingEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_ContentLoading(&self, token: i64) -> windows_core::Result<()>; + fn add_SourceChanged( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2SourceChangedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_SourceChanged(&self, token: i64) -> windows_core::Result<()>; + fn add_HistoryChanged( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2HistoryChangedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_HistoryChanged(&self, token: i64) -> windows_core::Result<()>; + fn add_NavigationCompleted( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2NavigationCompletedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_NavigationCompleted(&self, token: i64) -> windows_core::Result<()>; + fn add_FrameNavigationStarting( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2NavigationStartingEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_FrameNavigationStarting(&self, token: i64) -> windows_core::Result<()>; + fn add_FrameNavigationCompleted( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2NavigationCompletedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_FrameNavigationCompleted(&self, token: i64) -> windows_core::Result<()>; + fn add_ScriptDialogOpening( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2ScriptDialogOpeningEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_ScriptDialogOpening(&self, token: i64) -> windows_core::Result<()>; + fn add_PermissionRequested( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2PermissionRequestedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_PermissionRequested(&self, token: i64) -> windows_core::Result<()>; + fn add_ProcessFailed( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2ProcessFailedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_ProcessFailed(&self, token: i64) -> windows_core::Result<()>; + fn AddScriptToExecuteOnDocumentCreated( + &self, + javascript: &windows_core::PCWSTR, + handler: windows_core::Ref< + '_, + ICoreWebView2AddScriptToExecuteOnDocumentCreatedCompletedHandler, + >, + ) -> windows_core::Result<()>; + fn RemoveScriptToExecuteOnDocumentCreated( + &self, + id: &windows_core::PCWSTR, + ) -> windows_core::Result<()>; + fn ExecuteScript( + &self, + javascript: &windows_core::PCWSTR, + handler: windows_core::Ref<'_, ICoreWebView2ExecuteScriptCompletedHandler>, + ) -> windows_core::Result<()>; + fn CapturePreview( + &self, + imageformat: COREWEBVIEW2_CAPTURE_PREVIEW_IMAGE_FORMAT, + imagestream: windows_core::Ref<'_, windows::Win32::System::Com::IStream>, + handler: windows_core::Ref<'_, ICoreWebView2CapturePreviewCompletedHandler>, + ) -> windows_core::Result<()>; + fn Reload(&self) -> windows_core::Result<()>; + fn PostWebMessageAsJson( + &self, + webmessageasjson: &windows_core::PCWSTR, + ) -> windows_core::Result<()>; + fn PostWebMessageAsString( + &self, + webmessageasstring: &windows_core::PCWSTR, + ) -> windows_core::Result<()>; + fn add_WebMessageReceived( + &self, + handler: windows_core::Ref<'_, ICoreWebView2WebMessageReceivedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_WebMessageReceived(&self, token: i64) -> windows_core::Result<()>; + fn CallDevToolsProtocolMethod( + &self, + methodname: &windows_core::PCWSTR, + parametersasjson: &windows_core::PCWSTR, + handler: windows_core::Ref<'_, ICoreWebView2CallDevToolsProtocolMethodCompletedHandler>, + ) -> windows_core::Result<()>; + fn BrowserProcessId(&self, value: *mut u32) -> windows_core::Result<()>; + fn CanGoBack(&self, cangoback: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn CanGoForward(&self, cangoforward: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn GoBack(&self) -> windows_core::Result<()>; + fn GoForward(&self) -> windows_core::Result<()>; + fn GetDevToolsProtocolEventReceiver( + &self, + eventname: &windows_core::PCWSTR, + ) -> windows_core::Result; + fn Stop(&self) -> windows_core::Result<()>; + fn add_NewWindowRequested( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2NewWindowRequestedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_NewWindowRequested(&self, token: i64) -> windows_core::Result<()>; + fn add_DocumentTitleChanged( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2DocumentTitleChangedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_DocumentTitleChanged(&self, token: i64) -> windows_core::Result<()>; + fn DocumentTitle(&self, title: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn AddHostObjectToScript( + &self, + name: &windows_core::PCWSTR, + object: *mut windows::Win32::System::Variant::VARIANT, + ) -> windows_core::Result<()>; + fn RemoveHostObjectFromScript(&self, name: &windows_core::PCWSTR) -> windows_core::Result<()>; + fn OpenDevToolsWindow(&self) -> windows_core::Result<()>; + fn add_ContainsFullScreenElementChanged( + &self, + eventhandler: windows_core::Ref< + '_, + ICoreWebView2ContainsFullScreenElementChangedEventHandler, + >, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_ContainsFullScreenElementChanged(&self, token: i64) -> windows_core::Result<()>; + fn ContainsFullScreenElement( + &self, + containsfullscreenelement: *mut windows_core::BOOL, + ) -> windows_core::Result<()>; + fn add_WebResourceRequested( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2WebResourceRequestedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_WebResourceRequested(&self, token: i64) -> windows_core::Result<()>; + fn AddWebResourceRequestedFilter( + &self, + uri: &windows_core::PCWSTR, + resourcecontext: COREWEBVIEW2_WEB_RESOURCE_CONTEXT, + ) -> windows_core::Result<()>; + fn RemoveWebResourceRequestedFilter( + &self, + uri: &windows_core::PCWSTR, + resourcecontext: COREWEBVIEW2_WEB_RESOURCE_CONTEXT, + ) -> windows_core::Result<()>; + fn add_WindowCloseRequested( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2WindowCloseRequestedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_WindowCloseRequested(&self, token: i64) -> windows_core::Result<()>; +} +impl ICoreWebView2_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn Settings( + this: *mut core::ffi::c_void, + settings: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2_Impl::Settings(this) { + Ok(ok__) => { + settings.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + unsafe extern "system" fn Source( + this: *mut core::ffi::c_void, + uri: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::Source(this, core::mem::transmute_copy(&uri)).into() + } + } + unsafe extern "system" fn Navigate( + this: *mut core::ffi::c_void, + uri: windows_core::PCWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::Navigate(this, core::mem::transmute(&uri)).into() + } + } + unsafe extern "system" fn NavigateToString< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + htmlcontent: windows_core::PCWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::NavigateToString(this, core::mem::transmute(&htmlcontent)) + .into() + } + } + unsafe extern "system" fn add_NavigationStarting< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::add_NavigationStarting( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_NavigationStarting< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::remove_NavigationStarting( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn add_ContentLoading< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::add_ContentLoading( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_ContentLoading< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::remove_ContentLoading(this, core::mem::transmute_copy(&token)) + .into() + } + } + unsafe extern "system" fn add_SourceChanged< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::add_SourceChanged( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_SourceChanged< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::remove_SourceChanged(this, core::mem::transmute_copy(&token)) + .into() + } + } + unsafe extern "system" fn add_HistoryChanged< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::add_HistoryChanged( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_HistoryChanged< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::remove_HistoryChanged(this, core::mem::transmute_copy(&token)) + .into() + } + } + unsafe extern "system" fn add_NavigationCompleted< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::add_NavigationCompleted( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_NavigationCompleted< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::remove_NavigationCompleted( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn add_FrameNavigationStarting< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::add_FrameNavigationStarting( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_FrameNavigationStarting< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::remove_FrameNavigationStarting( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn add_FrameNavigationCompleted< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::add_FrameNavigationCompleted( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_FrameNavigationCompleted< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::remove_FrameNavigationCompleted( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn add_ScriptDialogOpening< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::add_ScriptDialogOpening( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_ScriptDialogOpening< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::remove_ScriptDialogOpening( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn add_PermissionRequested< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::add_PermissionRequested( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_PermissionRequested< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::remove_PermissionRequested( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn add_ProcessFailed< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::add_ProcessFailed( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_ProcessFailed< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::remove_ProcessFailed(this, core::mem::transmute_copy(&token)) + .into() + } + } + unsafe extern "system" fn AddScriptToExecuteOnDocumentCreated< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + javascript: windows_core::PCWSTR, + handler: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::AddScriptToExecuteOnDocumentCreated( + this, + core::mem::transmute(&javascript), + core::mem::transmute_copy(&handler), + ) + .into() + } + } + unsafe extern "system" fn RemoveScriptToExecuteOnDocumentCreated< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + id: windows_core::PCWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::RemoveScriptToExecuteOnDocumentCreated( + this, + core::mem::transmute(&id), + ) + .into() + } + } + unsafe extern "system" fn ExecuteScript< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + javascript: windows_core::PCWSTR, + handler: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::ExecuteScript( + this, + core::mem::transmute(&javascript), + core::mem::transmute_copy(&handler), + ) + .into() + } + } + unsafe extern "system" fn CapturePreview< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + imageformat: COREWEBVIEW2_CAPTURE_PREVIEW_IMAGE_FORMAT, + imagestream: *mut core::ffi::c_void, + handler: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::CapturePreview( + this, + core::mem::transmute_copy(&imageformat), + core::mem::transmute_copy(&imagestream), + core::mem::transmute_copy(&handler), + ) + .into() + } + } + unsafe extern "system" fn Reload( + this: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::Reload(this).into() + } + } + unsafe extern "system" fn PostWebMessageAsJson< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + webmessageasjson: windows_core::PCWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::PostWebMessageAsJson( + this, + core::mem::transmute(&webmessageasjson), + ) + .into() + } + } + unsafe extern "system" fn PostWebMessageAsString< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + webmessageasstring: windows_core::PCWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::PostWebMessageAsString( + this, + core::mem::transmute(&webmessageasstring), + ) + .into() + } + } + unsafe extern "system" fn add_WebMessageReceived< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + handler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::add_WebMessageReceived( + this, + core::mem::transmute_copy(&handler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_WebMessageReceived< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::remove_WebMessageReceived( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn CallDevToolsProtocolMethod< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + methodname: windows_core::PCWSTR, + parametersasjson: windows_core::PCWSTR, + handler: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::CallDevToolsProtocolMethod( + this, + core::mem::transmute(&methodname), + core::mem::transmute(¶metersasjson), + core::mem::transmute_copy(&handler), + ) + .into() + } + } + unsafe extern "system" fn BrowserProcessId< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::BrowserProcessId(this, core::mem::transmute_copy(&value)).into() + } + } + unsafe extern "system" fn CanGoBack( + this: *mut core::ffi::c_void, + cangoback: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::CanGoBack(this, core::mem::transmute_copy(&cangoback)).into() + } + } + unsafe extern "system" fn CanGoForward< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + cangoforward: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::CanGoForward(this, core::mem::transmute_copy(&cangoforward)) + .into() + } + } + unsafe extern "system" fn GoBack( + this: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::GoBack(this).into() + } + } + unsafe extern "system" fn GoForward( + this: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::GoForward(this).into() + } + } + unsafe extern "system" fn GetDevToolsProtocolEventReceiver< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventname: windows_core::PCWSTR, + receiver: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2_Impl::GetDevToolsProtocolEventReceiver( + this, + core::mem::transmute(&eventname), + ) { + Ok(ok__) => { + receiver.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + unsafe extern "system" fn Stop( + this: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::Stop(this).into() + } + } + unsafe extern "system" fn add_NewWindowRequested< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::add_NewWindowRequested( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_NewWindowRequested< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::remove_NewWindowRequested( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn add_DocumentTitleChanged< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::add_DocumentTitleChanged( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_DocumentTitleChanged< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::remove_DocumentTitleChanged( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn DocumentTitle< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + title: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::DocumentTitle(this, core::mem::transmute_copy(&title)).into() + } + } + unsafe extern "system" fn AddHostObjectToScript< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + name: windows_core::PCWSTR, + object: *mut windows::Win32::System::Variant::VARIANT, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::AddHostObjectToScript( + this, + core::mem::transmute(&name), + core::mem::transmute_copy(&object), + ) + .into() + } + } + unsafe extern "system" fn RemoveHostObjectFromScript< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + name: windows_core::PCWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::RemoveHostObjectFromScript(this, core::mem::transmute(&name)) + .into() + } + } + unsafe extern "system" fn OpenDevToolsWindow< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::OpenDevToolsWindow(this).into() + } + } + unsafe extern "system" fn add_ContainsFullScreenElementChanged< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::add_ContainsFullScreenElementChanged( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_ContainsFullScreenElementChanged< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::remove_ContainsFullScreenElementChanged( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn ContainsFullScreenElement< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + containsfullscreenelement: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::ContainsFullScreenElement( + this, + core::mem::transmute_copy(&containsfullscreenelement), + ) + .into() + } + } + unsafe extern "system" fn add_WebResourceRequested< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::add_WebResourceRequested( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_WebResourceRequested< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::remove_WebResourceRequested( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn AddWebResourceRequestedFilter< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + uri: windows_core::PCWSTR, + resourcecontext: COREWEBVIEW2_WEB_RESOURCE_CONTEXT, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::AddWebResourceRequestedFilter( + this, + core::mem::transmute(&uri), + core::mem::transmute_copy(&resourcecontext), + ) + .into() + } + } + unsafe extern "system" fn RemoveWebResourceRequestedFilter< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + uri: windows_core::PCWSTR, + resourcecontext: COREWEBVIEW2_WEB_RESOURCE_CONTEXT, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::RemoveWebResourceRequestedFilter( + this, + core::mem::transmute(&uri), + core::mem::transmute_copy(&resourcecontext), + ) + .into() + } + } + unsafe extern "system" fn add_WindowCloseRequested< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::add_WindowCloseRequested( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_WindowCloseRequested< + Identity: ICoreWebView2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_Impl::remove_WindowCloseRequested( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Settings: Settings::, + Source: Source::, + Navigate: Navigate::, + NavigateToString: NavigateToString::, + add_NavigationStarting: add_NavigationStarting::, + remove_NavigationStarting: remove_NavigationStarting::, + add_ContentLoading: add_ContentLoading::, + remove_ContentLoading: remove_ContentLoading::, + add_SourceChanged: add_SourceChanged::, + remove_SourceChanged: remove_SourceChanged::, + add_HistoryChanged: add_HistoryChanged::, + remove_HistoryChanged: remove_HistoryChanged::, + add_NavigationCompleted: add_NavigationCompleted::, + remove_NavigationCompleted: remove_NavigationCompleted::, + add_FrameNavigationStarting: add_FrameNavigationStarting::, + remove_FrameNavigationStarting: remove_FrameNavigationStarting::, + add_FrameNavigationCompleted: add_FrameNavigationCompleted::, + remove_FrameNavigationCompleted: remove_FrameNavigationCompleted::, + add_ScriptDialogOpening: add_ScriptDialogOpening::, + remove_ScriptDialogOpening: remove_ScriptDialogOpening::, + add_PermissionRequested: add_PermissionRequested::, + remove_PermissionRequested: remove_PermissionRequested::, + add_ProcessFailed: add_ProcessFailed::, + remove_ProcessFailed: remove_ProcessFailed::, + AddScriptToExecuteOnDocumentCreated: AddScriptToExecuteOnDocumentCreated::< + Identity, + OFFSET, + >, + RemoveScriptToExecuteOnDocumentCreated: RemoveScriptToExecuteOnDocumentCreated::< + Identity, + OFFSET, + >, + ExecuteScript: ExecuteScript::, + CapturePreview: CapturePreview::, + Reload: Reload::, + PostWebMessageAsJson: PostWebMessageAsJson::, + PostWebMessageAsString: PostWebMessageAsString::, + add_WebMessageReceived: add_WebMessageReceived::, + remove_WebMessageReceived: remove_WebMessageReceived::, + CallDevToolsProtocolMethod: CallDevToolsProtocolMethod::, + BrowserProcessId: BrowserProcessId::, + CanGoBack: CanGoBack::, + CanGoForward: CanGoForward::, + GoBack: GoBack::, + GoForward: GoForward::, + GetDevToolsProtocolEventReceiver: GetDevToolsProtocolEventReceiver::, + Stop: Stop::, + add_NewWindowRequested: add_NewWindowRequested::, + remove_NewWindowRequested: remove_NewWindowRequested::, + add_DocumentTitleChanged: add_DocumentTitleChanged::, + remove_DocumentTitleChanged: remove_DocumentTitleChanged::, + DocumentTitle: DocumentTitle::, + AddHostObjectToScript: AddHostObjectToScript::, + RemoveHostObjectFromScript: RemoveHostObjectFromScript::, + OpenDevToolsWindow: OpenDevToolsWindow::, + add_ContainsFullScreenElementChanged: add_ContainsFullScreenElementChanged::< + Identity, + OFFSET, + >, + remove_ContainsFullScreenElementChanged: remove_ContainsFullScreenElementChanged::< + Identity, + OFFSET, + >, + ContainsFullScreenElement: ContainsFullScreenElement::, + add_WebResourceRequested: add_WebResourceRequested::, + remove_WebResourceRequested: remove_WebResourceRequested::, + AddWebResourceRequestedFilter: AddWebResourceRequestedFilter::, + RemoveWebResourceRequestedFilter: RemoveWebResourceRequestedFilter::, + add_WindowCloseRequested: add_WindowCloseRequested::, + remove_WindowCloseRequested: remove_WindowCloseRequested::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2 {} +windows_core::imp::define_interface!( + ICoreWebView2AcceleratorKeyPressedEventArgs, + ICoreWebView2AcceleratorKeyPressedEventArgs_Vtbl, + 0x9f760f8a_fb79_42be_9990_7b56900fa9c7 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2AcceleratorKeyPressedEventArgs, + windows_core::IUnknown +); +impl ICoreWebView2AcceleratorKeyPressedEventArgs { + pub unsafe fn KeyEventKind( + &self, + keyeventkind: *mut COREWEBVIEW2_KEY_EVENT_KIND, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).KeyEventKind)( + windows_core::Interface::as_raw(self), + keyeventkind as _, + ) + .ok() + } + } + pub unsafe fn VirtualKey(&self, virtualkey: *mut u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).VirtualKey)( + windows_core::Interface::as_raw(self), + virtualkey as _, + ) + .ok() + } + } + pub unsafe fn KeyEventLParam(&self, lparam: *mut i32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).KeyEventLParam)( + windows_core::Interface::as_raw(self), + lparam as _, + ) + .ok() + } + } + pub unsafe fn PhysicalKeyStatus( + &self, + physicalkeystatus: *mut COREWEBVIEW2_PHYSICAL_KEY_STATUS, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).PhysicalKeyStatus)( + windows_core::Interface::as_raw(self), + physicalkeystatus as _, + ) + .ok() + } + } + pub unsafe fn Handled(&self, handled: *mut windows_core::BOOL) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Handled)( + windows_core::Interface::as_raw(self), + handled as _, + ) + .ok() + } + } + pub unsafe fn SetHandled(&self, handled: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetHandled)( + windows_core::Interface::as_raw(self), + handled.into(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2AcceleratorKeyPressedEventArgs_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub KeyEventKind: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_KEY_EVENT_KIND, + ) -> windows_core::HRESULT, + pub VirtualKey: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut u32) -> windows_core::HRESULT, + pub KeyEventLParam: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut i32) -> windows_core::HRESULT, + pub PhysicalKeyStatus: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_PHYSICAL_KEY_STATUS, + ) -> windows_core::HRESULT, + pub Handled: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetHandled: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2AcceleratorKeyPressedEventArgs_Impl: windows_core::IUnknownImpl { + fn KeyEventKind( + &self, + keyeventkind: *mut COREWEBVIEW2_KEY_EVENT_KIND, + ) -> windows_core::Result<()>; + fn VirtualKey(&self, virtualkey: *mut u32) -> windows_core::Result<()>; + fn KeyEventLParam(&self, lparam: *mut i32) -> windows_core::Result<()>; + fn PhysicalKeyStatus( + &self, + physicalkeystatus: *mut COREWEBVIEW2_PHYSICAL_KEY_STATUS, + ) -> windows_core::Result<()>; + fn Handled(&self, handled: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn SetHandled(&self, handled: windows_core::BOOL) -> windows_core::Result<()>; +} +impl ICoreWebView2AcceleratorKeyPressedEventArgs_Vtbl { + pub const fn new< + Identity: ICoreWebView2AcceleratorKeyPressedEventArgs_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn KeyEventKind< + Identity: ICoreWebView2AcceleratorKeyPressedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + keyeventkind: *mut COREWEBVIEW2_KEY_EVENT_KIND, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2AcceleratorKeyPressedEventArgs_Impl::KeyEventKind( + this, + core::mem::transmute_copy(&keyeventkind), + ) + .into() + } + } + unsafe extern "system" fn VirtualKey< + Identity: ICoreWebView2AcceleratorKeyPressedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + virtualkey: *mut u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2AcceleratorKeyPressedEventArgs_Impl::VirtualKey( + this, + core::mem::transmute_copy(&virtualkey), + ) + .into() + } + } + unsafe extern "system" fn KeyEventLParam< + Identity: ICoreWebView2AcceleratorKeyPressedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + lparam: *mut i32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2AcceleratorKeyPressedEventArgs_Impl::KeyEventLParam( + this, + core::mem::transmute_copy(&lparam), + ) + .into() + } + } + unsafe extern "system" fn PhysicalKeyStatus< + Identity: ICoreWebView2AcceleratorKeyPressedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + physicalkeystatus: *mut COREWEBVIEW2_PHYSICAL_KEY_STATUS, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2AcceleratorKeyPressedEventArgs_Impl::PhysicalKeyStatus( + this, + core::mem::transmute_copy(&physicalkeystatus), + ) + .into() + } + } + unsafe extern "system" fn Handled< + Identity: ICoreWebView2AcceleratorKeyPressedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + handled: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2AcceleratorKeyPressedEventArgs_Impl::Handled( + this, + core::mem::transmute_copy(&handled), + ) + .into() + } + } + unsafe extern "system" fn SetHandled< + Identity: ICoreWebView2AcceleratorKeyPressedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + handled: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2AcceleratorKeyPressedEventArgs_Impl::SetHandled( + this, + core::mem::transmute_copy(&handled), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + KeyEventKind: KeyEventKind::, + VirtualKey: VirtualKey::, + KeyEventLParam: KeyEventLParam::, + PhysicalKeyStatus: PhysicalKeyStatus::, + Handled: Handled::, + SetHandled: SetHandled::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2AcceleratorKeyPressedEventArgs {} +windows_core::imp::define_interface!( + ICoreWebView2AcceleratorKeyPressedEventArgs2, + ICoreWebView2AcceleratorKeyPressedEventArgs2_Vtbl, + 0x03b2c8c8_7799_4e34_bd66_ed26aa85f2bf +); +impl core::ops::Deref for ICoreWebView2AcceleratorKeyPressedEventArgs2 { + type Target = ICoreWebView2AcceleratorKeyPressedEventArgs; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2AcceleratorKeyPressedEventArgs2, + windows_core::IUnknown, + ICoreWebView2AcceleratorKeyPressedEventArgs +); +impl ICoreWebView2AcceleratorKeyPressedEventArgs2 { + pub unsafe fn IsBrowserAcceleratorKeyEnabled( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).IsBrowserAcceleratorKeyEnabled)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetIsBrowserAcceleratorKeyEnabled( + &self, + value: bool, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetIsBrowserAcceleratorKeyEnabled)( + windows_core::Interface::as_raw(self), + value.into(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2AcceleratorKeyPressedEventArgs2_Vtbl { + pub base__: ICoreWebView2AcceleratorKeyPressedEventArgs_Vtbl, + pub IsBrowserAcceleratorKeyEnabled: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetIsBrowserAcceleratorKeyEnabled: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2AcceleratorKeyPressedEventArgs2_Impl: + ICoreWebView2AcceleratorKeyPressedEventArgs_Impl +{ + fn IsBrowserAcceleratorKeyEnabled( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()>; + fn SetIsBrowserAcceleratorKeyEnabled( + &self, + value: windows_core::BOOL, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2AcceleratorKeyPressedEventArgs2_Vtbl { + pub const fn new< + Identity: ICoreWebView2AcceleratorKeyPressedEventArgs2_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn IsBrowserAcceleratorKeyEnabled< + Identity: ICoreWebView2AcceleratorKeyPressedEventArgs2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2AcceleratorKeyPressedEventArgs2_Impl::IsBrowserAcceleratorKeyEnabled( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetIsBrowserAcceleratorKeyEnabled< + Identity: ICoreWebView2AcceleratorKeyPressedEventArgs2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2AcceleratorKeyPressedEventArgs2_Impl:: SetIsBrowserAcceleratorKeyEnabled ( this , core::mem::transmute_copy ( & value ) , ) . into ( ) + } + } + Self { + base__: ICoreWebView2AcceleratorKeyPressedEventArgs_Vtbl::new::(), + IsBrowserAcceleratorKeyEnabled: IsBrowserAcceleratorKeyEnabled::, + SetIsBrowserAcceleratorKeyEnabled: SetIsBrowserAcceleratorKeyEnabled::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2AcceleratorKeyPressedEventArgs2 {} +windows_core::imp::define_interface!( + ICoreWebView2AcceleratorKeyPressedEventHandler, + ICoreWebView2AcceleratorKeyPressedEventHandler_Vtbl, + 0xb29c7e28_fa79_41a8_8e44_65811c76dcb2 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2AcceleratorKeyPressedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2AcceleratorKeyPressedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2AcceleratorKeyPressedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2AcceleratorKeyPressedEventHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2Controller>, + args: windows_core::Ref<'_, ICoreWebView2AcceleratorKeyPressedEventArgs>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2AcceleratorKeyPressedEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2AcceleratorKeyPressedEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2AcceleratorKeyPressedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2AcceleratorKeyPressedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2AcceleratorKeyPressedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2AddScriptToExecuteOnDocumentCreatedCompletedHandler, + ICoreWebView2AddScriptToExecuteOnDocumentCreatedCompletedHandler_Vtbl, + 0xb99369f3_9b11_47b5_bc6f_8e7895fcea17 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2AddScriptToExecuteOnDocumentCreatedCompletedHandler, + windows_core::IUnknown +); +impl ICoreWebView2AddScriptToExecuteOnDocumentCreatedCompletedHandler { + pub unsafe fn Invoke( + &self, + errorcode: windows_core::HRESULT, + result: P1, + ) -> windows_core::Result<()> + where + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + errorcode, + result.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2AddScriptToExecuteOnDocumentCreatedCompletedHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::HRESULT, + windows_core::PCWSTR, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2AddScriptToExecuteOnDocumentCreatedCompletedHandler_Impl: + windows_core::IUnknownImpl +{ + fn Invoke( + &self, + errorcode: windows_core::HRESULT, + result: &windows_core::PCWSTR, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2AddScriptToExecuteOnDocumentCreatedCompletedHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2AddScriptToExecuteOnDocumentCreatedCompletedHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2AddScriptToExecuteOnDocumentCreatedCompletedHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + errorcode: windows_core::HRESULT, + result: windows_core::PCWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2AddScriptToExecuteOnDocumentCreatedCompletedHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&errorcode), + core::mem::transmute(&result), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == & < ICoreWebView2AddScriptToExecuteOnDocumentCreatedCompletedHandler as windows_core::Interface >::IID + } +} +impl windows_core::RuntimeName + for ICoreWebView2AddScriptToExecuteOnDocumentCreatedCompletedHandler +{ +} +windows_core::imp::define_interface!( + ICoreWebView2BasicAuthenticationRequestedEventArgs, + ICoreWebView2BasicAuthenticationRequestedEventArgs_Vtbl, + 0xef05516f_d897_4f9e_b672_d8e2307a3fb0 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2BasicAuthenticationRequestedEventArgs, + windows_core::IUnknown +); +impl ICoreWebView2BasicAuthenticationRequestedEventArgs { + pub unsafe fn Uri(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Uri)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn Challenge( + &self, + challenge: *mut windows_core::PWSTR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Challenge)( + windows_core::Interface::as_raw(self), + challenge as _, + ) + .ok() + } + } + pub unsafe fn Response( + &self, + ) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).Response)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } + pub unsafe fn Cancel(&self, cancel: *mut windows_core::BOOL) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Cancel)( + windows_core::Interface::as_raw(self), + cancel as _, + ) + .ok() + } + } + pub unsafe fn SetCancel(&self, cancel: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetCancel)( + windows_core::Interface::as_raw(self), + cancel.into(), + ) + .ok() + } + } + pub unsafe fn GetDeferral(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).GetDeferral)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2BasicAuthenticationRequestedEventArgs_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Uri: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub Challenge: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub Response: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub Cancel: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetCancel: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, + pub GetDeferral: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2BasicAuthenticationRequestedEventArgs_Impl: + windows_core::IUnknownImpl +{ + fn Uri(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn Challenge(&self, challenge: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn Response(&self) -> windows_core::Result; + fn Cancel(&self, cancel: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn SetCancel(&self, cancel: windows_core::BOOL) -> windows_core::Result<()>; + fn GetDeferral(&self) -> windows_core::Result; +} +impl ICoreWebView2BasicAuthenticationRequestedEventArgs_Vtbl { + pub const fn new< + Identity: ICoreWebView2BasicAuthenticationRequestedEventArgs_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Uri< + Identity: ICoreWebView2BasicAuthenticationRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2BasicAuthenticationRequestedEventArgs_Impl::Uri( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn Challenge< + Identity: ICoreWebView2BasicAuthenticationRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + challenge: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2BasicAuthenticationRequestedEventArgs_Impl::Challenge( + this, + core::mem::transmute_copy(&challenge), + ) + .into() + } + } + unsafe extern "system" fn Response< + Identity: ICoreWebView2BasicAuthenticationRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + response: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2BasicAuthenticationRequestedEventArgs_Impl::Response(this) { + Ok(ok__) => { + response.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + unsafe extern "system" fn Cancel< + Identity: ICoreWebView2BasicAuthenticationRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + cancel: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2BasicAuthenticationRequestedEventArgs_Impl::Cancel( + this, + core::mem::transmute_copy(&cancel), + ) + .into() + } + } + unsafe extern "system" fn SetCancel< + Identity: ICoreWebView2BasicAuthenticationRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + cancel: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2BasicAuthenticationRequestedEventArgs_Impl::SetCancel( + this, + core::mem::transmute_copy(&cancel), + ) + .into() + } + } + unsafe extern "system" fn GetDeferral< + Identity: ICoreWebView2BasicAuthenticationRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + deferral: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2BasicAuthenticationRequestedEventArgs_Impl::GetDeferral(this) { + Ok(ok__) => { + deferral.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Uri: Uri::, + Challenge: Challenge::, + Response: Response::, + Cancel: Cancel::, + SetCancel: SetCancel::, + GetDeferral: GetDeferral::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2BasicAuthenticationRequestedEventArgs {} +windows_core::imp::define_interface!( + ICoreWebView2BasicAuthenticationRequestedEventHandler, + ICoreWebView2BasicAuthenticationRequestedEventHandler_Vtbl, + 0x58b4d6c2_18d4_497e_b39b_9a96533fa278 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2BasicAuthenticationRequestedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2BasicAuthenticationRequestedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2BasicAuthenticationRequestedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2BasicAuthenticationRequestedEventHandler_Impl: + windows_core::IUnknownImpl +{ + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2>, + args: windows_core::Ref<'_, ICoreWebView2BasicAuthenticationRequestedEventArgs>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2BasicAuthenticationRequestedEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2BasicAuthenticationRequestedEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2BasicAuthenticationRequestedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2BasicAuthenticationRequestedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == & < ICoreWebView2BasicAuthenticationRequestedEventHandler as windows_core::Interface >::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2BasicAuthenticationRequestedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2BasicAuthenticationResponse, + ICoreWebView2BasicAuthenticationResponse_Vtbl, + 0x07023f7d_2d77_4d67_9040_6e7d428c6a40 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2BasicAuthenticationResponse, + windows_core::IUnknown +); +impl ICoreWebView2BasicAuthenticationResponse { + pub unsafe fn UserName(&self, username: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).UserName)( + windows_core::Interface::as_raw(self), + username as _, + ) + .ok() + } + } + pub unsafe fn SetUserName(&self, username: P0) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).SetUserName)( + windows_core::Interface::as_raw(self), + username.param().abi(), + ) + .ok() + } + } + pub unsafe fn Password(&self, password: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Password)( + windows_core::Interface::as_raw(self), + password as _, + ) + .ok() + } + } + pub unsafe fn SetPassword(&self, password: P0) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).SetPassword)( + windows_core::Interface::as_raw(self), + password.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2BasicAuthenticationResponse_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub UserName: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub SetUserName: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + ) -> windows_core::HRESULT, + pub Password: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub SetPassword: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2BasicAuthenticationResponse_Impl: windows_core::IUnknownImpl { + fn UserName(&self, username: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn SetUserName(&self, username: &windows_core::PCWSTR) -> windows_core::Result<()>; + fn Password(&self, password: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn SetPassword(&self, password: &windows_core::PCWSTR) -> windows_core::Result<()>; +} +impl ICoreWebView2BasicAuthenticationResponse_Vtbl { + pub const fn new< + Identity: ICoreWebView2BasicAuthenticationResponse_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn UserName< + Identity: ICoreWebView2BasicAuthenticationResponse_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + username: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2BasicAuthenticationResponse_Impl::UserName( + this, + core::mem::transmute_copy(&username), + ) + .into() + } + } + unsafe extern "system" fn SetUserName< + Identity: ICoreWebView2BasicAuthenticationResponse_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + username: windows_core::PCWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2BasicAuthenticationResponse_Impl::SetUserName( + this, + core::mem::transmute(&username), + ) + .into() + } + } + unsafe extern "system" fn Password< + Identity: ICoreWebView2BasicAuthenticationResponse_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + password: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2BasicAuthenticationResponse_Impl::Password( + this, + core::mem::transmute_copy(&password), + ) + .into() + } + } + unsafe extern "system" fn SetPassword< + Identity: ICoreWebView2BasicAuthenticationResponse_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + password: windows_core::PCWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2BasicAuthenticationResponse_Impl::SetPassword( + this, + core::mem::transmute(&password), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + UserName: UserName::, + SetUserName: SetUserName::, + Password: Password::, + SetPassword: SetPassword::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2BasicAuthenticationResponse {} +windows_core::imp::define_interface!( + ICoreWebView2BrowserExtension, + ICoreWebView2BrowserExtension_Vtbl, + 0x7ef7ffa0_fac5_462c_b189_3d9edbe575da +); +windows_core::imp::interface_hierarchy!(ICoreWebView2BrowserExtension, windows_core::IUnknown); +impl ICoreWebView2BrowserExtension { + pub unsafe fn Id(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Id)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn Name(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Name)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn Remove(&self, handler: P0) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Remove)( + windows_core::Interface::as_raw(self), + handler.param().abi(), + ) + .ok() + } + } + pub unsafe fn IsEnabled(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).IsEnabled)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn Enable(&self, isenabled: bool, handler: P1) -> windows_core::Result<()> + where + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Enable)( + windows_core::Interface::as_raw(self), + isenabled.into(), + handler.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2BrowserExtension_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Id: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub Name: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub Remove: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub IsEnabled: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub Enable: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2BrowserExtension_Impl: windows_core::IUnknownImpl { + fn Id(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn Name(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn Remove( + &self, + handler: windows_core::Ref<'_, ICoreWebView2BrowserExtensionRemoveCompletedHandler>, + ) -> windows_core::Result<()>; + fn IsEnabled(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn Enable( + &self, + isenabled: windows_core::BOOL, + handler: windows_core::Ref<'_, ICoreWebView2BrowserExtensionEnableCompletedHandler>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2BrowserExtension_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn Id< + Identity: ICoreWebView2BrowserExtension_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2BrowserExtension_Impl::Id(this, core::mem::transmute_copy(&value)) + .into() + } + } + unsafe extern "system" fn Name< + Identity: ICoreWebView2BrowserExtension_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2BrowserExtension_Impl::Name(this, core::mem::transmute_copy(&value)) + .into() + } + } + unsafe extern "system" fn Remove< + Identity: ICoreWebView2BrowserExtension_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + handler: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2BrowserExtension_Impl::Remove( + this, + core::mem::transmute_copy(&handler), + ) + .into() + } + } + unsafe extern "system" fn IsEnabled< + Identity: ICoreWebView2BrowserExtension_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2BrowserExtension_Impl::IsEnabled( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn Enable< + Identity: ICoreWebView2BrowserExtension_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + isenabled: windows_core::BOOL, + handler: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2BrowserExtension_Impl::Enable( + this, + core::mem::transmute_copy(&isenabled), + core::mem::transmute_copy(&handler), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Id: Id::, + Name: Name::, + Remove: Remove::, + IsEnabled: IsEnabled::, + Enable: Enable::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2BrowserExtension {} +windows_core::imp::define_interface!( + ICoreWebView2BrowserExtensionEnableCompletedHandler, + ICoreWebView2BrowserExtensionEnableCompletedHandler_Vtbl, + 0x30c186ce_7fad_421f_a3bc_a8eaf071ddb8 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2BrowserExtensionEnableCompletedHandler, + windows_core::IUnknown +); +impl ICoreWebView2BrowserExtensionEnableCompletedHandler { + pub unsafe fn Invoke(&self, errorcode: windows_core::HRESULT) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + errorcode, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2BrowserExtensionEnableCompletedHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::HRESULT, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2BrowserExtensionEnableCompletedHandler_Impl: + windows_core::IUnknownImpl +{ + fn Invoke(&self, errorcode: windows_core::HRESULT) -> windows_core::Result<()>; +} +impl ICoreWebView2BrowserExtensionEnableCompletedHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2BrowserExtensionEnableCompletedHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2BrowserExtensionEnableCompletedHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + errorcode: windows_core::HRESULT, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2BrowserExtensionEnableCompletedHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&errorcode), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == & < ICoreWebView2BrowserExtensionEnableCompletedHandler as windows_core::Interface >::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2BrowserExtensionEnableCompletedHandler {} +windows_core::imp::define_interface!( + ICoreWebView2BrowserExtensionList, + ICoreWebView2BrowserExtensionList_Vtbl, + 0x2ef3d2dc_bd5f_4f4d_90af_fd67798f0c2f +); +windows_core::imp::interface_hierarchy!(ICoreWebView2BrowserExtensionList, windows_core::IUnknown); +impl ICoreWebView2BrowserExtensionList { + pub unsafe fn Count(&self, value: *mut u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Count)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn GetValueAtIndex( + &self, + index: u32, + ) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).GetValueAtIndex)( + windows_core::Interface::as_raw(self), + index, + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2BrowserExtensionList_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Count: unsafe extern "system" fn(*mut core::ffi::c_void, *mut u32) -> windows_core::HRESULT, + pub GetValueAtIndex: unsafe extern "system" fn( + *mut core::ffi::c_void, + u32, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2BrowserExtensionList_Impl: windows_core::IUnknownImpl { + fn Count(&self, value: *mut u32) -> windows_core::Result<()>; + fn GetValueAtIndex(&self, index: u32) -> windows_core::Result; +} +impl ICoreWebView2BrowserExtensionList_Vtbl { + pub const fn new() -> Self + { + unsafe extern "system" fn Count< + Identity: ICoreWebView2BrowserExtensionList_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2BrowserExtensionList_Impl::Count( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn GetValueAtIndex< + Identity: ICoreWebView2BrowserExtensionList_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + index: u32, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2BrowserExtensionList_Impl::GetValueAtIndex( + this, + core::mem::transmute_copy(&index), + ) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Count: Count::, + GetValueAtIndex: GetValueAtIndex::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2BrowserExtensionList {} +windows_core::imp::define_interface!( + ICoreWebView2BrowserExtensionRemoveCompletedHandler, + ICoreWebView2BrowserExtensionRemoveCompletedHandler_Vtbl, + 0x8e41909a_9b18_4bb1_8cdf_930f467a50be +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2BrowserExtensionRemoveCompletedHandler, + windows_core::IUnknown +); +impl ICoreWebView2BrowserExtensionRemoveCompletedHandler { + pub unsafe fn Invoke(&self, errorcode: windows_core::HRESULT) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + errorcode, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2BrowserExtensionRemoveCompletedHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::HRESULT, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2BrowserExtensionRemoveCompletedHandler_Impl: + windows_core::IUnknownImpl +{ + fn Invoke(&self, errorcode: windows_core::HRESULT) -> windows_core::Result<()>; +} +impl ICoreWebView2BrowserExtensionRemoveCompletedHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2BrowserExtensionRemoveCompletedHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2BrowserExtensionRemoveCompletedHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + errorcode: windows_core::HRESULT, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2BrowserExtensionRemoveCompletedHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&errorcode), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == & < ICoreWebView2BrowserExtensionRemoveCompletedHandler as windows_core::Interface >::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2BrowserExtensionRemoveCompletedHandler {} +windows_core::imp::define_interface!( + ICoreWebView2BrowserProcessExitedEventArgs, + ICoreWebView2BrowserProcessExitedEventArgs_Vtbl, + 0x1f00663f_af8c_4782_9cdd_dd01c52e34cb +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2BrowserProcessExitedEventArgs, + windows_core::IUnknown +); +impl ICoreWebView2BrowserProcessExitedEventArgs { + pub unsafe fn BrowserProcessExitKind( + &self, + value: *mut COREWEBVIEW2_BROWSER_PROCESS_EXIT_KIND, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).BrowserProcessExitKind)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn BrowserProcessId(&self, value: *mut u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).BrowserProcessId)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2BrowserProcessExitedEventArgs_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub BrowserProcessExitKind: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_BROWSER_PROCESS_EXIT_KIND, + ) -> windows_core::HRESULT, + pub BrowserProcessId: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut u32) -> windows_core::HRESULT, +} +pub trait ICoreWebView2BrowserProcessExitedEventArgs_Impl: windows_core::IUnknownImpl { + fn BrowserProcessExitKind( + &self, + value: *mut COREWEBVIEW2_BROWSER_PROCESS_EXIT_KIND, + ) -> windows_core::Result<()>; + fn BrowserProcessId(&self, value: *mut u32) -> windows_core::Result<()>; +} +impl ICoreWebView2BrowserProcessExitedEventArgs_Vtbl { + pub const fn new< + Identity: ICoreWebView2BrowserProcessExitedEventArgs_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn BrowserProcessExitKind< + Identity: ICoreWebView2BrowserProcessExitedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut COREWEBVIEW2_BROWSER_PROCESS_EXIT_KIND, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2BrowserProcessExitedEventArgs_Impl::BrowserProcessExitKind( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn BrowserProcessId< + Identity: ICoreWebView2BrowserProcessExitedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2BrowserProcessExitedEventArgs_Impl::BrowserProcessId( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + BrowserProcessExitKind: BrowserProcessExitKind::, + BrowserProcessId: BrowserProcessId::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2BrowserProcessExitedEventArgs {} +windows_core::imp::define_interface!( + ICoreWebView2BrowserProcessExitedEventHandler, + ICoreWebView2BrowserProcessExitedEventHandler_Vtbl, + 0xfa504257_a216_4911_a860_fe8825712861 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2BrowserProcessExitedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2BrowserProcessExitedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2BrowserProcessExitedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2BrowserProcessExitedEventHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2Environment>, + args: windows_core::Ref<'_, ICoreWebView2BrowserProcessExitedEventArgs>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2BrowserProcessExitedEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2BrowserProcessExitedEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2BrowserProcessExitedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2BrowserProcessExitedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2BrowserProcessExitedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2BytesReceivedChangedEventHandler, + ICoreWebView2BytesReceivedChangedEventHandler_Vtbl, + 0x828e8ab6_d94c_4264_9cef_5217170d6251 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2BytesReceivedChangedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2BytesReceivedChangedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2BytesReceivedChangedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2BytesReceivedChangedEventHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2DownloadOperation>, + args: windows_core::Ref<'_, windows_core::IUnknown>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2BytesReceivedChangedEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2BytesReceivedChangedEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2BytesReceivedChangedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2BytesReceivedChangedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2BytesReceivedChangedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2CallDevToolsProtocolMethodCompletedHandler, + ICoreWebView2CallDevToolsProtocolMethodCompletedHandler_Vtbl, + 0x5c4889f0_5ef6_4c5a_952c_d8f1b92d0574 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2CallDevToolsProtocolMethodCompletedHandler, + windows_core::IUnknown +); +impl ICoreWebView2CallDevToolsProtocolMethodCompletedHandler { + pub unsafe fn Invoke( + &self, + errorcode: windows_core::HRESULT, + result: P1, + ) -> windows_core::Result<()> + where + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + errorcode, + result.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2CallDevToolsProtocolMethodCompletedHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::HRESULT, + windows_core::PCWSTR, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2CallDevToolsProtocolMethodCompletedHandler_Impl: + windows_core::IUnknownImpl +{ + fn Invoke( + &self, + errorcode: windows_core::HRESULT, + result: &windows_core::PCWSTR, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2CallDevToolsProtocolMethodCompletedHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2CallDevToolsProtocolMethodCompletedHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2CallDevToolsProtocolMethodCompletedHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + errorcode: windows_core::HRESULT, + result: windows_core::PCWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2CallDevToolsProtocolMethodCompletedHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&errorcode), + core::mem::transmute(&result), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == & < ICoreWebView2CallDevToolsProtocolMethodCompletedHandler as windows_core::Interface >::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2CallDevToolsProtocolMethodCompletedHandler {} +windows_core::imp::define_interface!( + ICoreWebView2CapturePreviewCompletedHandler, + ICoreWebView2CapturePreviewCompletedHandler_Vtbl, + 0x697e05e9_3d8f_45fa_96f4_8ffe1ededaf5 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2CapturePreviewCompletedHandler, + windows_core::IUnknown +); +impl ICoreWebView2CapturePreviewCompletedHandler { + pub unsafe fn Invoke(&self, errorcode: windows_core::HRESULT) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + errorcode, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2CapturePreviewCompletedHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::HRESULT, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2CapturePreviewCompletedHandler_Impl: windows_core::IUnknownImpl { + fn Invoke(&self, errorcode: windows_core::HRESULT) -> windows_core::Result<()>; +} +impl ICoreWebView2CapturePreviewCompletedHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2CapturePreviewCompletedHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2CapturePreviewCompletedHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + errorcode: windows_core::HRESULT, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2CapturePreviewCompletedHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&errorcode), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2CapturePreviewCompletedHandler {} +windows_core::imp::define_interface!( + ICoreWebView2Certificate, + ICoreWebView2Certificate_Vtbl, + 0xc5fb2fce_1cac_4aee_9c79_5ed0362eaae0 +); +windows_core::imp::interface_hierarchy!(ICoreWebView2Certificate, windows_core::IUnknown); +impl ICoreWebView2Certificate { + pub unsafe fn Subject(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Subject)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn Issuer(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Issuer)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn ValidFrom(&self, value: *mut f64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ValidFrom)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn ValidTo(&self, value: *mut f64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ValidTo)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn DerEncodedSerialNumber( + &self, + value: *mut windows_core::PWSTR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).DerEncodedSerialNumber)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn DisplayName(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).DisplayName)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn ToPemEncoding( + &self, + pemencodeddata: *mut windows_core::PWSTR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ToPemEncoding)( + windows_core::Interface::as_raw(self), + pemencodeddata as _, + ) + .ok() + } + } + pub unsafe fn PemEncodedIssuerCertificateChain( + &self, + ) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).PemEncodedIssuerCertificateChain)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Certificate_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Subject: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub Issuer: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub ValidFrom: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut f64) -> windows_core::HRESULT, + pub ValidTo: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut f64) -> windows_core::HRESULT, + pub DerEncodedSerialNumber: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub DisplayName: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub ToPemEncoding: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub PemEncodedIssuerCertificateChain: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Certificate_Impl: windows_core::IUnknownImpl { + fn Subject(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn Issuer(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn ValidFrom(&self, value: *mut f64) -> windows_core::Result<()>; + fn ValidTo(&self, value: *mut f64) -> windows_core::Result<()>; + fn DerEncodedSerialNumber(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn DisplayName(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn ToPemEncoding(&self, pemencodeddata: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn PemEncodedIssuerCertificateChain( + &self, + ) -> windows_core::Result; +} +impl ICoreWebView2Certificate_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn Subject< + Identity: ICoreWebView2Certificate_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Certificate_Impl::Subject(this, core::mem::transmute_copy(&value)) + .into() + } + } + unsafe extern "system" fn Issuer< + Identity: ICoreWebView2Certificate_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Certificate_Impl::Issuer(this, core::mem::transmute_copy(&value)) + .into() + } + } + unsafe extern "system" fn ValidFrom< + Identity: ICoreWebView2Certificate_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut f64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Certificate_Impl::ValidFrom(this, core::mem::transmute_copy(&value)) + .into() + } + } + unsafe extern "system" fn ValidTo< + Identity: ICoreWebView2Certificate_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut f64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Certificate_Impl::ValidTo(this, core::mem::transmute_copy(&value)) + .into() + } + } + unsafe extern "system" fn DerEncodedSerialNumber< + Identity: ICoreWebView2Certificate_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Certificate_Impl::DerEncodedSerialNumber( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn DisplayName< + Identity: ICoreWebView2Certificate_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Certificate_Impl::DisplayName(this, core::mem::transmute_copy(&value)) + .into() + } + } + unsafe extern "system" fn ToPemEncoding< + Identity: ICoreWebView2Certificate_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + pemencodeddata: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Certificate_Impl::ToPemEncoding( + this, + core::mem::transmute_copy(&pemencodeddata), + ) + .into() + } + } + unsafe extern "system" fn PemEncodedIssuerCertificateChain< + Identity: ICoreWebView2Certificate_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2Certificate_Impl::PemEncodedIssuerCertificateChain(this) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Subject: Subject::, + Issuer: Issuer::, + ValidFrom: ValidFrom::, + ValidTo: ValidTo::, + DerEncodedSerialNumber: DerEncodedSerialNumber::, + DisplayName: DisplayName::, + ToPemEncoding: ToPemEncoding::, + PemEncodedIssuerCertificateChain: PemEncodedIssuerCertificateChain::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Certificate {} +windows_core::imp::define_interface!( + ICoreWebView2ClearBrowsingDataCompletedHandler, + ICoreWebView2ClearBrowsingDataCompletedHandler_Vtbl, + 0xe9710a06_1d1d_49b2_8234_226f35846ae5 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2ClearBrowsingDataCompletedHandler, + windows_core::IUnknown +); +impl ICoreWebView2ClearBrowsingDataCompletedHandler { + pub unsafe fn Invoke(&self, errorcode: windows_core::HRESULT) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + errorcode, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2ClearBrowsingDataCompletedHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::HRESULT, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2ClearBrowsingDataCompletedHandler_Impl: windows_core::IUnknownImpl { + fn Invoke(&self, errorcode: windows_core::HRESULT) -> windows_core::Result<()>; +} +impl ICoreWebView2ClearBrowsingDataCompletedHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2ClearBrowsingDataCompletedHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2ClearBrowsingDataCompletedHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + errorcode: windows_core::HRESULT, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ClearBrowsingDataCompletedHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&errorcode), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2ClearBrowsingDataCompletedHandler {} +windows_core::imp::define_interface!( + ICoreWebView2ClearServerCertificateErrorActionsCompletedHandler, + ICoreWebView2ClearServerCertificateErrorActionsCompletedHandler_Vtbl, + 0x3b40aac6_acfe_4ffd_8211_f607b96e2d5b +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2ClearServerCertificateErrorActionsCompletedHandler, + windows_core::IUnknown +); +impl ICoreWebView2ClearServerCertificateErrorActionsCompletedHandler { + pub unsafe fn Invoke(&self, errorcode: windows_core::HRESULT) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + errorcode, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2ClearServerCertificateErrorActionsCompletedHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::HRESULT, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2ClearServerCertificateErrorActionsCompletedHandler_Impl: + windows_core::IUnknownImpl +{ + fn Invoke(&self, errorcode: windows_core::HRESULT) -> windows_core::Result<()>; +} +impl ICoreWebView2ClearServerCertificateErrorActionsCompletedHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2ClearServerCertificateErrorActionsCompletedHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2ClearServerCertificateErrorActionsCompletedHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + errorcode: windows_core::HRESULT, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ClearServerCertificateErrorActionsCompletedHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&errorcode), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == & < ICoreWebView2ClearServerCertificateErrorActionsCompletedHandler as windows_core::Interface >::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2ClearServerCertificateErrorActionsCompletedHandler {} +windows_core::imp::define_interface!( + ICoreWebView2ClientCertificate, + ICoreWebView2ClientCertificate_Vtbl, + 0xe7188076_bcc3_11eb_8529_0242ac130003 +); +windows_core::imp::interface_hierarchy!(ICoreWebView2ClientCertificate, windows_core::IUnknown); +impl ICoreWebView2ClientCertificate { + pub unsafe fn Subject(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Subject)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn Issuer(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Issuer)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn ValidFrom(&self, value: *mut f64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ValidFrom)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn ValidTo(&self, value: *mut f64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ValidTo)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn DerEncodedSerialNumber( + &self, + value: *mut windows_core::PWSTR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).DerEncodedSerialNumber)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn DisplayName(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).DisplayName)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn ToPemEncoding( + &self, + pemencodeddata: *mut windows_core::PWSTR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ToPemEncoding)( + windows_core::Interface::as_raw(self), + pemencodeddata as _, + ) + .ok() + } + } + pub unsafe fn PemEncodedIssuerCertificateChain( + &self, + ) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).PemEncodedIssuerCertificateChain)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } + pub unsafe fn Kind( + &self, + value: *mut COREWEBVIEW2_CLIENT_CERTIFICATE_KIND, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Kind)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2ClientCertificate_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Subject: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub Issuer: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub ValidFrom: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut f64) -> windows_core::HRESULT, + pub ValidTo: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut f64) -> windows_core::HRESULT, + pub DerEncodedSerialNumber: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub DisplayName: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub ToPemEncoding: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub PemEncodedIssuerCertificateChain: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub Kind: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_CLIENT_CERTIFICATE_KIND, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2ClientCertificate_Impl: windows_core::IUnknownImpl { + fn Subject(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn Issuer(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn ValidFrom(&self, value: *mut f64) -> windows_core::Result<()>; + fn ValidTo(&self, value: *mut f64) -> windows_core::Result<()>; + fn DerEncodedSerialNumber(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn DisplayName(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn ToPemEncoding(&self, pemencodeddata: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn PemEncodedIssuerCertificateChain( + &self, + ) -> windows_core::Result; + fn Kind(&self, value: *mut COREWEBVIEW2_CLIENT_CERTIFICATE_KIND) -> windows_core::Result<()>; +} +impl ICoreWebView2ClientCertificate_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn Subject< + Identity: ICoreWebView2ClientCertificate_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ClientCertificate_Impl::Subject( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn Issuer< + Identity: ICoreWebView2ClientCertificate_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ClientCertificate_Impl::Issuer(this, core::mem::transmute_copy(&value)) + .into() + } + } + unsafe extern "system" fn ValidFrom< + Identity: ICoreWebView2ClientCertificate_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut f64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ClientCertificate_Impl::ValidFrom( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn ValidTo< + Identity: ICoreWebView2ClientCertificate_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut f64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ClientCertificate_Impl::ValidTo( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn DerEncodedSerialNumber< + Identity: ICoreWebView2ClientCertificate_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ClientCertificate_Impl::DerEncodedSerialNumber( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn DisplayName< + Identity: ICoreWebView2ClientCertificate_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ClientCertificate_Impl::DisplayName( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn ToPemEncoding< + Identity: ICoreWebView2ClientCertificate_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + pemencodeddata: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ClientCertificate_Impl::ToPemEncoding( + this, + core::mem::transmute_copy(&pemencodeddata), + ) + .into() + } + } + unsafe extern "system" fn PemEncodedIssuerCertificateChain< + Identity: ICoreWebView2ClientCertificate_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2ClientCertificate_Impl::PemEncodedIssuerCertificateChain(this) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + unsafe extern "system" fn Kind< + Identity: ICoreWebView2ClientCertificate_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut COREWEBVIEW2_CLIENT_CERTIFICATE_KIND, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ClientCertificate_Impl::Kind(this, core::mem::transmute_copy(&value)) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Subject: Subject::, + Issuer: Issuer::, + ValidFrom: ValidFrom::, + ValidTo: ValidTo::, + DerEncodedSerialNumber: DerEncodedSerialNumber::, + DisplayName: DisplayName::, + ToPemEncoding: ToPemEncoding::, + PemEncodedIssuerCertificateChain: PemEncodedIssuerCertificateChain::, + Kind: Kind::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2ClientCertificate {} +windows_core::imp::define_interface!( + ICoreWebView2ClientCertificateCollection, + ICoreWebView2ClientCertificateCollection_Vtbl, + 0xef5674d2_bcc3_11eb_8529_0242ac130003 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2ClientCertificateCollection, + windows_core::IUnknown +); +impl ICoreWebView2ClientCertificateCollection { + pub unsafe fn Count(&self, value: *mut u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Count)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn GetValueAtIndex( + &self, + index: u32, + ) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).GetValueAtIndex)( + windows_core::Interface::as_raw(self), + index, + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2ClientCertificateCollection_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Count: unsafe extern "system" fn(*mut core::ffi::c_void, *mut u32) -> windows_core::HRESULT, + pub GetValueAtIndex: unsafe extern "system" fn( + *mut core::ffi::c_void, + u32, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2ClientCertificateCollection_Impl: windows_core::IUnknownImpl { + fn Count(&self, value: *mut u32) -> windows_core::Result<()>; + fn GetValueAtIndex(&self, index: u32) -> windows_core::Result; +} +impl ICoreWebView2ClientCertificateCollection_Vtbl { + pub const fn new< + Identity: ICoreWebView2ClientCertificateCollection_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Count< + Identity: ICoreWebView2ClientCertificateCollection_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ClientCertificateCollection_Impl::Count( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn GetValueAtIndex< + Identity: ICoreWebView2ClientCertificateCollection_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + index: u32, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2ClientCertificateCollection_Impl::GetValueAtIndex( + this, + core::mem::transmute_copy(&index), + ) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Count: Count::, + GetValueAtIndex: GetValueAtIndex::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2ClientCertificateCollection {} +windows_core::imp::define_interface!( + ICoreWebView2ClientCertificateRequestedEventArgs, + ICoreWebView2ClientCertificateRequestedEventArgs_Vtbl, + 0xbc59db28_bcc3_11eb_8529_0242ac130003 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2ClientCertificateRequestedEventArgs, + windows_core::IUnknown +); +impl ICoreWebView2ClientCertificateRequestedEventArgs { + pub unsafe fn Host(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Host)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn Port(&self, value: *mut i32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Port)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn IsProxy(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).IsProxy)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn AllowedCertificateAuthorities( + &self, + ) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).AllowedCertificateAuthorities)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } + pub unsafe fn MutuallyTrustedCertificates( + &self, + ) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).MutuallyTrustedCertificates)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } + pub unsafe fn SelectedCertificate( + &self, + ) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).SelectedCertificate)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } + pub unsafe fn SetSelectedCertificate(&self, value: P0) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).SetSelectedCertificate)( + windows_core::Interface::as_raw(self), + value.param().abi(), + ) + .ok() + } + } + pub unsafe fn Cancel(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Cancel)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetCancel(&self, value: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetCancel)( + windows_core::Interface::as_raw(self), + value.into(), + ) + .ok() + } + } + pub unsafe fn Handled(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Handled)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetHandled(&self, value: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetHandled)( + windows_core::Interface::as_raw(self), + value.into(), + ) + .ok() + } + } + pub unsafe fn GetDeferral(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).GetDeferral)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2ClientCertificateRequestedEventArgs_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Host: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub Port: unsafe extern "system" fn(*mut core::ffi::c_void, *mut i32) -> windows_core::HRESULT, + pub IsProxy: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub AllowedCertificateAuthorities: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub MutuallyTrustedCertificates: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub SelectedCertificate: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub SetSelectedCertificate: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub Cancel: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetCancel: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, + pub Handled: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetHandled: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, + pub GetDeferral: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2ClientCertificateRequestedEventArgs_Impl: + windows_core::IUnknownImpl +{ + fn Host(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn Port(&self, value: *mut i32) -> windows_core::Result<()>; + fn IsProxy(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn AllowedCertificateAuthorities(&self) -> windows_core::Result; + fn MutuallyTrustedCertificates( + &self, + ) -> windows_core::Result; + fn SelectedCertificate(&self) -> windows_core::Result; + fn SetSelectedCertificate( + &self, + value: windows_core::Ref<'_, ICoreWebView2ClientCertificate>, + ) -> windows_core::Result<()>; + fn Cancel(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn SetCancel(&self, value: windows_core::BOOL) -> windows_core::Result<()>; + fn Handled(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn SetHandled(&self, value: windows_core::BOOL) -> windows_core::Result<()>; + fn GetDeferral(&self) -> windows_core::Result; +} +impl ICoreWebView2ClientCertificateRequestedEventArgs_Vtbl { + pub const fn new< + Identity: ICoreWebView2ClientCertificateRequestedEventArgs_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Host< + Identity: ICoreWebView2ClientCertificateRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ClientCertificateRequestedEventArgs_Impl::Host( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn Port< + Identity: ICoreWebView2ClientCertificateRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut i32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ClientCertificateRequestedEventArgs_Impl::Port( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn IsProxy< + Identity: ICoreWebView2ClientCertificateRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ClientCertificateRequestedEventArgs_Impl::IsProxy( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn AllowedCertificateAuthorities< + Identity: ICoreWebView2ClientCertificateRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2ClientCertificateRequestedEventArgs_Impl:: AllowedCertificateAuthorities ( this , ) { Ok ( ok__ ) => { value . write ( core::mem::transmute ( ok__ ) ) ; windows_core::HRESULT ( 0 ) } Err ( err ) => err . into ( ) } + } + } + unsafe extern "system" fn MutuallyTrustedCertificates< + Identity: ICoreWebView2ClientCertificateRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2ClientCertificateRequestedEventArgs_Impl:: MutuallyTrustedCertificates ( this , ) { Ok ( ok__ ) => { value . write ( core::mem::transmute ( ok__ ) ) ; windows_core::HRESULT ( 0 ) } Err ( err ) => err . into ( ) } + } + } + unsafe extern "system" fn SelectedCertificate< + Identity: ICoreWebView2ClientCertificateRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2ClientCertificateRequestedEventArgs_Impl::SelectedCertificate( + this, + ) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + unsafe extern "system" fn SetSelectedCertificate< + Identity: ICoreWebView2ClientCertificateRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ClientCertificateRequestedEventArgs_Impl::SetSelectedCertificate( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn Cancel< + Identity: ICoreWebView2ClientCertificateRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ClientCertificateRequestedEventArgs_Impl::Cancel( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetCancel< + Identity: ICoreWebView2ClientCertificateRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ClientCertificateRequestedEventArgs_Impl::SetCancel( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn Handled< + Identity: ICoreWebView2ClientCertificateRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ClientCertificateRequestedEventArgs_Impl::Handled( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetHandled< + Identity: ICoreWebView2ClientCertificateRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ClientCertificateRequestedEventArgs_Impl::SetHandled( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn GetDeferral< + Identity: ICoreWebView2ClientCertificateRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + deferral: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2ClientCertificateRequestedEventArgs_Impl::GetDeferral(this) { + Ok(ok__) => { + deferral.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Host: Host::, + Port: Port::, + IsProxy: IsProxy::, + AllowedCertificateAuthorities: AllowedCertificateAuthorities::, + MutuallyTrustedCertificates: MutuallyTrustedCertificates::, + SelectedCertificate: SelectedCertificate::, + SetSelectedCertificate: SetSelectedCertificate::, + Cancel: Cancel::, + SetCancel: SetCancel::, + Handled: Handled::, + SetHandled: SetHandled::, + GetDeferral: GetDeferral::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2ClientCertificateRequestedEventArgs {} +windows_core::imp::define_interface!( + ICoreWebView2ClientCertificateRequestedEventHandler, + ICoreWebView2ClientCertificateRequestedEventHandler_Vtbl, + 0xd7175ba2_bcc3_11eb_8529_0242ac130003 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2ClientCertificateRequestedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2ClientCertificateRequestedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2ClientCertificateRequestedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2ClientCertificateRequestedEventHandler_Impl: + windows_core::IUnknownImpl +{ + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2>, + args: windows_core::Ref<'_, ICoreWebView2ClientCertificateRequestedEventArgs>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2ClientCertificateRequestedEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2ClientCertificateRequestedEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2ClientCertificateRequestedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ClientCertificateRequestedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == & < ICoreWebView2ClientCertificateRequestedEventHandler as windows_core::Interface >::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2ClientCertificateRequestedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2CompositionController, + ICoreWebView2CompositionController_Vtbl, + 0x3df9b733_b9ae_4a15_86b4_eb9ee9826469 +); +windows_core::imp::interface_hierarchy!(ICoreWebView2CompositionController, windows_core::IUnknown); +impl ICoreWebView2CompositionController { + pub unsafe fn RootVisualTarget(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).RootVisualTarget)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } + pub unsafe fn SetRootVisualTarget(&self, target: P0) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).SetRootVisualTarget)( + windows_core::Interface::as_raw(self), + target.param().abi(), + ) + .ok() + } + } + pub unsafe fn SendMouseInput( + &self, + eventkind: COREWEBVIEW2_MOUSE_EVENT_KIND, + virtualkeys: COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS, + mousedata: u32, + point: windows::Win32::Foundation::POINT, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SendMouseInput)( + windows_core::Interface::as_raw(self), + eventkind, + virtualkeys, + mousedata, + core::mem::transmute(point), + ) + .ok() + } + } + pub unsafe fn SendPointerInput( + &self, + eventkind: COREWEBVIEW2_POINTER_EVENT_KIND, + pointerinfo: P1, + ) -> windows_core::Result<()> + where + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).SendPointerInput)( + windows_core::Interface::as_raw(self), + eventkind, + pointerinfo.param().abi(), + ) + .ok() + } + } + pub unsafe fn Cursor( + &self, + cursor: *mut windows::Win32::UI::WindowsAndMessaging::HCURSOR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Cursor)( + windows_core::Interface::as_raw(self), + cursor as _, + ) + .ok() + } + } + pub unsafe fn SystemCursorId(&self, systemcursorid: *mut u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SystemCursorId)( + windows_core::Interface::as_raw(self), + systemcursorid as _, + ) + .ok() + } + } + pub unsafe fn add_CursorChanged( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_CursorChanged)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_CursorChanged(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_CursorChanged)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2CompositionController_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub RootVisualTarget: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub SetRootVisualTarget: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub SendMouseInput: unsafe extern "system" fn( + *mut core::ffi::c_void, + COREWEBVIEW2_MOUSE_EVENT_KIND, + COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS, + u32, + windows::Win32::Foundation::POINT, + ) -> windows_core::HRESULT, + pub SendPointerInput: unsafe extern "system" fn( + *mut core::ffi::c_void, + COREWEBVIEW2_POINTER_EVENT_KIND, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub Cursor: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows::Win32::UI::WindowsAndMessaging::HCURSOR, + ) -> windows_core::HRESULT, + pub SystemCursorId: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut u32) -> windows_core::HRESULT, + pub add_CursorChanged: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_CursorChanged: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, +} +pub trait ICoreWebView2CompositionController_Impl: windows_core::IUnknownImpl { + fn RootVisualTarget(&self) -> windows_core::Result; + fn SetRootVisualTarget( + &self, + target: windows_core::Ref<'_, windows_core::IUnknown>, + ) -> windows_core::Result<()>; + fn SendMouseInput( + &self, + eventkind: COREWEBVIEW2_MOUSE_EVENT_KIND, + virtualkeys: COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS, + mousedata: u32, + point: &windows::Win32::Foundation::POINT, + ) -> windows_core::Result<()>; + fn SendPointerInput( + &self, + eventkind: COREWEBVIEW2_POINTER_EVENT_KIND, + pointerinfo: windows_core::Ref<'_, ICoreWebView2PointerInfo>, + ) -> windows_core::Result<()>; + fn Cursor( + &self, + cursor: *mut windows::Win32::UI::WindowsAndMessaging::HCURSOR, + ) -> windows_core::Result<()>; + fn SystemCursorId(&self, systemcursorid: *mut u32) -> windows_core::Result<()>; + fn add_CursorChanged( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2CursorChangedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_CursorChanged(&self, token: i64) -> windows_core::Result<()>; +} +impl ICoreWebView2CompositionController_Vtbl { + pub const fn new( + ) -> Self { + unsafe extern "system" fn RootVisualTarget< + Identity: ICoreWebView2CompositionController_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + target: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2CompositionController_Impl::RootVisualTarget(this) { + Ok(ok__) => { + target.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + unsafe extern "system" fn SetRootVisualTarget< + Identity: ICoreWebView2CompositionController_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + target: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2CompositionController_Impl::SetRootVisualTarget( + this, + core::mem::transmute_copy(&target), + ) + .into() + } + } + unsafe extern "system" fn SendMouseInput< + Identity: ICoreWebView2CompositionController_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventkind: COREWEBVIEW2_MOUSE_EVENT_KIND, + virtualkeys: COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS, + mousedata: u32, + point: windows::Win32::Foundation::POINT, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2CompositionController_Impl::SendMouseInput( + this, + core::mem::transmute_copy(&eventkind), + core::mem::transmute_copy(&virtualkeys), + core::mem::transmute_copy(&mousedata), + core::mem::transmute(&point), + ) + .into() + } + } + unsafe extern "system" fn SendPointerInput< + Identity: ICoreWebView2CompositionController_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventkind: COREWEBVIEW2_POINTER_EVENT_KIND, + pointerinfo: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2CompositionController_Impl::SendPointerInput( + this, + core::mem::transmute_copy(&eventkind), + core::mem::transmute_copy(&pointerinfo), + ) + .into() + } + } + unsafe extern "system" fn Cursor< + Identity: ICoreWebView2CompositionController_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + cursor: *mut windows::Win32::UI::WindowsAndMessaging::HCURSOR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2CompositionController_Impl::Cursor( + this, + core::mem::transmute_copy(&cursor), + ) + .into() + } + } + unsafe extern "system" fn SystemCursorId< + Identity: ICoreWebView2CompositionController_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + systemcursorid: *mut u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2CompositionController_Impl::SystemCursorId( + this, + core::mem::transmute_copy(&systemcursorid), + ) + .into() + } + } + unsafe extern "system" fn add_CursorChanged< + Identity: ICoreWebView2CompositionController_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2CompositionController_Impl::add_CursorChanged( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_CursorChanged< + Identity: ICoreWebView2CompositionController_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2CompositionController_Impl::remove_CursorChanged( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + RootVisualTarget: RootVisualTarget::, + SetRootVisualTarget: SetRootVisualTarget::, + SendMouseInput: SendMouseInput::, + SendPointerInput: SendPointerInput::, + Cursor: Cursor::, + SystemCursorId: SystemCursorId::, + add_CursorChanged: add_CursorChanged::, + remove_CursorChanged: remove_CursorChanged::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2CompositionController {} +windows_core::imp::define_interface!( + ICoreWebView2CompositionController2, + ICoreWebView2CompositionController2_Vtbl, + 0x0b6a3d24_49cb_4806_ba20_b5e0734a7b26 +); +impl core::ops::Deref for ICoreWebView2CompositionController2 { + type Target = ICoreWebView2CompositionController; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2CompositionController2, + windows_core::IUnknown, + ICoreWebView2CompositionController +); +impl ICoreWebView2CompositionController2 { + pub unsafe fn AutomationProvider(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).AutomationProvider)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2CompositionController2_Vtbl { + pub base__: ICoreWebView2CompositionController_Vtbl, + pub AutomationProvider: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2CompositionController2_Impl: + ICoreWebView2CompositionController_Impl +{ + fn AutomationProvider(&self) -> windows_core::Result; +} +impl ICoreWebView2CompositionController2_Vtbl { + pub const fn new( + ) -> Self { + unsafe extern "system" fn AutomationProvider< + Identity: ICoreWebView2CompositionController2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2CompositionController2_Impl::AutomationProvider(this) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: ICoreWebView2CompositionController_Vtbl::new::(), + AutomationProvider: AutomationProvider::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2CompositionController2 {} +windows_core::imp::define_interface!( + ICoreWebView2CompositionController3, + ICoreWebView2CompositionController3_Vtbl, + 0x9570570e_4d76_4361_9ee1_f04d0dbdfb1e +); +impl core::ops::Deref for ICoreWebView2CompositionController3 { + type Target = ICoreWebView2CompositionController2; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2CompositionController3, + windows_core::IUnknown, + ICoreWebView2CompositionController, + ICoreWebView2CompositionController2 +); +impl ICoreWebView2CompositionController3 { + pub unsafe fn DragEnter( + &self, + dataobject: P0, + keystate: u32, + point: windows::Win32::Foundation::POINT, + effect: *mut u32, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).DragEnter)( + windows_core::Interface::as_raw(self), + dataobject.param().abi(), + keystate, + core::mem::transmute(point), + effect as _, + ) + .ok() + } + } + pub unsafe fn DragLeave(&self) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).DragLeave)(windows_core::Interface::as_raw(self)) + .ok() + } + } + pub unsafe fn DragOver( + &self, + keystate: u32, + point: windows::Win32::Foundation::POINT, + effect: *mut u32, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).DragOver)( + windows_core::Interface::as_raw(self), + keystate, + core::mem::transmute(point), + effect as _, + ) + .ok() + } + } + pub unsafe fn Drop( + &self, + dataobject: P0, + keystate: u32, + point: windows::Win32::Foundation::POINT, + effect: *mut u32, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Drop)( + windows_core::Interface::as_raw(self), + dataobject.param().abi(), + keystate, + core::mem::transmute(point), + effect as _, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2CompositionController3_Vtbl { + pub base__: ICoreWebView2CompositionController2_Vtbl, + pub DragEnter: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + u32, + windows::Win32::Foundation::POINT, + *mut u32, + ) -> windows_core::HRESULT, + pub DragLeave: unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT, + pub DragOver: unsafe extern "system" fn( + *mut core::ffi::c_void, + u32, + windows::Win32::Foundation::POINT, + *mut u32, + ) -> windows_core::HRESULT, + pub Drop: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + u32, + windows::Win32::Foundation::POINT, + *mut u32, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2CompositionController3_Impl: + ICoreWebView2CompositionController2_Impl +{ + fn DragEnter( + &self, + dataobject: windows_core::Ref<'_, windows::Win32::System::Com::IDataObject>, + keystate: u32, + point: &windows::Win32::Foundation::POINT, + effect: *mut u32, + ) -> windows_core::Result<()>; + fn DragLeave(&self) -> windows_core::Result<()>; + fn DragOver( + &self, + keystate: u32, + point: &windows::Win32::Foundation::POINT, + effect: *mut u32, + ) -> windows_core::Result<()>; + fn Drop( + &self, + dataobject: windows_core::Ref<'_, windows::Win32::System::Com::IDataObject>, + keystate: u32, + point: &windows::Win32::Foundation::POINT, + effect: *mut u32, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2CompositionController3_Vtbl { + pub const fn new( + ) -> Self { + unsafe extern "system" fn DragEnter< + Identity: ICoreWebView2CompositionController3_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + dataobject: *mut core::ffi::c_void, + keystate: u32, + point: windows::Win32::Foundation::POINT, + effect: *mut u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2CompositionController3_Impl::DragEnter( + this, + core::mem::transmute_copy(&dataobject), + core::mem::transmute_copy(&keystate), + core::mem::transmute(&point), + core::mem::transmute_copy(&effect), + ) + .into() + } + } + unsafe extern "system" fn DragLeave< + Identity: ICoreWebView2CompositionController3_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2CompositionController3_Impl::DragLeave(this).into() + } + } + unsafe extern "system" fn DragOver< + Identity: ICoreWebView2CompositionController3_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + keystate: u32, + point: windows::Win32::Foundation::POINT, + effect: *mut u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2CompositionController3_Impl::DragOver( + this, + core::mem::transmute_copy(&keystate), + core::mem::transmute(&point), + core::mem::transmute_copy(&effect), + ) + .into() + } + } + unsafe extern "system" fn Drop< + Identity: ICoreWebView2CompositionController3_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + dataobject: *mut core::ffi::c_void, + keystate: u32, + point: windows::Win32::Foundation::POINT, + effect: *mut u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2CompositionController3_Impl::Drop( + this, + core::mem::transmute_copy(&dataobject), + core::mem::transmute_copy(&keystate), + core::mem::transmute(&point), + core::mem::transmute_copy(&effect), + ) + .into() + } + } + Self { + base__: ICoreWebView2CompositionController2_Vtbl::new::(), + DragEnter: DragEnter::, + DragLeave: DragLeave::, + DragOver: DragOver::, + Drop: Drop::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2CompositionController3 {} +windows_core::imp::define_interface!( + ICoreWebView2CompositionController4, + ICoreWebView2CompositionController4_Vtbl, + 0x7c367b9b_3d2b_450f_9e58_d61a20f486aa +); +impl core::ops::Deref for ICoreWebView2CompositionController4 { + type Target = ICoreWebView2CompositionController3; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2CompositionController4, + windows_core::IUnknown, + ICoreWebView2CompositionController, + ICoreWebView2CompositionController2, + ICoreWebView2CompositionController3 +); +impl ICoreWebView2CompositionController4 { + pub unsafe fn GetNonClientRegionAtPoint( + &self, + point: windows::Win32::Foundation::POINT, + value: *mut COREWEBVIEW2_NON_CLIENT_REGION_KIND, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).GetNonClientRegionAtPoint)( + windows_core::Interface::as_raw(self), + core::mem::transmute(point), + value as _, + ) + .ok() + } + } + pub unsafe fn QueryNonClientRegion( + &self, + kind: COREWEBVIEW2_NON_CLIENT_REGION_KIND, + ) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).QueryNonClientRegion)( + windows_core::Interface::as_raw(self), + kind, + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } + pub unsafe fn add_NonClientRegionChanged( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_NonClientRegionChanged)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_NonClientRegionChanged(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_NonClientRegionChanged)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2CompositionController4_Vtbl { + pub base__: ICoreWebView2CompositionController3_Vtbl, + pub GetNonClientRegionAtPoint: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows::Win32::Foundation::POINT, + *mut COREWEBVIEW2_NON_CLIENT_REGION_KIND, + ) -> windows_core::HRESULT, + pub QueryNonClientRegion: unsafe extern "system" fn( + *mut core::ffi::c_void, + COREWEBVIEW2_NON_CLIENT_REGION_KIND, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub add_NonClientRegionChanged: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_NonClientRegionChanged: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, +} +pub trait ICoreWebView2CompositionController4_Impl: + ICoreWebView2CompositionController3_Impl +{ + fn GetNonClientRegionAtPoint( + &self, + point: &windows::Win32::Foundation::POINT, + value: *mut COREWEBVIEW2_NON_CLIENT_REGION_KIND, + ) -> windows_core::Result<()>; + fn QueryNonClientRegion( + &self, + kind: COREWEBVIEW2_NON_CLIENT_REGION_KIND, + ) -> windows_core::Result; + fn add_NonClientRegionChanged( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2NonClientRegionChangedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_NonClientRegionChanged(&self, token: i64) -> windows_core::Result<()>; +} +impl ICoreWebView2CompositionController4_Vtbl { + pub const fn new( + ) -> Self { + unsafe extern "system" fn GetNonClientRegionAtPoint< + Identity: ICoreWebView2CompositionController4_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + point: windows::Win32::Foundation::POINT, + value: *mut COREWEBVIEW2_NON_CLIENT_REGION_KIND, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2CompositionController4_Impl::GetNonClientRegionAtPoint( + this, + core::mem::transmute(&point), + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn QueryNonClientRegion< + Identity: ICoreWebView2CompositionController4_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + kind: COREWEBVIEW2_NON_CLIENT_REGION_KIND, + rects: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2CompositionController4_Impl::QueryNonClientRegion( + this, + core::mem::transmute_copy(&kind), + ) { + Ok(ok__) => { + rects.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + unsafe extern "system" fn add_NonClientRegionChanged< + Identity: ICoreWebView2CompositionController4_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2CompositionController4_Impl::add_NonClientRegionChanged( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_NonClientRegionChanged< + Identity: ICoreWebView2CompositionController4_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2CompositionController4_Impl::remove_NonClientRegionChanged( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + Self { + base__: ICoreWebView2CompositionController3_Vtbl::new::(), + GetNonClientRegionAtPoint: GetNonClientRegionAtPoint::, + QueryNonClientRegion: QueryNonClientRegion::, + add_NonClientRegionChanged: add_NonClientRegionChanged::, + remove_NonClientRegionChanged: remove_NonClientRegionChanged::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2CompositionController4 {} +windows_core::imp::define_interface!( + ICoreWebView2ContainsFullScreenElementChangedEventHandler, + ICoreWebView2ContainsFullScreenElementChangedEventHandler_Vtbl, + 0xe45d98b1_afef_45be_8baf_6c7728867f73 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2ContainsFullScreenElementChangedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2ContainsFullScreenElementChangedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2ContainsFullScreenElementChangedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2ContainsFullScreenElementChangedEventHandler_Impl: + windows_core::IUnknownImpl +{ + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2>, + args: windows_core::Ref<'_, windows_core::IUnknown>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2ContainsFullScreenElementChangedEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2ContainsFullScreenElementChangedEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2ContainsFullScreenElementChangedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ContainsFullScreenElementChangedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == & < ICoreWebView2ContainsFullScreenElementChangedEventHandler as windows_core::Interface >::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2ContainsFullScreenElementChangedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2ContentLoadingEventArgs, + ICoreWebView2ContentLoadingEventArgs_Vtbl, + 0x0c8a1275_9b6b_4901_87ad_70df25bafa6e +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2ContentLoadingEventArgs, + windows_core::IUnknown +); +impl ICoreWebView2ContentLoadingEventArgs { + pub unsafe fn IsErrorPage(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).IsErrorPage)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn NavigationId(&self, value: *mut u64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).NavigationId)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2ContentLoadingEventArgs_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub IsErrorPage: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub NavigationId: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut u64) -> windows_core::HRESULT, +} +pub trait ICoreWebView2ContentLoadingEventArgs_Impl: windows_core::IUnknownImpl { + fn IsErrorPage(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn NavigationId(&self, value: *mut u64) -> windows_core::Result<()>; +} +impl ICoreWebView2ContentLoadingEventArgs_Vtbl { + pub const fn new( + ) -> Self { + unsafe extern "system" fn IsErrorPage< + Identity: ICoreWebView2ContentLoadingEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ContentLoadingEventArgs_Impl::IsErrorPage( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn NavigationId< + Identity: ICoreWebView2ContentLoadingEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut u64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ContentLoadingEventArgs_Impl::NavigationId( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + IsErrorPage: IsErrorPage::, + NavigationId: NavigationId::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2ContentLoadingEventArgs {} +windows_core::imp::define_interface!( + ICoreWebView2ContentLoadingEventHandler, + ICoreWebView2ContentLoadingEventHandler_Vtbl, + 0x364471e7_f2be_4910_bdba_d72077d51c4b +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2ContentLoadingEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2ContentLoadingEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2ContentLoadingEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2ContentLoadingEventHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2>, + args: windows_core::Ref<'_, ICoreWebView2ContentLoadingEventArgs>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2ContentLoadingEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2ContentLoadingEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2ContentLoadingEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ContentLoadingEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2ContentLoadingEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2ContextMenuItem, + ICoreWebView2ContextMenuItem_Vtbl, + 0x7aed49e3_a93f_497a_811c_749c6b6b6c65 +); +windows_core::imp::interface_hierarchy!(ICoreWebView2ContextMenuItem, windows_core::IUnknown); +impl ICoreWebView2ContextMenuItem { + pub unsafe fn Name(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Name)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn Label(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Label)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn CommandId(&self, value: *mut i32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).CommandId)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn ShortcutKeyDescription( + &self, + value: *mut windows_core::PWSTR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ShortcutKeyDescription)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn Icon(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).Icon)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } + pub unsafe fn Kind( + &self, + value: *mut COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Kind)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetIsEnabled(&self, value: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetIsEnabled)( + windows_core::Interface::as_raw(self), + value.into(), + ) + .ok() + } + } + pub unsafe fn IsEnabled(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).IsEnabled)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetIsChecked(&self, value: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetIsChecked)( + windows_core::Interface::as_raw(self), + value.into(), + ) + .ok() + } + } + pub unsafe fn IsChecked(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).IsChecked)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn Children(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).Children)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } + pub unsafe fn add_CustomItemSelected( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_CustomItemSelected)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_CustomItemSelected(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_CustomItemSelected)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2ContextMenuItem_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Name: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub Label: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub CommandId: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut i32) -> windows_core::HRESULT, + pub ShortcutKeyDescription: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub Icon: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub Kind: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND, + ) -> windows_core::HRESULT, + pub SetIsEnabled: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, + pub IsEnabled: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetIsChecked: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, + pub IsChecked: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub Children: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub add_CustomItemSelected: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_CustomItemSelected: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, +} +pub trait ICoreWebView2ContextMenuItem_Impl: windows_core::IUnknownImpl { + fn Name(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn Label(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn CommandId(&self, value: *mut i32) -> windows_core::Result<()>; + fn ShortcutKeyDescription(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn Icon(&self) -> windows_core::Result; + fn Kind(&self, value: *mut COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND) -> windows_core::Result<()>; + fn SetIsEnabled(&self, value: windows_core::BOOL) -> windows_core::Result<()>; + fn IsEnabled(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn SetIsChecked(&self, value: windows_core::BOOL) -> windows_core::Result<()>; + fn IsChecked(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn Children(&self) -> windows_core::Result; + fn add_CustomItemSelected( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2CustomItemSelectedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_CustomItemSelected(&self, token: i64) -> windows_core::Result<()>; +} +impl ICoreWebView2ContextMenuItem_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn Name< + Identity: ICoreWebView2ContextMenuItem_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ContextMenuItem_Impl::Name(this, core::mem::transmute_copy(&value)) + .into() + } + } + unsafe extern "system" fn Label< + Identity: ICoreWebView2ContextMenuItem_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ContextMenuItem_Impl::Label(this, core::mem::transmute_copy(&value)) + .into() + } + } + unsafe extern "system" fn CommandId< + Identity: ICoreWebView2ContextMenuItem_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut i32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ContextMenuItem_Impl::CommandId( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn ShortcutKeyDescription< + Identity: ICoreWebView2ContextMenuItem_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ContextMenuItem_Impl::ShortcutKeyDescription( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn Icon< + Identity: ICoreWebView2ContextMenuItem_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2ContextMenuItem_Impl::Icon(this) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + unsafe extern "system" fn Kind< + Identity: ICoreWebView2ContextMenuItem_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ContextMenuItem_Impl::Kind(this, core::mem::transmute_copy(&value)) + .into() + } + } + unsafe extern "system" fn SetIsEnabled< + Identity: ICoreWebView2ContextMenuItem_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ContextMenuItem_Impl::SetIsEnabled( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn IsEnabled< + Identity: ICoreWebView2ContextMenuItem_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ContextMenuItem_Impl::IsEnabled( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetIsChecked< + Identity: ICoreWebView2ContextMenuItem_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ContextMenuItem_Impl::SetIsChecked( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn IsChecked< + Identity: ICoreWebView2ContextMenuItem_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ContextMenuItem_Impl::IsChecked( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn Children< + Identity: ICoreWebView2ContextMenuItem_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2ContextMenuItem_Impl::Children(this) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + unsafe extern "system" fn add_CustomItemSelected< + Identity: ICoreWebView2ContextMenuItem_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ContextMenuItem_Impl::add_CustomItemSelected( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_CustomItemSelected< + Identity: ICoreWebView2ContextMenuItem_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ContextMenuItem_Impl::remove_CustomItemSelected( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Name: Name::, + Label: Label::, + CommandId: CommandId::, + ShortcutKeyDescription: ShortcutKeyDescription::, + Icon: Icon::, + Kind: Kind::, + SetIsEnabled: SetIsEnabled::, + IsEnabled: IsEnabled::, + SetIsChecked: SetIsChecked::, + IsChecked: IsChecked::, + Children: Children::, + add_CustomItemSelected: add_CustomItemSelected::, + remove_CustomItemSelected: remove_CustomItemSelected::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2ContextMenuItem {} +windows_core::imp::define_interface!( + ICoreWebView2ContextMenuItemCollection, + ICoreWebView2ContextMenuItemCollection_Vtbl, + 0xf562a2f5_c415_45cf_b909_d4b7c1e276d3 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2ContextMenuItemCollection, + windows_core::IUnknown +); +impl ICoreWebView2ContextMenuItemCollection { + pub unsafe fn Count(&self, value: *mut u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Count)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn GetValueAtIndex( + &self, + index: u32, + ) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).GetValueAtIndex)( + windows_core::Interface::as_raw(self), + index, + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } + pub unsafe fn RemoveValueAtIndex(&self, index: u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).RemoveValueAtIndex)( + windows_core::Interface::as_raw(self), + index, + ) + .ok() + } + } + pub unsafe fn InsertValueAtIndex(&self, index: u32, value: P1) -> windows_core::Result<()> + where + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).InsertValueAtIndex)( + windows_core::Interface::as_raw(self), + index, + value.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2ContextMenuItemCollection_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Count: unsafe extern "system" fn(*mut core::ffi::c_void, *mut u32) -> windows_core::HRESULT, + pub GetValueAtIndex: unsafe extern "system" fn( + *mut core::ffi::c_void, + u32, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub RemoveValueAtIndex: + unsafe extern "system" fn(*mut core::ffi::c_void, u32) -> windows_core::HRESULT, + pub InsertValueAtIndex: unsafe extern "system" fn( + *mut core::ffi::c_void, + u32, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2ContextMenuItemCollection_Impl: windows_core::IUnknownImpl { + fn Count(&self, value: *mut u32) -> windows_core::Result<()>; + fn GetValueAtIndex(&self, index: u32) -> windows_core::Result; + fn RemoveValueAtIndex(&self, index: u32) -> windows_core::Result<()>; + fn InsertValueAtIndex( + &self, + index: u32, + value: windows_core::Ref<'_, ICoreWebView2ContextMenuItem>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2ContextMenuItemCollection_Vtbl { + pub const fn new( + ) -> Self { + unsafe extern "system" fn Count< + Identity: ICoreWebView2ContextMenuItemCollection_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ContextMenuItemCollection_Impl::Count( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn GetValueAtIndex< + Identity: ICoreWebView2ContextMenuItemCollection_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + index: u32, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2ContextMenuItemCollection_Impl::GetValueAtIndex( + this, + core::mem::transmute_copy(&index), + ) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + unsafe extern "system" fn RemoveValueAtIndex< + Identity: ICoreWebView2ContextMenuItemCollection_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + index: u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ContextMenuItemCollection_Impl::RemoveValueAtIndex( + this, + core::mem::transmute_copy(&index), + ) + .into() + } + } + unsafe extern "system" fn InsertValueAtIndex< + Identity: ICoreWebView2ContextMenuItemCollection_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + index: u32, + value: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ContextMenuItemCollection_Impl::InsertValueAtIndex( + this, + core::mem::transmute_copy(&index), + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Count: Count::, + GetValueAtIndex: GetValueAtIndex::, + RemoveValueAtIndex: RemoveValueAtIndex::, + InsertValueAtIndex: InsertValueAtIndex::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2ContextMenuItemCollection {} +windows_core::imp::define_interface!( + ICoreWebView2ContextMenuRequestedEventArgs, + ICoreWebView2ContextMenuRequestedEventArgs_Vtbl, + 0xa1d309ee_c03f_11eb_8529_0242ac130003 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2ContextMenuRequestedEventArgs, + windows_core::IUnknown +); +impl ICoreWebView2ContextMenuRequestedEventArgs { + pub unsafe fn MenuItems(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).MenuItems)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } + pub unsafe fn ContextMenuTarget(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).ContextMenuTarget)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } + pub unsafe fn Location( + &self, + value: *mut windows::Win32::Foundation::POINT, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Location)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetSelectedCommandId(&self, value: i32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetSelectedCommandId)( + windows_core::Interface::as_raw(self), + value, + ) + .ok() + } + } + pub unsafe fn SelectedCommandId(&self, value: *mut i32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SelectedCommandId)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetHandled(&self, value: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetHandled)( + windows_core::Interface::as_raw(self), + value.into(), + ) + .ok() + } + } + pub unsafe fn Handled(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Handled)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn GetDeferral(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).GetDeferral)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2ContextMenuRequestedEventArgs_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub MenuItems: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub ContextMenuTarget: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub Location: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows::Win32::Foundation::POINT, + ) -> windows_core::HRESULT, + pub SetSelectedCommandId: + unsafe extern "system" fn(*mut core::ffi::c_void, i32) -> windows_core::HRESULT, + pub SelectedCommandId: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut i32) -> windows_core::HRESULT, + pub SetHandled: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, + pub Handled: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub GetDeferral: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2ContextMenuRequestedEventArgs_Impl: windows_core::IUnknownImpl { + fn MenuItems(&self) -> windows_core::Result; + fn ContextMenuTarget(&self) -> windows_core::Result; + fn Location(&self, value: *mut windows::Win32::Foundation::POINT) -> windows_core::Result<()>; + fn SetSelectedCommandId(&self, value: i32) -> windows_core::Result<()>; + fn SelectedCommandId(&self, value: *mut i32) -> windows_core::Result<()>; + fn SetHandled(&self, value: windows_core::BOOL) -> windows_core::Result<()>; + fn Handled(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn GetDeferral(&self) -> windows_core::Result; +} +impl ICoreWebView2ContextMenuRequestedEventArgs_Vtbl { + pub const fn new< + Identity: ICoreWebView2ContextMenuRequestedEventArgs_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn MenuItems< + Identity: ICoreWebView2ContextMenuRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2ContextMenuRequestedEventArgs_Impl::MenuItems(this) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + unsafe extern "system" fn ContextMenuTarget< + Identity: ICoreWebView2ContextMenuRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2ContextMenuRequestedEventArgs_Impl::ContextMenuTarget(this) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + unsafe extern "system" fn Location< + Identity: ICoreWebView2ContextMenuRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows::Win32::Foundation::POINT, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ContextMenuRequestedEventArgs_Impl::Location( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetSelectedCommandId< + Identity: ICoreWebView2ContextMenuRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: i32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ContextMenuRequestedEventArgs_Impl::SetSelectedCommandId( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SelectedCommandId< + Identity: ICoreWebView2ContextMenuRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut i32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ContextMenuRequestedEventArgs_Impl::SelectedCommandId( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetHandled< + Identity: ICoreWebView2ContextMenuRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ContextMenuRequestedEventArgs_Impl::SetHandled( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn Handled< + Identity: ICoreWebView2ContextMenuRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ContextMenuRequestedEventArgs_Impl::Handled( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn GetDeferral< + Identity: ICoreWebView2ContextMenuRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + deferral: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2ContextMenuRequestedEventArgs_Impl::GetDeferral(this) { + Ok(ok__) => { + deferral.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + MenuItems: MenuItems::, + ContextMenuTarget: ContextMenuTarget::, + Location: Location::, + SetSelectedCommandId: SetSelectedCommandId::, + SelectedCommandId: SelectedCommandId::, + SetHandled: SetHandled::, + Handled: Handled::, + GetDeferral: GetDeferral::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2ContextMenuRequestedEventArgs {} +windows_core::imp::define_interface!( + ICoreWebView2ContextMenuRequestedEventHandler, + ICoreWebView2ContextMenuRequestedEventHandler_Vtbl, + 0x04d3fe1d_ab87_42fb_a898_da241d35b63c +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2ContextMenuRequestedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2ContextMenuRequestedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2ContextMenuRequestedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2ContextMenuRequestedEventHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2>, + args: windows_core::Ref<'_, ICoreWebView2ContextMenuRequestedEventArgs>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2ContextMenuRequestedEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2ContextMenuRequestedEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2ContextMenuRequestedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ContextMenuRequestedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2ContextMenuRequestedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2ContextMenuTarget, + ICoreWebView2ContextMenuTarget_Vtbl, + 0xb8611d99_eed6_4f3f_902c_a198502ad472 +); +windows_core::imp::interface_hierarchy!(ICoreWebView2ContextMenuTarget, windows_core::IUnknown); +impl ICoreWebView2ContextMenuTarget { + pub unsafe fn Kind( + &self, + value: *mut COREWEBVIEW2_CONTEXT_MENU_TARGET_KIND, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Kind)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn IsEditable(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).IsEditable)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn IsRequestedForMainFrame( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).IsRequestedForMainFrame)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn PageUri(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).PageUri)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn FrameUri(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).FrameUri)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn HasLinkUri(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).HasLinkUri)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn LinkUri(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).LinkUri)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn HasLinkText(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).HasLinkText)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn LinkText(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).LinkText)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn HasSourceUri(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).HasSourceUri)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SourceUri(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SourceUri)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn HasSelection(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).HasSelection)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SelectionText( + &self, + value: *mut windows_core::PWSTR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SelectionText)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2ContextMenuTarget_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Kind: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_CONTEXT_MENU_TARGET_KIND, + ) -> windows_core::HRESULT, + pub IsEditable: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub IsRequestedForMainFrame: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub PageUri: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub FrameUri: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub HasLinkUri: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub LinkUri: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub HasLinkText: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub LinkText: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub HasSourceUri: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SourceUri: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub HasSelection: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SelectionText: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2ContextMenuTarget_Impl: windows_core::IUnknownImpl { + fn Kind(&self, value: *mut COREWEBVIEW2_CONTEXT_MENU_TARGET_KIND) -> windows_core::Result<()>; + fn IsEditable(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn IsRequestedForMainFrame(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn PageUri(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn FrameUri(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn HasLinkUri(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn LinkUri(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn HasLinkText(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn LinkText(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn HasSourceUri(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn SourceUri(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn HasSelection(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn SelectionText(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; +} +impl ICoreWebView2ContextMenuTarget_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn Kind< + Identity: ICoreWebView2ContextMenuTarget_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut COREWEBVIEW2_CONTEXT_MENU_TARGET_KIND, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ContextMenuTarget_Impl::Kind(this, core::mem::transmute_copy(&value)) + .into() + } + } + unsafe extern "system" fn IsEditable< + Identity: ICoreWebView2ContextMenuTarget_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ContextMenuTarget_Impl::IsEditable( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn IsRequestedForMainFrame< + Identity: ICoreWebView2ContextMenuTarget_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ContextMenuTarget_Impl::IsRequestedForMainFrame( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn PageUri< + Identity: ICoreWebView2ContextMenuTarget_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ContextMenuTarget_Impl::PageUri( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn FrameUri< + Identity: ICoreWebView2ContextMenuTarget_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ContextMenuTarget_Impl::FrameUri( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn HasLinkUri< + Identity: ICoreWebView2ContextMenuTarget_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ContextMenuTarget_Impl::HasLinkUri( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn LinkUri< + Identity: ICoreWebView2ContextMenuTarget_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ContextMenuTarget_Impl::LinkUri( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn HasLinkText< + Identity: ICoreWebView2ContextMenuTarget_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ContextMenuTarget_Impl::HasLinkText( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn LinkText< + Identity: ICoreWebView2ContextMenuTarget_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ContextMenuTarget_Impl::LinkText( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn HasSourceUri< + Identity: ICoreWebView2ContextMenuTarget_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ContextMenuTarget_Impl::HasSourceUri( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SourceUri< + Identity: ICoreWebView2ContextMenuTarget_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ContextMenuTarget_Impl::SourceUri( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn HasSelection< + Identity: ICoreWebView2ContextMenuTarget_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ContextMenuTarget_Impl::HasSelection( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SelectionText< + Identity: ICoreWebView2ContextMenuTarget_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ContextMenuTarget_Impl::SelectionText( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Kind: Kind::, + IsEditable: IsEditable::, + IsRequestedForMainFrame: IsRequestedForMainFrame::, + PageUri: PageUri::, + FrameUri: FrameUri::, + HasLinkUri: HasLinkUri::, + LinkUri: LinkUri::, + HasLinkText: HasLinkText::, + LinkText: LinkText::, + HasSourceUri: HasSourceUri::, + SourceUri: SourceUri::, + HasSelection: HasSelection::, + SelectionText: SelectionText::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2ContextMenuTarget {} +windows_core::imp::define_interface!( + ICoreWebView2Controller, + ICoreWebView2Controller_Vtbl, + 0x4d00c0d1_9434_4eb6_8078_8697a560334f +); +windows_core::imp::interface_hierarchy!(ICoreWebView2Controller, windows_core::IUnknown); +impl ICoreWebView2Controller { + pub unsafe fn IsVisible(&self, isvisible: *mut windows_core::BOOL) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).IsVisible)( + windows_core::Interface::as_raw(self), + isvisible as _, + ) + .ok() + } + } + pub unsafe fn SetIsVisible(&self, isvisible: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetIsVisible)( + windows_core::Interface::as_raw(self), + isvisible.into(), + ) + .ok() + } + } + pub unsafe fn Bounds( + &self, + bounds: *mut windows::Win32::Foundation::RECT, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Bounds)( + windows_core::Interface::as_raw(self), + bounds as _, + ) + .ok() + } + } + pub unsafe fn SetBounds( + &self, + bounds: windows::Win32::Foundation::RECT, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetBounds)( + windows_core::Interface::as_raw(self), + core::mem::transmute(bounds), + ) + .ok() + } + } + pub unsafe fn ZoomFactor(&self, zoomfactor: *mut f64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ZoomFactor)( + windows_core::Interface::as_raw(self), + zoomfactor as _, + ) + .ok() + } + } + pub unsafe fn SetZoomFactor(&self, zoomfactor: f64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetZoomFactor)( + windows_core::Interface::as_raw(self), + zoomfactor, + ) + .ok() + } + } + pub unsafe fn add_ZoomFactorChanged( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_ZoomFactorChanged)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_ZoomFactorChanged(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_ZoomFactorChanged)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } + pub unsafe fn SetBoundsAndZoomFactor( + &self, + bounds: windows::Win32::Foundation::RECT, + zoomfactor: f64, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetBoundsAndZoomFactor)( + windows_core::Interface::as_raw(self), + core::mem::transmute(bounds), + zoomfactor, + ) + .ok() + } + } + pub unsafe fn MoveFocus( + &self, + reason: COREWEBVIEW2_MOVE_FOCUS_REASON, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).MoveFocus)( + windows_core::Interface::as_raw(self), + reason, + ) + .ok() + } + } + pub unsafe fn add_MoveFocusRequested( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_MoveFocusRequested)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_MoveFocusRequested(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_MoveFocusRequested)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } + pub unsafe fn add_GotFocus( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_GotFocus)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_GotFocus(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_GotFocus)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } + pub unsafe fn add_LostFocus( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_LostFocus)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_LostFocus(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_LostFocus)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } + pub unsafe fn add_AcceleratorKeyPressed( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_AcceleratorKeyPressed)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_AcceleratorKeyPressed(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_AcceleratorKeyPressed)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } + pub unsafe fn ParentWindow( + &self, + parentwindow: *mut windows::Win32::Foundation::HWND, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ParentWindow)( + windows_core::Interface::as_raw(self), + parentwindow as _, + ) + .ok() + } + } + pub unsafe fn SetParentWindow( + &self, + parentwindow: windows::Win32::Foundation::HWND, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetParentWindow)( + windows_core::Interface::as_raw(self), + parentwindow, + ) + .ok() + } + } + pub unsafe fn NotifyParentWindowPositionChanged(&self) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).NotifyParentWindowPositionChanged)( + windows_core::Interface::as_raw(self), + ) + .ok() + } + } + pub unsafe fn Close(&self) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Close)(windows_core::Interface::as_raw(self)) + .ok() + } + } + pub unsafe fn CoreWebView2(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).CoreWebView2)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Controller_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub IsVisible: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetIsVisible: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, + pub Bounds: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows::Win32::Foundation::RECT, + ) -> windows_core::HRESULT, + pub SetBounds: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows::Win32::Foundation::RECT, + ) -> windows_core::HRESULT, + pub ZoomFactor: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut f64) -> windows_core::HRESULT, + pub SetZoomFactor: + unsafe extern "system" fn(*mut core::ffi::c_void, f64) -> windows_core::HRESULT, + pub add_ZoomFactorChanged: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_ZoomFactorChanged: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, + pub SetBoundsAndZoomFactor: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows::Win32::Foundation::RECT, + f64, + ) -> windows_core::HRESULT, + pub MoveFocus: unsafe extern "system" fn( + *mut core::ffi::c_void, + COREWEBVIEW2_MOVE_FOCUS_REASON, + ) -> windows_core::HRESULT, + pub add_MoveFocusRequested: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_MoveFocusRequested: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, + pub add_GotFocus: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_GotFocus: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, + pub add_LostFocus: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_LostFocus: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, + pub add_AcceleratorKeyPressed: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_AcceleratorKeyPressed: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, + pub ParentWindow: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows::Win32::Foundation::HWND, + ) -> windows_core::HRESULT, + pub SetParentWindow: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows::Win32::Foundation::HWND, + ) -> windows_core::HRESULT, + pub NotifyParentWindowPositionChanged: + unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT, + pub Close: unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT, + pub CoreWebView2: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Controller_Impl: windows_core::IUnknownImpl { + fn IsVisible(&self, isvisible: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn SetIsVisible(&self, isvisible: windows_core::BOOL) -> windows_core::Result<()>; + fn Bounds(&self, bounds: *mut windows::Win32::Foundation::RECT) -> windows_core::Result<()>; + fn SetBounds(&self, bounds: &windows::Win32::Foundation::RECT) -> windows_core::Result<()>; + fn ZoomFactor(&self, zoomfactor: *mut f64) -> windows_core::Result<()>; + fn SetZoomFactor(&self, zoomfactor: f64) -> windows_core::Result<()>; + fn add_ZoomFactorChanged( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2ZoomFactorChangedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_ZoomFactorChanged(&self, token: i64) -> windows_core::Result<()>; + fn SetBoundsAndZoomFactor( + &self, + bounds: &windows::Win32::Foundation::RECT, + zoomfactor: f64, + ) -> windows_core::Result<()>; + fn MoveFocus(&self, reason: COREWEBVIEW2_MOVE_FOCUS_REASON) -> windows_core::Result<()>; + fn add_MoveFocusRequested( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2MoveFocusRequestedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_MoveFocusRequested(&self, token: i64) -> windows_core::Result<()>; + fn add_GotFocus( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2FocusChangedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_GotFocus(&self, token: i64) -> windows_core::Result<()>; + fn add_LostFocus( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2FocusChangedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_LostFocus(&self, token: i64) -> windows_core::Result<()>; + fn add_AcceleratorKeyPressed( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2AcceleratorKeyPressedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_AcceleratorKeyPressed(&self, token: i64) -> windows_core::Result<()>; + fn ParentWindow( + &self, + parentwindow: *mut windows::Win32::Foundation::HWND, + ) -> windows_core::Result<()>; + fn SetParentWindow( + &self, + parentwindow: windows::Win32::Foundation::HWND, + ) -> windows_core::Result<()>; + fn NotifyParentWindowPositionChanged(&self) -> windows_core::Result<()>; + fn Close(&self) -> windows_core::Result<()>; + fn CoreWebView2(&self) -> windows_core::Result; +} +impl ICoreWebView2Controller_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn IsVisible< + Identity: ICoreWebView2Controller_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + isvisible: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Controller_Impl::IsVisible(this, core::mem::transmute_copy(&isvisible)) + .into() + } + } + unsafe extern "system" fn SetIsVisible< + Identity: ICoreWebView2Controller_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + isvisible: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Controller_Impl::SetIsVisible( + this, + core::mem::transmute_copy(&isvisible), + ) + .into() + } + } + unsafe extern "system" fn Bounds< + Identity: ICoreWebView2Controller_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + bounds: *mut windows::Win32::Foundation::RECT, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Controller_Impl::Bounds(this, core::mem::transmute_copy(&bounds)) + .into() + } + } + unsafe extern "system" fn SetBounds< + Identity: ICoreWebView2Controller_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + bounds: windows::Win32::Foundation::RECT, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Controller_Impl::SetBounds(this, core::mem::transmute(&bounds)).into() + } + } + unsafe extern "system" fn ZoomFactor< + Identity: ICoreWebView2Controller_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + zoomfactor: *mut f64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Controller_Impl::ZoomFactor( + this, + core::mem::transmute_copy(&zoomfactor), + ) + .into() + } + } + unsafe extern "system" fn SetZoomFactor< + Identity: ICoreWebView2Controller_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + zoomfactor: f64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Controller_Impl::SetZoomFactor( + this, + core::mem::transmute_copy(&zoomfactor), + ) + .into() + } + } + unsafe extern "system" fn add_ZoomFactorChanged< + Identity: ICoreWebView2Controller_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Controller_Impl::add_ZoomFactorChanged( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_ZoomFactorChanged< + Identity: ICoreWebView2Controller_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Controller_Impl::remove_ZoomFactorChanged( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn SetBoundsAndZoomFactor< + Identity: ICoreWebView2Controller_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + bounds: windows::Win32::Foundation::RECT, + zoomfactor: f64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Controller_Impl::SetBoundsAndZoomFactor( + this, + core::mem::transmute(&bounds), + core::mem::transmute_copy(&zoomfactor), + ) + .into() + } + } + unsafe extern "system" fn MoveFocus< + Identity: ICoreWebView2Controller_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + reason: COREWEBVIEW2_MOVE_FOCUS_REASON, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Controller_Impl::MoveFocus(this, core::mem::transmute_copy(&reason)) + .into() + } + } + unsafe extern "system" fn add_MoveFocusRequested< + Identity: ICoreWebView2Controller_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Controller_Impl::add_MoveFocusRequested( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_MoveFocusRequested< + Identity: ICoreWebView2Controller_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Controller_Impl::remove_MoveFocusRequested( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn add_GotFocus< + Identity: ICoreWebView2Controller_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Controller_Impl::add_GotFocus( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_GotFocus< + Identity: ICoreWebView2Controller_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Controller_Impl::remove_GotFocus( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn add_LostFocus< + Identity: ICoreWebView2Controller_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Controller_Impl::add_LostFocus( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_LostFocus< + Identity: ICoreWebView2Controller_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Controller_Impl::remove_LostFocus( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn add_AcceleratorKeyPressed< + Identity: ICoreWebView2Controller_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Controller_Impl::add_AcceleratorKeyPressed( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_AcceleratorKeyPressed< + Identity: ICoreWebView2Controller_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Controller_Impl::remove_AcceleratorKeyPressed( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn ParentWindow< + Identity: ICoreWebView2Controller_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + parentwindow: *mut windows::Win32::Foundation::HWND, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Controller_Impl::ParentWindow( + this, + core::mem::transmute_copy(&parentwindow), + ) + .into() + } + } + unsafe extern "system" fn SetParentWindow< + Identity: ICoreWebView2Controller_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + parentwindow: windows::Win32::Foundation::HWND, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Controller_Impl::SetParentWindow( + this, + core::mem::transmute_copy(&parentwindow), + ) + .into() + } + } + unsafe extern "system" fn NotifyParentWindowPositionChanged< + Identity: ICoreWebView2Controller_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Controller_Impl::NotifyParentWindowPositionChanged(this).into() + } + } + unsafe extern "system" fn Close< + Identity: ICoreWebView2Controller_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Controller_Impl::Close(this).into() + } + } + unsafe extern "system" fn CoreWebView2< + Identity: ICoreWebView2Controller_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + corewebview2: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2Controller_Impl::CoreWebView2(this) { + Ok(ok__) => { + corewebview2.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + IsVisible: IsVisible::, + SetIsVisible: SetIsVisible::, + Bounds: Bounds::, + SetBounds: SetBounds::, + ZoomFactor: ZoomFactor::, + SetZoomFactor: SetZoomFactor::, + add_ZoomFactorChanged: add_ZoomFactorChanged::, + remove_ZoomFactorChanged: remove_ZoomFactorChanged::, + SetBoundsAndZoomFactor: SetBoundsAndZoomFactor::, + MoveFocus: MoveFocus::, + add_MoveFocusRequested: add_MoveFocusRequested::, + remove_MoveFocusRequested: remove_MoveFocusRequested::, + add_GotFocus: add_GotFocus::, + remove_GotFocus: remove_GotFocus::, + add_LostFocus: add_LostFocus::, + remove_LostFocus: remove_LostFocus::, + add_AcceleratorKeyPressed: add_AcceleratorKeyPressed::, + remove_AcceleratorKeyPressed: remove_AcceleratorKeyPressed::, + ParentWindow: ParentWindow::, + SetParentWindow: SetParentWindow::, + NotifyParentWindowPositionChanged: NotifyParentWindowPositionChanged::, + Close: Close::, + CoreWebView2: CoreWebView2::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Controller {} +windows_core::imp::define_interface!( + ICoreWebView2Controller2, + ICoreWebView2Controller2_Vtbl, + 0xc979903e_d4ca_4228_92eb_47ee3fa96eab +); +impl core::ops::Deref for ICoreWebView2Controller2 { + type Target = ICoreWebView2Controller; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2Controller2, + windows_core::IUnknown, + ICoreWebView2Controller +); +impl ICoreWebView2Controller2 { + pub unsafe fn DefaultBackgroundColor( + &self, + value: *mut COREWEBVIEW2_COLOR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).DefaultBackgroundColor)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetDefaultBackgroundColor( + &self, + value: COREWEBVIEW2_COLOR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetDefaultBackgroundColor)( + windows_core::Interface::as_raw(self), + core::mem::transmute(value), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Controller2_Vtbl { + pub base__: ICoreWebView2Controller_Vtbl, + pub DefaultBackgroundColor: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_COLOR, + ) -> windows_core::HRESULT, + pub SetDefaultBackgroundColor: unsafe extern "system" fn( + *mut core::ffi::c_void, + COREWEBVIEW2_COLOR, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Controller2_Impl: ICoreWebView2Controller_Impl { + fn DefaultBackgroundColor(&self, value: *mut COREWEBVIEW2_COLOR) -> windows_core::Result<()>; + fn SetDefaultBackgroundColor(&self, value: &COREWEBVIEW2_COLOR) -> windows_core::Result<()>; +} +impl ICoreWebView2Controller2_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn DefaultBackgroundColor< + Identity: ICoreWebView2Controller2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut COREWEBVIEW2_COLOR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Controller2_Impl::DefaultBackgroundColor( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetDefaultBackgroundColor< + Identity: ICoreWebView2Controller2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: COREWEBVIEW2_COLOR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Controller2_Impl::SetDefaultBackgroundColor( + this, + core::mem::transmute(&value), + ) + .into() + } + } + Self { + base__: ICoreWebView2Controller_Vtbl::new::(), + DefaultBackgroundColor: DefaultBackgroundColor::, + SetDefaultBackgroundColor: SetDefaultBackgroundColor::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Controller2 {} +windows_core::imp::define_interface!( + ICoreWebView2Controller3, + ICoreWebView2Controller3_Vtbl, + 0xf9614724_5d2b_41dc_aef7_73d62b51543b +); +impl core::ops::Deref for ICoreWebView2Controller3 { + type Target = ICoreWebView2Controller2; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2Controller3, + windows_core::IUnknown, + ICoreWebView2Controller, + ICoreWebView2Controller2 +); +impl ICoreWebView2Controller3 { + pub unsafe fn RasterizationScale(&self, scale: *mut f64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).RasterizationScale)( + windows_core::Interface::as_raw(self), + scale as _, + ) + .ok() + } + } + pub unsafe fn SetRasterizationScale(&self, scale: f64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetRasterizationScale)( + windows_core::Interface::as_raw(self), + scale, + ) + .ok() + } + } + pub unsafe fn ShouldDetectMonitorScaleChanges( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ShouldDetectMonitorScaleChanges)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetShouldDetectMonitorScaleChanges( + &self, + value: bool, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetShouldDetectMonitorScaleChanges)( + windows_core::Interface::as_raw(self), + value.into(), + ) + .ok() + } + } + pub unsafe fn add_RasterizationScaleChanged( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_RasterizationScaleChanged)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_RasterizationScaleChanged(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_RasterizationScaleChanged)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } + pub unsafe fn BoundsMode( + &self, + boundsmode: *mut COREWEBVIEW2_BOUNDS_MODE, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).BoundsMode)( + windows_core::Interface::as_raw(self), + boundsmode as _, + ) + .ok() + } + } + pub unsafe fn SetBoundsMode( + &self, + boundsmode: COREWEBVIEW2_BOUNDS_MODE, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetBoundsMode)( + windows_core::Interface::as_raw(self), + boundsmode, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Controller3_Vtbl { + pub base__: ICoreWebView2Controller2_Vtbl, + pub RasterizationScale: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut f64) -> windows_core::HRESULT, + pub SetRasterizationScale: + unsafe extern "system" fn(*mut core::ffi::c_void, f64) -> windows_core::HRESULT, + pub ShouldDetectMonitorScaleChanges: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetShouldDetectMonitorScaleChanges: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, + pub add_RasterizationScaleChanged: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_RasterizationScaleChanged: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, + pub BoundsMode: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_BOUNDS_MODE, + ) -> windows_core::HRESULT, + pub SetBoundsMode: unsafe extern "system" fn( + *mut core::ffi::c_void, + COREWEBVIEW2_BOUNDS_MODE, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Controller3_Impl: ICoreWebView2Controller2_Impl { + fn RasterizationScale(&self, scale: *mut f64) -> windows_core::Result<()>; + fn SetRasterizationScale(&self, scale: f64) -> windows_core::Result<()>; + fn ShouldDetectMonitorScaleChanges( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()>; + fn SetShouldDetectMonitorScaleChanges( + &self, + value: windows_core::BOOL, + ) -> windows_core::Result<()>; + fn add_RasterizationScaleChanged( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2RasterizationScaleChangedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_RasterizationScaleChanged(&self, token: i64) -> windows_core::Result<()>; + fn BoundsMode(&self, boundsmode: *mut COREWEBVIEW2_BOUNDS_MODE) -> windows_core::Result<()>; + fn SetBoundsMode(&self, boundsmode: COREWEBVIEW2_BOUNDS_MODE) -> windows_core::Result<()>; +} +impl ICoreWebView2Controller3_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn RasterizationScale< + Identity: ICoreWebView2Controller3_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + scale: *mut f64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Controller3_Impl::RasterizationScale( + this, + core::mem::transmute_copy(&scale), + ) + .into() + } + } + unsafe extern "system" fn SetRasterizationScale< + Identity: ICoreWebView2Controller3_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + scale: f64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Controller3_Impl::SetRasterizationScale( + this, + core::mem::transmute_copy(&scale), + ) + .into() + } + } + unsafe extern "system" fn ShouldDetectMonitorScaleChanges< + Identity: ICoreWebView2Controller3_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Controller3_Impl::ShouldDetectMonitorScaleChanges( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetShouldDetectMonitorScaleChanges< + Identity: ICoreWebView2Controller3_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Controller3_Impl::SetShouldDetectMonitorScaleChanges( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn add_RasterizationScaleChanged< + Identity: ICoreWebView2Controller3_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Controller3_Impl::add_RasterizationScaleChanged( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_RasterizationScaleChanged< + Identity: ICoreWebView2Controller3_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Controller3_Impl::remove_RasterizationScaleChanged( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn BoundsMode< + Identity: ICoreWebView2Controller3_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + boundsmode: *mut COREWEBVIEW2_BOUNDS_MODE, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Controller3_Impl::BoundsMode( + this, + core::mem::transmute_copy(&boundsmode), + ) + .into() + } + } + unsafe extern "system" fn SetBoundsMode< + Identity: ICoreWebView2Controller3_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + boundsmode: COREWEBVIEW2_BOUNDS_MODE, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Controller3_Impl::SetBoundsMode( + this, + core::mem::transmute_copy(&boundsmode), + ) + .into() + } + } + Self { + base__: ICoreWebView2Controller2_Vtbl::new::(), + RasterizationScale: RasterizationScale::, + SetRasterizationScale: SetRasterizationScale::, + ShouldDetectMonitorScaleChanges: ShouldDetectMonitorScaleChanges::, + SetShouldDetectMonitorScaleChanges: SetShouldDetectMonitorScaleChanges::< + Identity, + OFFSET, + >, + add_RasterizationScaleChanged: add_RasterizationScaleChanged::, + remove_RasterizationScaleChanged: remove_RasterizationScaleChanged::, + BoundsMode: BoundsMode::, + SetBoundsMode: SetBoundsMode::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Controller3 {} +windows_core::imp::define_interface!( + ICoreWebView2Controller4, + ICoreWebView2Controller4_Vtbl, + 0x97d418d5_a426_4e49_a151_e1a10f327d9e +); +impl core::ops::Deref for ICoreWebView2Controller4 { + type Target = ICoreWebView2Controller3; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2Controller4, + windows_core::IUnknown, + ICoreWebView2Controller, + ICoreWebView2Controller2, + ICoreWebView2Controller3 +); +impl ICoreWebView2Controller4 { + pub unsafe fn AllowExternalDrop( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).AllowExternalDrop)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetAllowExternalDrop(&self, value: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetAllowExternalDrop)( + windows_core::Interface::as_raw(self), + value.into(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Controller4_Vtbl { + pub base__: ICoreWebView2Controller3_Vtbl, + pub AllowExternalDrop: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetAllowExternalDrop: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Controller4_Impl: ICoreWebView2Controller3_Impl { + fn AllowExternalDrop(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn SetAllowExternalDrop(&self, value: windows_core::BOOL) -> windows_core::Result<()>; +} +impl ICoreWebView2Controller4_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn AllowExternalDrop< + Identity: ICoreWebView2Controller4_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Controller4_Impl::AllowExternalDrop( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetAllowExternalDrop< + Identity: ICoreWebView2Controller4_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Controller4_Impl::SetAllowExternalDrop( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: ICoreWebView2Controller3_Vtbl::new::(), + AllowExternalDrop: AllowExternalDrop::, + SetAllowExternalDrop: SetAllowExternalDrop::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Controller4 {} +windows_core::imp::define_interface!( + ICoreWebView2ControllerOptions, + ICoreWebView2ControllerOptions_Vtbl, + 0x12aae616_8ccb_44ec_bcb3_eb1831881635 +); +windows_core::imp::interface_hierarchy!(ICoreWebView2ControllerOptions, windows_core::IUnknown); +impl ICoreWebView2ControllerOptions { + pub unsafe fn ProfileName(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ProfileName)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetProfileName(&self, value: P0) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).SetProfileName)( + windows_core::Interface::as_raw(self), + value.param().abi(), + ) + .ok() + } + } + pub unsafe fn IsInPrivateModeEnabled( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).IsInPrivateModeEnabled)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetIsInPrivateModeEnabled(&self, value: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetIsInPrivateModeEnabled)( + windows_core::Interface::as_raw(self), + value.into(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2ControllerOptions_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub ProfileName: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub SetProfileName: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + ) -> windows_core::HRESULT, + pub IsInPrivateModeEnabled: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetIsInPrivateModeEnabled: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2ControllerOptions_Impl: windows_core::IUnknownImpl { + fn ProfileName(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn SetProfileName(&self, value: &windows_core::PCWSTR) -> windows_core::Result<()>; + fn IsInPrivateModeEnabled(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn SetIsInPrivateModeEnabled(&self, value: windows_core::BOOL) -> windows_core::Result<()>; +} +impl ICoreWebView2ControllerOptions_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn ProfileName< + Identity: ICoreWebView2ControllerOptions_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ControllerOptions_Impl::ProfileName( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetProfileName< + Identity: ICoreWebView2ControllerOptions_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::PCWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ControllerOptions_Impl::SetProfileName( + this, + core::mem::transmute(&value), + ) + .into() + } + } + unsafe extern "system" fn IsInPrivateModeEnabled< + Identity: ICoreWebView2ControllerOptions_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ControllerOptions_Impl::IsInPrivateModeEnabled( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetIsInPrivateModeEnabled< + Identity: ICoreWebView2ControllerOptions_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ControllerOptions_Impl::SetIsInPrivateModeEnabled( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + ProfileName: ProfileName::, + SetProfileName: SetProfileName::, + IsInPrivateModeEnabled: IsInPrivateModeEnabled::, + SetIsInPrivateModeEnabled: SetIsInPrivateModeEnabled::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2ControllerOptions {} +windows_core::imp::define_interface!( + ICoreWebView2ControllerOptions2, + ICoreWebView2ControllerOptions2_Vtbl, + 0x06c991d8_9e7e_11ed_a8fc_0242ac120002 +); +impl core::ops::Deref for ICoreWebView2ControllerOptions2 { + type Target = ICoreWebView2ControllerOptions; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2ControllerOptions2, + windows_core::IUnknown, + ICoreWebView2ControllerOptions +); +impl ICoreWebView2ControllerOptions2 { + pub unsafe fn ScriptLocale(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ScriptLocale)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetScriptLocale(&self, value: P0) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).SetScriptLocale)( + windows_core::Interface::as_raw(self), + value.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2ControllerOptions2_Vtbl { + pub base__: ICoreWebView2ControllerOptions_Vtbl, + pub ScriptLocale: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub SetScriptLocale: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2ControllerOptions2_Impl: ICoreWebView2ControllerOptions_Impl { + fn ScriptLocale(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn SetScriptLocale(&self, value: &windows_core::PCWSTR) -> windows_core::Result<()>; +} +impl ICoreWebView2ControllerOptions2_Vtbl { + pub const fn new() -> Self + { + unsafe extern "system" fn ScriptLocale< + Identity: ICoreWebView2ControllerOptions2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ControllerOptions2_Impl::ScriptLocale( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetScriptLocale< + Identity: ICoreWebView2ControllerOptions2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::PCWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ControllerOptions2_Impl::SetScriptLocale( + this, + core::mem::transmute(&value), + ) + .into() + } + } + Self { + base__: ICoreWebView2ControllerOptions_Vtbl::new::(), + ScriptLocale: ScriptLocale::, + SetScriptLocale: SetScriptLocale::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2ControllerOptions2 {} +windows_core::imp::define_interface!( + ICoreWebView2ControllerOptions3, + ICoreWebView2ControllerOptions3_Vtbl, + 0xb32b191a_8998_57ca_b7cb_e04617e4ce4a +); +impl core::ops::Deref for ICoreWebView2ControllerOptions3 { + type Target = ICoreWebView2ControllerOptions2; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2ControllerOptions3, + windows_core::IUnknown, + ICoreWebView2ControllerOptions, + ICoreWebView2ControllerOptions2 +); +impl ICoreWebView2ControllerOptions3 { + pub unsafe fn DefaultBackgroundColor( + &self, + value: *mut COREWEBVIEW2_COLOR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).DefaultBackgroundColor)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetDefaultBackgroundColor( + &self, + value: COREWEBVIEW2_COLOR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetDefaultBackgroundColor)( + windows_core::Interface::as_raw(self), + core::mem::transmute(value), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2ControllerOptions3_Vtbl { + pub base__: ICoreWebView2ControllerOptions2_Vtbl, + pub DefaultBackgroundColor: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_COLOR, + ) -> windows_core::HRESULT, + pub SetDefaultBackgroundColor: unsafe extern "system" fn( + *mut core::ffi::c_void, + COREWEBVIEW2_COLOR, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2ControllerOptions3_Impl: ICoreWebView2ControllerOptions2_Impl { + fn DefaultBackgroundColor(&self, value: *mut COREWEBVIEW2_COLOR) -> windows_core::Result<()>; + fn SetDefaultBackgroundColor(&self, value: &COREWEBVIEW2_COLOR) -> windows_core::Result<()>; +} +impl ICoreWebView2ControllerOptions3_Vtbl { + pub const fn new() -> Self + { + unsafe extern "system" fn DefaultBackgroundColor< + Identity: ICoreWebView2ControllerOptions3_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut COREWEBVIEW2_COLOR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ControllerOptions3_Impl::DefaultBackgroundColor( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetDefaultBackgroundColor< + Identity: ICoreWebView2ControllerOptions3_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: COREWEBVIEW2_COLOR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ControllerOptions3_Impl::SetDefaultBackgroundColor( + this, + core::mem::transmute(&value), + ) + .into() + } + } + Self { + base__: ICoreWebView2ControllerOptions2_Vtbl::new::(), + DefaultBackgroundColor: DefaultBackgroundColor::, + SetDefaultBackgroundColor: SetDefaultBackgroundColor::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2ControllerOptions3 {} +windows_core::imp::define_interface!( + ICoreWebView2ControllerOptions4, + ICoreWebView2ControllerOptions4_Vtbl, + 0x21eb052f_ad39_555e_824a_c87b091d4d36 +); +impl core::ops::Deref for ICoreWebView2ControllerOptions4 { + type Target = ICoreWebView2ControllerOptions3; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2ControllerOptions4, + windows_core::IUnknown, + ICoreWebView2ControllerOptions, + ICoreWebView2ControllerOptions2, + ICoreWebView2ControllerOptions3 +); +impl ICoreWebView2ControllerOptions4 { + pub unsafe fn AllowHostInputProcessing( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).AllowHostInputProcessing)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetAllowHostInputProcessing(&self, value: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetAllowHostInputProcessing)( + windows_core::Interface::as_raw(self), + value.into(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2ControllerOptions4_Vtbl { + pub base__: ICoreWebView2ControllerOptions3_Vtbl, + pub AllowHostInputProcessing: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetAllowHostInputProcessing: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2ControllerOptions4_Impl: ICoreWebView2ControllerOptions3_Impl { + fn AllowHostInputProcessing(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn SetAllowHostInputProcessing(&self, value: windows_core::BOOL) -> windows_core::Result<()>; +} +impl ICoreWebView2ControllerOptions4_Vtbl { + pub const fn new() -> Self + { + unsafe extern "system" fn AllowHostInputProcessing< + Identity: ICoreWebView2ControllerOptions4_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ControllerOptions4_Impl::AllowHostInputProcessing( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetAllowHostInputProcessing< + Identity: ICoreWebView2ControllerOptions4_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ControllerOptions4_Impl::SetAllowHostInputProcessing( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: ICoreWebView2ControllerOptions3_Vtbl::new::(), + AllowHostInputProcessing: AllowHostInputProcessing::, + SetAllowHostInputProcessing: SetAllowHostInputProcessing::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2ControllerOptions4 {} +windows_core::imp::define_interface!( + ICoreWebView2Cookie, + ICoreWebView2Cookie_Vtbl, + 0xad26d6be_1486_43e6_bf87_a2034006ca21 +); +windows_core::imp::interface_hierarchy!(ICoreWebView2Cookie, windows_core::IUnknown); +impl ICoreWebView2Cookie { + pub unsafe fn Name(&self, name: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Name)( + windows_core::Interface::as_raw(self), + name as _, + ) + .ok() + } + } + pub unsafe fn Value(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Value)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetValue(&self, value: P0) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).SetValue)( + windows_core::Interface::as_raw(self), + value.param().abi(), + ) + .ok() + } + } + pub unsafe fn Domain(&self, domain: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Domain)( + windows_core::Interface::as_raw(self), + domain as _, + ) + .ok() + } + } + pub unsafe fn Path(&self, path: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Path)( + windows_core::Interface::as_raw(self), + path as _, + ) + .ok() + } + } + pub unsafe fn Expires(&self, expires: *mut f64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Expires)( + windows_core::Interface::as_raw(self), + expires as _, + ) + .ok() + } + } + pub unsafe fn SetExpires(&self, expires: f64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetExpires)( + windows_core::Interface::as_raw(self), + expires, + ) + .ok() + } + } + pub unsafe fn IsHttpOnly( + &self, + ishttponly: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).IsHttpOnly)( + windows_core::Interface::as_raw(self), + ishttponly as _, + ) + .ok() + } + } + pub unsafe fn SetIsHttpOnly(&self, ishttponly: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetIsHttpOnly)( + windows_core::Interface::as_raw(self), + ishttponly.into(), + ) + .ok() + } + } + pub unsafe fn SameSite( + &self, + samesite: *mut COREWEBVIEW2_COOKIE_SAME_SITE_KIND, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SameSite)( + windows_core::Interface::as_raw(self), + samesite as _, + ) + .ok() + } + } + pub unsafe fn SetSameSite( + &self, + samesite: COREWEBVIEW2_COOKIE_SAME_SITE_KIND, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetSameSite)( + windows_core::Interface::as_raw(self), + samesite, + ) + .ok() + } + } + pub unsafe fn IsSecure(&self, issecure: *mut windows_core::BOOL) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).IsSecure)( + windows_core::Interface::as_raw(self), + issecure as _, + ) + .ok() + } + } + pub unsafe fn SetIsSecure(&self, issecure: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetIsSecure)( + windows_core::Interface::as_raw(self), + issecure.into(), + ) + .ok() + } + } + pub unsafe fn IsSession(&self, issession: *mut windows_core::BOOL) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).IsSession)( + windows_core::Interface::as_raw(self), + issession as _, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Cookie_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Name: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub Value: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub SetValue: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + ) -> windows_core::HRESULT, + pub Domain: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub Path: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub Expires: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut f64) -> windows_core::HRESULT, + pub SetExpires: unsafe extern "system" fn(*mut core::ffi::c_void, f64) -> windows_core::HRESULT, + pub IsHttpOnly: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetIsHttpOnly: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SameSite: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_COOKIE_SAME_SITE_KIND, + ) -> windows_core::HRESULT, + pub SetSameSite: unsafe extern "system" fn( + *mut core::ffi::c_void, + COREWEBVIEW2_COOKIE_SAME_SITE_KIND, + ) -> windows_core::HRESULT, + pub IsSecure: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetIsSecure: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, + pub IsSession: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Cookie_Impl: windows_core::IUnknownImpl { + fn Name(&self, name: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn Value(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn SetValue(&self, value: &windows_core::PCWSTR) -> windows_core::Result<()>; + fn Domain(&self, domain: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn Path(&self, path: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn Expires(&self, expires: *mut f64) -> windows_core::Result<()>; + fn SetExpires(&self, expires: f64) -> windows_core::Result<()>; + fn IsHttpOnly(&self, ishttponly: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn SetIsHttpOnly(&self, ishttponly: windows_core::BOOL) -> windows_core::Result<()>; + fn SameSite( + &self, + samesite: *mut COREWEBVIEW2_COOKIE_SAME_SITE_KIND, + ) -> windows_core::Result<()>; + fn SetSameSite(&self, samesite: COREWEBVIEW2_COOKIE_SAME_SITE_KIND) + -> windows_core::Result<()>; + fn IsSecure(&self, issecure: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn SetIsSecure(&self, issecure: windows_core::BOOL) -> windows_core::Result<()>; + fn IsSession(&self, issession: *mut windows_core::BOOL) -> windows_core::Result<()>; +} +impl ICoreWebView2Cookie_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn Name( + this: *mut core::ffi::c_void, + name: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Cookie_Impl::Name(this, core::mem::transmute_copy(&name)).into() + } + } + unsafe extern "system" fn Value( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Cookie_Impl::Value(this, core::mem::transmute_copy(&value)).into() + } + } + unsafe extern "system" fn SetValue< + Identity: ICoreWebView2Cookie_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::PCWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Cookie_Impl::SetValue(this, core::mem::transmute(&value)).into() + } + } + unsafe extern "system" fn Domain< + Identity: ICoreWebView2Cookie_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + domain: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Cookie_Impl::Domain(this, core::mem::transmute_copy(&domain)).into() + } + } + unsafe extern "system" fn Path( + this: *mut core::ffi::c_void, + path: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Cookie_Impl::Path(this, core::mem::transmute_copy(&path)).into() + } + } + unsafe extern "system" fn Expires< + Identity: ICoreWebView2Cookie_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + expires: *mut f64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Cookie_Impl::Expires(this, core::mem::transmute_copy(&expires)).into() + } + } + unsafe extern "system" fn SetExpires< + Identity: ICoreWebView2Cookie_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + expires: f64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Cookie_Impl::SetExpires(this, core::mem::transmute_copy(&expires)) + .into() + } + } + unsafe extern "system" fn IsHttpOnly< + Identity: ICoreWebView2Cookie_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + ishttponly: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Cookie_Impl::IsHttpOnly(this, core::mem::transmute_copy(&ishttponly)) + .into() + } + } + unsafe extern "system" fn SetIsHttpOnly< + Identity: ICoreWebView2Cookie_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + ishttponly: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Cookie_Impl::SetIsHttpOnly( + this, + core::mem::transmute_copy(&ishttponly), + ) + .into() + } + } + unsafe extern "system" fn SameSite< + Identity: ICoreWebView2Cookie_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + samesite: *mut COREWEBVIEW2_COOKIE_SAME_SITE_KIND, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Cookie_Impl::SameSite(this, core::mem::transmute_copy(&samesite)) + .into() + } + } + unsafe extern "system" fn SetSameSite< + Identity: ICoreWebView2Cookie_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + samesite: COREWEBVIEW2_COOKIE_SAME_SITE_KIND, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Cookie_Impl::SetSameSite(this, core::mem::transmute_copy(&samesite)) + .into() + } + } + unsafe extern "system" fn IsSecure< + Identity: ICoreWebView2Cookie_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + issecure: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Cookie_Impl::IsSecure(this, core::mem::transmute_copy(&issecure)) + .into() + } + } + unsafe extern "system" fn SetIsSecure< + Identity: ICoreWebView2Cookie_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + issecure: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Cookie_Impl::SetIsSecure(this, core::mem::transmute_copy(&issecure)) + .into() + } + } + unsafe extern "system" fn IsSession< + Identity: ICoreWebView2Cookie_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + issession: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Cookie_Impl::IsSession(this, core::mem::transmute_copy(&issession)) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Name: Name::, + Value: Value::, + SetValue: SetValue::, + Domain: Domain::, + Path: Path::, + Expires: Expires::, + SetExpires: SetExpires::, + IsHttpOnly: IsHttpOnly::, + SetIsHttpOnly: SetIsHttpOnly::, + SameSite: SameSite::, + SetSameSite: SetSameSite::, + IsSecure: IsSecure::, + SetIsSecure: SetIsSecure::, + IsSession: IsSession::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Cookie {} +windows_core::imp::define_interface!( + ICoreWebView2CookieList, + ICoreWebView2CookieList_Vtbl, + 0xf7f6f714_5d2a_43c6_9503_346ece02d186 +); +windows_core::imp::interface_hierarchy!(ICoreWebView2CookieList, windows_core::IUnknown); +impl ICoreWebView2CookieList { + pub unsafe fn Count(&self, value: *mut u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Count)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn GetValueAtIndex(&self, index: u32) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).GetValueAtIndex)( + windows_core::Interface::as_raw(self), + index, + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2CookieList_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Count: unsafe extern "system" fn(*mut core::ffi::c_void, *mut u32) -> windows_core::HRESULT, + pub GetValueAtIndex: unsafe extern "system" fn( + *mut core::ffi::c_void, + u32, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2CookieList_Impl: windows_core::IUnknownImpl { + fn Count(&self, value: *mut u32) -> windows_core::Result<()>; + fn GetValueAtIndex(&self, index: u32) -> windows_core::Result; +} +impl ICoreWebView2CookieList_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn Count< + Identity: ICoreWebView2CookieList_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2CookieList_Impl::Count(this, core::mem::transmute_copy(&value)).into() + } + } + unsafe extern "system" fn GetValueAtIndex< + Identity: ICoreWebView2CookieList_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + index: u32, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2CookieList_Impl::GetValueAtIndex( + this, + core::mem::transmute_copy(&index), + ) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Count: Count::, + GetValueAtIndex: GetValueAtIndex::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2CookieList {} +windows_core::imp::define_interface!( + ICoreWebView2CookieManager, + ICoreWebView2CookieManager_Vtbl, + 0x177cd9e7_b6f5_451a_94a0_5d7a3a4c4141 +); +windows_core::imp::interface_hierarchy!(ICoreWebView2CookieManager, windows_core::IUnknown); +impl ICoreWebView2CookieManager { + pub unsafe fn CreateCookie( + &self, + name: P0, + value: P1, + domain: P2, + path: P3, + ) -> windows_core::Result + where + P0: windows_core::Param, + P1: windows_core::Param, + P2: windows_core::Param, + P3: windows_core::Param, + { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).CreateCookie)( + windows_core::Interface::as_raw(self), + name.param().abi(), + value.param().abi(), + domain.param().abi(), + path.param().abi(), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } + pub unsafe fn CopyCookie( + &self, + cookieparam: P0, + ) -> windows_core::Result + where + P0: windows_core::Param, + { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).CopyCookie)( + windows_core::Interface::as_raw(self), + cookieparam.param().abi(), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } + pub unsafe fn GetCookies(&self, uri: P0, handler: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).GetCookies)( + windows_core::Interface::as_raw(self), + uri.param().abi(), + handler.param().abi(), + ) + .ok() + } + } + pub unsafe fn AddOrUpdateCookie(&self, cookie: P0) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).AddOrUpdateCookie)( + windows_core::Interface::as_raw(self), + cookie.param().abi(), + ) + .ok() + } + } + pub unsafe fn DeleteCookie(&self, cookie: P0) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).DeleteCookie)( + windows_core::Interface::as_raw(self), + cookie.param().abi(), + ) + .ok() + } + } + pub unsafe fn DeleteCookies(&self, name: P0, uri: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).DeleteCookies)( + windows_core::Interface::as_raw(self), + name.param().abi(), + uri.param().abi(), + ) + .ok() + } + } + pub unsafe fn DeleteCookiesWithDomainAndPath( + &self, + name: P0, + domain: P1, + path: P2, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + P2: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).DeleteCookiesWithDomainAndPath)( + windows_core::Interface::as_raw(self), + name.param().abi(), + domain.param().abi(), + path.param().abi(), + ) + .ok() + } + } + pub unsafe fn DeleteAllCookies(&self) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).DeleteAllCookies)( + windows_core::Interface::as_raw(self), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2CookieManager_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub CreateCookie: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + windows_core::PCWSTR, + windows_core::PCWSTR, + windows_core::PCWSTR, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub CopyCookie: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub GetCookies: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub AddOrUpdateCookie: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub DeleteCookie: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub DeleteCookies: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + windows_core::PCWSTR, + ) -> windows_core::HRESULT, + pub DeleteCookiesWithDomainAndPath: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + windows_core::PCWSTR, + windows_core::PCWSTR, + ) -> windows_core::HRESULT, + pub DeleteAllCookies: + unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT, +} +pub trait ICoreWebView2CookieManager_Impl: windows_core::IUnknownImpl { + fn CreateCookie( + &self, + name: &windows_core::PCWSTR, + value: &windows_core::PCWSTR, + domain: &windows_core::PCWSTR, + path: &windows_core::PCWSTR, + ) -> windows_core::Result; + fn CopyCookie( + &self, + cookieparam: windows_core::Ref<'_, ICoreWebView2Cookie>, + ) -> windows_core::Result; + fn GetCookies( + &self, + uri: &windows_core::PCWSTR, + handler: windows_core::Ref<'_, ICoreWebView2GetCookiesCompletedHandler>, + ) -> windows_core::Result<()>; + fn AddOrUpdateCookie( + &self, + cookie: windows_core::Ref<'_, ICoreWebView2Cookie>, + ) -> windows_core::Result<()>; + fn DeleteCookie( + &self, + cookie: windows_core::Ref<'_, ICoreWebView2Cookie>, + ) -> windows_core::Result<()>; + fn DeleteCookies( + &self, + name: &windows_core::PCWSTR, + uri: &windows_core::PCWSTR, + ) -> windows_core::Result<()>; + fn DeleteCookiesWithDomainAndPath( + &self, + name: &windows_core::PCWSTR, + domain: &windows_core::PCWSTR, + path: &windows_core::PCWSTR, + ) -> windows_core::Result<()>; + fn DeleteAllCookies(&self) -> windows_core::Result<()>; +} +impl ICoreWebView2CookieManager_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn CreateCookie< + Identity: ICoreWebView2CookieManager_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + name: windows_core::PCWSTR, + value: windows_core::PCWSTR, + domain: windows_core::PCWSTR, + path: windows_core::PCWSTR, + cookie: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2CookieManager_Impl::CreateCookie( + this, + core::mem::transmute(&name), + core::mem::transmute(&value), + core::mem::transmute(&domain), + core::mem::transmute(&path), + ) { + Ok(ok__) => { + cookie.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + unsafe extern "system" fn CopyCookie< + Identity: ICoreWebView2CookieManager_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + cookieparam: *mut core::ffi::c_void, + cookie: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2CookieManager_Impl::CopyCookie( + this, + core::mem::transmute_copy(&cookieparam), + ) { + Ok(ok__) => { + cookie.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + unsafe extern "system" fn GetCookies< + Identity: ICoreWebView2CookieManager_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + uri: windows_core::PCWSTR, + handler: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2CookieManager_Impl::GetCookies( + this, + core::mem::transmute(&uri), + core::mem::transmute_copy(&handler), + ) + .into() + } + } + unsafe extern "system" fn AddOrUpdateCookie< + Identity: ICoreWebView2CookieManager_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + cookie: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2CookieManager_Impl::AddOrUpdateCookie( + this, + core::mem::transmute_copy(&cookie), + ) + .into() + } + } + unsafe extern "system" fn DeleteCookie< + Identity: ICoreWebView2CookieManager_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + cookie: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2CookieManager_Impl::DeleteCookie( + this, + core::mem::transmute_copy(&cookie), + ) + .into() + } + } + unsafe extern "system" fn DeleteCookies< + Identity: ICoreWebView2CookieManager_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + name: windows_core::PCWSTR, + uri: windows_core::PCWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2CookieManager_Impl::DeleteCookies( + this, + core::mem::transmute(&name), + core::mem::transmute(&uri), + ) + .into() + } + } + unsafe extern "system" fn DeleteCookiesWithDomainAndPath< + Identity: ICoreWebView2CookieManager_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + name: windows_core::PCWSTR, + domain: windows_core::PCWSTR, + path: windows_core::PCWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2CookieManager_Impl::DeleteCookiesWithDomainAndPath( + this, + core::mem::transmute(&name), + core::mem::transmute(&domain), + core::mem::transmute(&path), + ) + .into() + } + } + unsafe extern "system" fn DeleteAllCookies< + Identity: ICoreWebView2CookieManager_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2CookieManager_Impl::DeleteAllCookies(this).into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + CreateCookie: CreateCookie::, + CopyCookie: CopyCookie::, + GetCookies: GetCookies::, + AddOrUpdateCookie: AddOrUpdateCookie::, + DeleteCookie: DeleteCookie::, + DeleteCookies: DeleteCookies::, + DeleteCookiesWithDomainAndPath: DeleteCookiesWithDomainAndPath::, + DeleteAllCookies: DeleteAllCookies::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2CookieManager {} +windows_core::imp::define_interface!( + ICoreWebView2CreateCoreWebView2CompositionControllerCompletedHandler, + ICoreWebView2CreateCoreWebView2CompositionControllerCompletedHandler_Vtbl, + 0x02fab84b_1428_4fb7_ad45_1b2e64736184 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2CreateCoreWebView2CompositionControllerCompletedHandler, + windows_core::IUnknown +); +impl ICoreWebView2CreateCoreWebView2CompositionControllerCompletedHandler { + pub unsafe fn Invoke( + &self, + errorcode: windows_core::HRESULT, + result: P1, + ) -> windows_core::Result<()> + where + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + errorcode, + result.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2CreateCoreWebView2CompositionControllerCompletedHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::HRESULT, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2CreateCoreWebView2CompositionControllerCompletedHandler_Impl: + windows_core::IUnknownImpl +{ + fn Invoke( + &self, + errorcode: windows_core::HRESULT, + result: windows_core::Ref<'_, ICoreWebView2CompositionController>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2CreateCoreWebView2CompositionControllerCompletedHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2CreateCoreWebView2CompositionControllerCompletedHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2CreateCoreWebView2CompositionControllerCompletedHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + errorcode: windows_core::HRESULT, + result: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2CreateCoreWebView2CompositionControllerCompletedHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&errorcode), + core::mem::transmute_copy(&result), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == & < ICoreWebView2CreateCoreWebView2CompositionControllerCompletedHandler as windows_core::Interface >::IID + } +} +impl windows_core::RuntimeName + for ICoreWebView2CreateCoreWebView2CompositionControllerCompletedHandler +{ +} +windows_core::imp::define_interface!( + ICoreWebView2CreateCoreWebView2ControllerCompletedHandler, + ICoreWebView2CreateCoreWebView2ControllerCompletedHandler_Vtbl, + 0x6c4819f3_c9b7_4260_8127_c9f5bde7f68c +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2CreateCoreWebView2ControllerCompletedHandler, + windows_core::IUnknown +); +impl ICoreWebView2CreateCoreWebView2ControllerCompletedHandler { + pub unsafe fn Invoke( + &self, + errorcode: windows_core::HRESULT, + result: P1, + ) -> windows_core::Result<()> + where + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + errorcode, + result.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2CreateCoreWebView2ControllerCompletedHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::HRESULT, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2CreateCoreWebView2ControllerCompletedHandler_Impl: + windows_core::IUnknownImpl +{ + fn Invoke( + &self, + errorcode: windows_core::HRESULT, + result: windows_core::Ref<'_, ICoreWebView2Controller>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2CreateCoreWebView2ControllerCompletedHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2CreateCoreWebView2ControllerCompletedHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2CreateCoreWebView2ControllerCompletedHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + errorcode: windows_core::HRESULT, + result: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2CreateCoreWebView2ControllerCompletedHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&errorcode), + core::mem::transmute_copy(&result), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == & < ICoreWebView2CreateCoreWebView2ControllerCompletedHandler as windows_core::Interface >::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2CreateCoreWebView2ControllerCompletedHandler {} +windows_core::imp::define_interface!( + ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler, + ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler_Vtbl, + 0x4e8a3389_c9d8_4bd2_b6b5_124fee6cc14d +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler, + windows_core::IUnknown +); +impl ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler { + pub unsafe fn Invoke( + &self, + errorcode: windows_core::HRESULT, + result: P1, + ) -> windows_core::Result<()> + where + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + errorcode, + result.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::HRESULT, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler_Impl: + windows_core::IUnknownImpl +{ + fn Invoke( + &self, + errorcode: windows_core::HRESULT, + result: windows_core::Ref<'_, ICoreWebView2Environment>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + errorcode: windows_core::HRESULT, + result: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&errorcode), + core::mem::transmute_copy(&result), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == & < ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler as windows_core::Interface >::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler {} +windows_core::imp::define_interface!( + ICoreWebView2CursorChangedEventHandler, + ICoreWebView2CursorChangedEventHandler_Vtbl, + 0x9da43ccc_26e1_4dad_b56c_d8961c94c571 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2CursorChangedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2CursorChangedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2CursorChangedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2CursorChangedEventHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2CompositionController>, + args: windows_core::Ref<'_, windows_core::IUnknown>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2CursorChangedEventHandler_Vtbl { + pub const fn new( + ) -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2CursorChangedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2CursorChangedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2CursorChangedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2CustomItemSelectedEventHandler, + ICoreWebView2CustomItemSelectedEventHandler_Vtbl, + 0x49e1d0bc_fe9e_4481_b7c2_32324aa21998 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2CustomItemSelectedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2CustomItemSelectedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2CustomItemSelectedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2CustomItemSelectedEventHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2ContextMenuItem>, + args: windows_core::Ref<'_, windows_core::IUnknown>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2CustomItemSelectedEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2CustomItemSelectedEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2CustomItemSelectedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2CustomItemSelectedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2CustomItemSelectedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2CustomSchemeRegistration, + ICoreWebView2CustomSchemeRegistration_Vtbl, + 0xd60ac92c_37a6_4b26_a39e_95cfe59047bb +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2CustomSchemeRegistration, + windows_core::IUnknown +); +impl ICoreWebView2CustomSchemeRegistration { + pub unsafe fn SchemeName( + &self, + schemename: *mut windows_core::PWSTR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SchemeName)( + windows_core::Interface::as_raw(self), + schemename as _, + ) + .ok() + } + } + pub unsafe fn TreatAsSecure( + &self, + treatassecure: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).TreatAsSecure)( + windows_core::Interface::as_raw(self), + treatassecure as _, + ) + .ok() + } + } + pub unsafe fn SetTreatAsSecure(&self, value: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetTreatAsSecure)( + windows_core::Interface::as_raw(self), + value.into(), + ) + .ok() + } + } + pub unsafe fn GetAllowedOrigins( + &self, + allowedoriginscount: *mut u32, + allowedorigins: *mut *mut windows_core::PWSTR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).GetAllowedOrigins)( + windows_core::Interface::as_raw(self), + allowedoriginscount as _, + allowedorigins as _, + ) + .ok() + } + } + pub unsafe fn SetAllowedOrigins( + &self, + allowedoriginscount: u32, + allowedorigins: *const windows_core::PCWSTR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetAllowedOrigins)( + windows_core::Interface::as_raw(self), + allowedoriginscount, + allowedorigins, + ) + .ok() + } + } + pub unsafe fn HasAuthorityComponent( + &self, + hasauthoritycomponent: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).HasAuthorityComponent)( + windows_core::Interface::as_raw(self), + hasauthoritycomponent as _, + ) + .ok() + } + } + pub unsafe fn SetHasAuthorityComponent( + &self, + hasauthoritycomponent: bool, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetHasAuthorityComponent)( + windows_core::Interface::as_raw(self), + hasauthoritycomponent.into(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2CustomSchemeRegistration_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub SchemeName: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub TreatAsSecure: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetTreatAsSecure: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, + pub GetAllowedOrigins: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut u32, + *mut *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub SetAllowedOrigins: unsafe extern "system" fn( + *mut core::ffi::c_void, + u32, + *const windows_core::PCWSTR, + ) -> windows_core::HRESULT, + pub HasAuthorityComponent: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetHasAuthorityComponent: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2CustomSchemeRegistration_Impl: windows_core::IUnknownImpl { + fn SchemeName(&self, schemename: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn TreatAsSecure(&self, treatassecure: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn SetTreatAsSecure(&self, value: windows_core::BOOL) -> windows_core::Result<()>; + fn GetAllowedOrigins( + &self, + allowedoriginscount: *mut u32, + allowedorigins: *mut *mut windows_core::PWSTR, + ) -> windows_core::Result<()>; + fn SetAllowedOrigins( + &self, + allowedoriginscount: u32, + allowedorigins: *const windows_core::PCWSTR, + ) -> windows_core::Result<()>; + fn HasAuthorityComponent( + &self, + hasauthoritycomponent: *mut windows_core::BOOL, + ) -> windows_core::Result<()>; + fn SetHasAuthorityComponent( + &self, + hasauthoritycomponent: windows_core::BOOL, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2CustomSchemeRegistration_Vtbl { + pub const fn new( + ) -> Self { + unsafe extern "system" fn SchemeName< + Identity: ICoreWebView2CustomSchemeRegistration_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + schemename: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2CustomSchemeRegistration_Impl::SchemeName( + this, + core::mem::transmute_copy(&schemename), + ) + .into() + } + } + unsafe extern "system" fn TreatAsSecure< + Identity: ICoreWebView2CustomSchemeRegistration_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + treatassecure: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2CustomSchemeRegistration_Impl::TreatAsSecure( + this, + core::mem::transmute_copy(&treatassecure), + ) + .into() + } + } + unsafe extern "system" fn SetTreatAsSecure< + Identity: ICoreWebView2CustomSchemeRegistration_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2CustomSchemeRegistration_Impl::SetTreatAsSecure( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn GetAllowedOrigins< + Identity: ICoreWebView2CustomSchemeRegistration_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + allowedoriginscount: *mut u32, + allowedorigins: *mut *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2CustomSchemeRegistration_Impl::GetAllowedOrigins( + this, + core::mem::transmute_copy(&allowedoriginscount), + core::mem::transmute_copy(&allowedorigins), + ) + .into() + } + } + unsafe extern "system" fn SetAllowedOrigins< + Identity: ICoreWebView2CustomSchemeRegistration_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + allowedoriginscount: u32, + allowedorigins: *const windows_core::PCWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2CustomSchemeRegistration_Impl::SetAllowedOrigins( + this, + core::mem::transmute_copy(&allowedoriginscount), + core::mem::transmute_copy(&allowedorigins), + ) + .into() + } + } + unsafe extern "system" fn HasAuthorityComponent< + Identity: ICoreWebView2CustomSchemeRegistration_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + hasauthoritycomponent: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2CustomSchemeRegistration_Impl::HasAuthorityComponent( + this, + core::mem::transmute_copy(&hasauthoritycomponent), + ) + .into() + } + } + unsafe extern "system" fn SetHasAuthorityComponent< + Identity: ICoreWebView2CustomSchemeRegistration_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + hasauthoritycomponent: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2CustomSchemeRegistration_Impl::SetHasAuthorityComponent( + this, + core::mem::transmute_copy(&hasauthoritycomponent), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + SchemeName: SchemeName::, + TreatAsSecure: TreatAsSecure::, + SetTreatAsSecure: SetTreatAsSecure::, + GetAllowedOrigins: GetAllowedOrigins::, + SetAllowedOrigins: SetAllowedOrigins::, + HasAuthorityComponent: HasAuthorityComponent::, + SetHasAuthorityComponent: SetHasAuthorityComponent::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2CustomSchemeRegistration {} +windows_core::imp::define_interface!( + ICoreWebView2DOMContentLoadedEventArgs, + ICoreWebView2DOMContentLoadedEventArgs_Vtbl, + 0x16b1e21a_c503_44f2_84c9_70aba5031283 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2DOMContentLoadedEventArgs, + windows_core::IUnknown +); +impl ICoreWebView2DOMContentLoadedEventArgs { + pub unsafe fn NavigationId(&self, value: *mut u64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).NavigationId)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2DOMContentLoadedEventArgs_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub NavigationId: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut u64) -> windows_core::HRESULT, +} +pub trait ICoreWebView2DOMContentLoadedEventArgs_Impl: windows_core::IUnknownImpl { + fn NavigationId(&self, value: *mut u64) -> windows_core::Result<()>; +} +impl ICoreWebView2DOMContentLoadedEventArgs_Vtbl { + pub const fn new( + ) -> Self { + unsafe extern "system" fn NavigationId< + Identity: ICoreWebView2DOMContentLoadedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut u64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2DOMContentLoadedEventArgs_Impl::NavigationId( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + NavigationId: NavigationId::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2DOMContentLoadedEventArgs {} +windows_core::imp::define_interface!( + ICoreWebView2DOMContentLoadedEventHandler, + ICoreWebView2DOMContentLoadedEventHandler_Vtbl, + 0x4bac7e9c_199e_49ed_87ed_249303acf019 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2DOMContentLoadedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2DOMContentLoadedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2DOMContentLoadedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2DOMContentLoadedEventHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2>, + args: windows_core::Ref<'_, ICoreWebView2DOMContentLoadedEventArgs>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2DOMContentLoadedEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2DOMContentLoadedEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2DOMContentLoadedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2DOMContentLoadedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2DOMContentLoadedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2Deferral, + ICoreWebView2Deferral_Vtbl, + 0xc10e7f7b_b585_46f0_a623_8befbf3e4ee0 +); +windows_core::imp::interface_hierarchy!(ICoreWebView2Deferral, windows_core::IUnknown); +impl ICoreWebView2Deferral { + pub unsafe fn Complete(&self) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Complete)(windows_core::Interface::as_raw(self)) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Deferral_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Complete: unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Deferral_Impl: windows_core::IUnknownImpl { + fn Complete(&self) -> windows_core::Result<()>; +} +impl ICoreWebView2Deferral_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn Complete< + Identity: ICoreWebView2Deferral_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Deferral_Impl::Complete(this).into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Complete: Complete::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Deferral {} +windows_core::imp::define_interface!( + ICoreWebView2DevToolsProtocolEventReceivedEventArgs, + ICoreWebView2DevToolsProtocolEventReceivedEventArgs_Vtbl, + 0x653c2959_bb3a_4377_8632_b58ada4e66c4 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2DevToolsProtocolEventReceivedEventArgs, + windows_core::IUnknown +); +impl ICoreWebView2DevToolsProtocolEventReceivedEventArgs { + pub unsafe fn ParameterObjectAsJson( + &self, + value: *mut windows_core::PWSTR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ParameterObjectAsJson)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2DevToolsProtocolEventReceivedEventArgs_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub ParameterObjectAsJson: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2DevToolsProtocolEventReceivedEventArgs_Impl: + windows_core::IUnknownImpl +{ + fn ParameterObjectAsJson(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; +} +impl ICoreWebView2DevToolsProtocolEventReceivedEventArgs_Vtbl { + pub const fn new< + Identity: ICoreWebView2DevToolsProtocolEventReceivedEventArgs_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn ParameterObjectAsJson< + Identity: ICoreWebView2DevToolsProtocolEventReceivedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2DevToolsProtocolEventReceivedEventArgs_Impl::ParameterObjectAsJson( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + ParameterObjectAsJson: ParameterObjectAsJson::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == & < ICoreWebView2DevToolsProtocolEventReceivedEventArgs as windows_core::Interface >::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2DevToolsProtocolEventReceivedEventArgs {} +windows_core::imp::define_interface!( + ICoreWebView2DevToolsProtocolEventReceivedEventArgs2, + ICoreWebView2DevToolsProtocolEventReceivedEventArgs2_Vtbl, + 0x2dc4959d_1494_4393_95ba_bea4cb9ebd1b +); +impl core::ops::Deref for ICoreWebView2DevToolsProtocolEventReceivedEventArgs2 { + type Target = ICoreWebView2DevToolsProtocolEventReceivedEventArgs; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2DevToolsProtocolEventReceivedEventArgs2, + windows_core::IUnknown, + ICoreWebView2DevToolsProtocolEventReceivedEventArgs +); +impl ICoreWebView2DevToolsProtocolEventReceivedEventArgs2 { + pub unsafe fn SessionId(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SessionId)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2DevToolsProtocolEventReceivedEventArgs2_Vtbl { + pub base__: ICoreWebView2DevToolsProtocolEventReceivedEventArgs_Vtbl, + pub SessionId: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2DevToolsProtocolEventReceivedEventArgs2_Impl: + ICoreWebView2DevToolsProtocolEventReceivedEventArgs_Impl +{ + fn SessionId(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; +} +impl ICoreWebView2DevToolsProtocolEventReceivedEventArgs2_Vtbl { + pub const fn new< + Identity: ICoreWebView2DevToolsProtocolEventReceivedEventArgs2_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn SessionId< + Identity: ICoreWebView2DevToolsProtocolEventReceivedEventArgs2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2DevToolsProtocolEventReceivedEventArgs2_Impl::SessionId( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: ICoreWebView2DevToolsProtocolEventReceivedEventArgs_Vtbl::new::( + ), + SessionId: SessionId::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == & < ICoreWebView2DevToolsProtocolEventReceivedEventArgs2 as windows_core::Interface >::IID || iid == & < ICoreWebView2DevToolsProtocolEventReceivedEventArgs as windows_core::Interface >::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2DevToolsProtocolEventReceivedEventArgs2 {} +windows_core::imp::define_interface!( + ICoreWebView2DevToolsProtocolEventReceivedEventHandler, + ICoreWebView2DevToolsProtocolEventReceivedEventHandler_Vtbl, + 0xe2fda4be_5456_406c_a261_3d452138362c +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2DevToolsProtocolEventReceivedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2DevToolsProtocolEventReceivedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2DevToolsProtocolEventReceivedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2DevToolsProtocolEventReceivedEventHandler_Impl: + windows_core::IUnknownImpl +{ + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2>, + args: windows_core::Ref<'_, ICoreWebView2DevToolsProtocolEventReceivedEventArgs>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2DevToolsProtocolEventReceivedEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2DevToolsProtocolEventReceivedEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2DevToolsProtocolEventReceivedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2DevToolsProtocolEventReceivedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == & < ICoreWebView2DevToolsProtocolEventReceivedEventHandler as windows_core::Interface >::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2DevToolsProtocolEventReceivedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2DevToolsProtocolEventReceiver, + ICoreWebView2DevToolsProtocolEventReceiver_Vtbl, + 0xb32ca51a_8371_45e9_9317_af021d080367 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2DevToolsProtocolEventReceiver, + windows_core::IUnknown +); +impl ICoreWebView2DevToolsProtocolEventReceiver { + pub unsafe fn add_DevToolsProtocolEventReceived( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_DevToolsProtocolEventReceived)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_DevToolsProtocolEventReceived( + &self, + token: i64, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_DevToolsProtocolEventReceived)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2DevToolsProtocolEventReceiver_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub add_DevToolsProtocolEventReceived: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_DevToolsProtocolEventReceived: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, +} +pub trait ICoreWebView2DevToolsProtocolEventReceiver_Impl: windows_core::IUnknownImpl { + fn add_DevToolsProtocolEventReceived( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2DevToolsProtocolEventReceivedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_DevToolsProtocolEventReceived(&self, token: i64) -> windows_core::Result<()>; +} +impl ICoreWebView2DevToolsProtocolEventReceiver_Vtbl { + pub const fn new< + Identity: ICoreWebView2DevToolsProtocolEventReceiver_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn add_DevToolsProtocolEventReceived< + Identity: ICoreWebView2DevToolsProtocolEventReceiver_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2DevToolsProtocolEventReceiver_Impl::add_DevToolsProtocolEventReceived( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_DevToolsProtocolEventReceived< + Identity: ICoreWebView2DevToolsProtocolEventReceiver_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2DevToolsProtocolEventReceiver_Impl:: remove_DevToolsProtocolEventReceived ( this , core::mem::transmute_copy ( & token ) , ) . into ( ) + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + add_DevToolsProtocolEventReceived: add_DevToolsProtocolEventReceived::, + remove_DevToolsProtocolEventReceived: remove_DevToolsProtocolEventReceived::< + Identity, + OFFSET, + >, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2DevToolsProtocolEventReceiver {} +windows_core::imp::define_interface!( + ICoreWebView2DocumentTitleChangedEventHandler, + ICoreWebView2DocumentTitleChangedEventHandler_Vtbl, + 0xf5f2b923_953e_4042_9f95_f3a118e1afd4 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2DocumentTitleChangedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2DocumentTitleChangedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2DocumentTitleChangedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2DocumentTitleChangedEventHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2>, + args: windows_core::Ref<'_, windows_core::IUnknown>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2DocumentTitleChangedEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2DocumentTitleChangedEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2DocumentTitleChangedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2DocumentTitleChangedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2DocumentTitleChangedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2DownloadOperation, + ICoreWebView2DownloadOperation_Vtbl, + 0x3d6b6cf2_afe1_44c7_a995_c65117714336 +); +windows_core::imp::interface_hierarchy!(ICoreWebView2DownloadOperation, windows_core::IUnknown); +impl ICoreWebView2DownloadOperation { + pub unsafe fn add_BytesReceivedChanged( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_BytesReceivedChanged)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_BytesReceivedChanged(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_BytesReceivedChanged)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } + pub unsafe fn add_EstimatedEndTimeChanged( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_EstimatedEndTimeChanged)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_EstimatedEndTimeChanged(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_EstimatedEndTimeChanged)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } + pub unsafe fn add_StateChanged( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_StateChanged)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_StateChanged(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_StateChanged)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } + pub unsafe fn Uri(&self, uri: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Uri)( + windows_core::Interface::as_raw(self), + uri as _, + ) + .ok() + } + } + pub unsafe fn ContentDisposition( + &self, + contentdisposition: *mut windows_core::PWSTR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ContentDisposition)( + windows_core::Interface::as_raw(self), + contentdisposition as _, + ) + .ok() + } + } + pub unsafe fn MimeType(&self, mimetype: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).MimeType)( + windows_core::Interface::as_raw(self), + mimetype as _, + ) + .ok() + } + } + pub unsafe fn TotalBytesToReceive( + &self, + totalbytestoreceive: *mut i64, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).TotalBytesToReceive)( + windows_core::Interface::as_raw(self), + totalbytestoreceive as _, + ) + .ok() + } + } + pub unsafe fn BytesReceived(&self, bytesreceived: *mut i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).BytesReceived)( + windows_core::Interface::as_raw(self), + bytesreceived as _, + ) + .ok() + } + } + pub unsafe fn EstimatedEndTime( + &self, + estimatedendtime: *mut windows_core::PWSTR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).EstimatedEndTime)( + windows_core::Interface::as_raw(self), + estimatedendtime as _, + ) + .ok() + } + } + pub unsafe fn ResultFilePath( + &self, + resultfilepath: *mut windows_core::PWSTR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ResultFilePath)( + windows_core::Interface::as_raw(self), + resultfilepath as _, + ) + .ok() + } + } + pub unsafe fn State( + &self, + downloadstate: *mut COREWEBVIEW2_DOWNLOAD_STATE, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).State)( + windows_core::Interface::as_raw(self), + downloadstate as _, + ) + .ok() + } + } + pub unsafe fn InterruptReason( + &self, + interruptreason: *mut COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).InterruptReason)( + windows_core::Interface::as_raw(self), + interruptreason as _, + ) + .ok() + } + } + pub unsafe fn Cancel(&self) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Cancel)(windows_core::Interface::as_raw(self)) + .ok() + } + } + pub unsafe fn Pause(&self) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Pause)(windows_core::Interface::as_raw(self)) + .ok() + } + } + pub unsafe fn Resume(&self) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Resume)(windows_core::Interface::as_raw(self)) + .ok() + } + } + pub unsafe fn CanResume(&self, canresume: *mut windows_core::BOOL) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).CanResume)( + windows_core::Interface::as_raw(self), + canresume as _, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2DownloadOperation_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub add_BytesReceivedChanged: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_BytesReceivedChanged: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, + pub add_EstimatedEndTimeChanged: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_EstimatedEndTimeChanged: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, + pub add_StateChanged: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_StateChanged: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, + pub Uri: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub ContentDisposition: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub MimeType: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub TotalBytesToReceive: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut i64) -> windows_core::HRESULT, + pub BytesReceived: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut i64) -> windows_core::HRESULT, + pub EstimatedEndTime: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub ResultFilePath: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub State: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_DOWNLOAD_STATE, + ) -> windows_core::HRESULT, + pub InterruptReason: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON, + ) -> windows_core::HRESULT, + pub Cancel: unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT, + pub Pause: unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT, + pub Resume: unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT, + pub CanResume: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2DownloadOperation_Impl: windows_core::IUnknownImpl { + fn add_BytesReceivedChanged( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2BytesReceivedChangedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_BytesReceivedChanged(&self, token: i64) -> windows_core::Result<()>; + fn add_EstimatedEndTimeChanged( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2EstimatedEndTimeChangedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_EstimatedEndTimeChanged(&self, token: i64) -> windows_core::Result<()>; + fn add_StateChanged( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2StateChangedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_StateChanged(&self, token: i64) -> windows_core::Result<()>; + fn Uri(&self, uri: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn ContentDisposition( + &self, + contentdisposition: *mut windows_core::PWSTR, + ) -> windows_core::Result<()>; + fn MimeType(&self, mimetype: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn TotalBytesToReceive(&self, totalbytestoreceive: *mut i64) -> windows_core::Result<()>; + fn BytesReceived(&self, bytesreceived: *mut i64) -> windows_core::Result<()>; + fn EstimatedEndTime( + &self, + estimatedendtime: *mut windows_core::PWSTR, + ) -> windows_core::Result<()>; + fn ResultFilePath(&self, resultfilepath: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn State(&self, downloadstate: *mut COREWEBVIEW2_DOWNLOAD_STATE) -> windows_core::Result<()>; + fn InterruptReason( + &self, + interruptreason: *mut COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON, + ) -> windows_core::Result<()>; + fn Cancel(&self) -> windows_core::Result<()>; + fn Pause(&self) -> windows_core::Result<()>; + fn Resume(&self) -> windows_core::Result<()>; + fn CanResume(&self, canresume: *mut windows_core::BOOL) -> windows_core::Result<()>; +} +impl ICoreWebView2DownloadOperation_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn add_BytesReceivedChanged< + Identity: ICoreWebView2DownloadOperation_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2DownloadOperation_Impl::add_BytesReceivedChanged( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_BytesReceivedChanged< + Identity: ICoreWebView2DownloadOperation_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2DownloadOperation_Impl::remove_BytesReceivedChanged( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn add_EstimatedEndTimeChanged< + Identity: ICoreWebView2DownloadOperation_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2DownloadOperation_Impl::add_EstimatedEndTimeChanged( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_EstimatedEndTimeChanged< + Identity: ICoreWebView2DownloadOperation_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2DownloadOperation_Impl::remove_EstimatedEndTimeChanged( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn add_StateChanged< + Identity: ICoreWebView2DownloadOperation_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2DownloadOperation_Impl::add_StateChanged( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_StateChanged< + Identity: ICoreWebView2DownloadOperation_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2DownloadOperation_Impl::remove_StateChanged( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn Uri< + Identity: ICoreWebView2DownloadOperation_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + uri: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2DownloadOperation_Impl::Uri(this, core::mem::transmute_copy(&uri)) + .into() + } + } + unsafe extern "system" fn ContentDisposition< + Identity: ICoreWebView2DownloadOperation_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + contentdisposition: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2DownloadOperation_Impl::ContentDisposition( + this, + core::mem::transmute_copy(&contentdisposition), + ) + .into() + } + } + unsafe extern "system" fn MimeType< + Identity: ICoreWebView2DownloadOperation_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + mimetype: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2DownloadOperation_Impl::MimeType( + this, + core::mem::transmute_copy(&mimetype), + ) + .into() + } + } + unsafe extern "system" fn TotalBytesToReceive< + Identity: ICoreWebView2DownloadOperation_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + totalbytestoreceive: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2DownloadOperation_Impl::TotalBytesToReceive( + this, + core::mem::transmute_copy(&totalbytestoreceive), + ) + .into() + } + } + unsafe extern "system" fn BytesReceived< + Identity: ICoreWebView2DownloadOperation_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + bytesreceived: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2DownloadOperation_Impl::BytesReceived( + this, + core::mem::transmute_copy(&bytesreceived), + ) + .into() + } + } + unsafe extern "system" fn EstimatedEndTime< + Identity: ICoreWebView2DownloadOperation_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + estimatedendtime: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2DownloadOperation_Impl::EstimatedEndTime( + this, + core::mem::transmute_copy(&estimatedendtime), + ) + .into() + } + } + unsafe extern "system" fn ResultFilePath< + Identity: ICoreWebView2DownloadOperation_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + resultfilepath: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2DownloadOperation_Impl::ResultFilePath( + this, + core::mem::transmute_copy(&resultfilepath), + ) + .into() + } + } + unsafe extern "system" fn State< + Identity: ICoreWebView2DownloadOperation_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + downloadstate: *mut COREWEBVIEW2_DOWNLOAD_STATE, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2DownloadOperation_Impl::State( + this, + core::mem::transmute_copy(&downloadstate), + ) + .into() + } + } + unsafe extern "system" fn InterruptReason< + Identity: ICoreWebView2DownloadOperation_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + interruptreason: *mut COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2DownloadOperation_Impl::InterruptReason( + this, + core::mem::transmute_copy(&interruptreason), + ) + .into() + } + } + unsafe extern "system" fn Cancel< + Identity: ICoreWebView2DownloadOperation_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2DownloadOperation_Impl::Cancel(this).into() + } + } + unsafe extern "system" fn Pause< + Identity: ICoreWebView2DownloadOperation_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2DownloadOperation_Impl::Pause(this).into() + } + } + unsafe extern "system" fn Resume< + Identity: ICoreWebView2DownloadOperation_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2DownloadOperation_Impl::Resume(this).into() + } + } + unsafe extern "system" fn CanResume< + Identity: ICoreWebView2DownloadOperation_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + canresume: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2DownloadOperation_Impl::CanResume( + this, + core::mem::transmute_copy(&canresume), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + add_BytesReceivedChanged: add_BytesReceivedChanged::, + remove_BytesReceivedChanged: remove_BytesReceivedChanged::, + add_EstimatedEndTimeChanged: add_EstimatedEndTimeChanged::, + remove_EstimatedEndTimeChanged: remove_EstimatedEndTimeChanged::, + add_StateChanged: add_StateChanged::, + remove_StateChanged: remove_StateChanged::, + Uri: Uri::, + ContentDisposition: ContentDisposition::, + MimeType: MimeType::, + TotalBytesToReceive: TotalBytesToReceive::, + BytesReceived: BytesReceived::, + EstimatedEndTime: EstimatedEndTime::, + ResultFilePath: ResultFilePath::, + State: State::, + InterruptReason: InterruptReason::, + Cancel: Cancel::, + Pause: Pause::, + Resume: Resume::, + CanResume: CanResume::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2DownloadOperation {} +windows_core::imp::define_interface!( + ICoreWebView2DownloadStartingEventArgs, + ICoreWebView2DownloadStartingEventArgs_Vtbl, + 0xe99bbe21_43e9_4544_a732_282764eafa60 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2DownloadStartingEventArgs, + windows_core::IUnknown +); +impl ICoreWebView2DownloadStartingEventArgs { + pub unsafe fn DownloadOperation(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).DownloadOperation)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } + pub unsafe fn Cancel(&self, cancel: *mut windows_core::BOOL) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Cancel)( + windows_core::Interface::as_raw(self), + cancel as _, + ) + .ok() + } + } + pub unsafe fn SetCancel(&self, cancel: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetCancel)( + windows_core::Interface::as_raw(self), + cancel.into(), + ) + .ok() + } + } + pub unsafe fn ResultFilePath( + &self, + resultfilepath: *mut windows_core::PWSTR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ResultFilePath)( + windows_core::Interface::as_raw(self), + resultfilepath as _, + ) + .ok() + } + } + pub unsafe fn SetResultFilePath(&self, resultfilepath: P0) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).SetResultFilePath)( + windows_core::Interface::as_raw(self), + resultfilepath.param().abi(), + ) + .ok() + } + } + pub unsafe fn Handled(&self, handled: *mut windows_core::BOOL) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Handled)( + windows_core::Interface::as_raw(self), + handled as _, + ) + .ok() + } + } + pub unsafe fn SetHandled(&self, handled: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetHandled)( + windows_core::Interface::as_raw(self), + handled.into(), + ) + .ok() + } + } + pub unsafe fn GetDeferral(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).GetDeferral)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2DownloadStartingEventArgs_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub DownloadOperation: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub Cancel: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetCancel: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, + pub ResultFilePath: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub SetResultFilePath: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + ) -> windows_core::HRESULT, + pub Handled: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetHandled: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, + pub GetDeferral: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2DownloadStartingEventArgs_Impl: windows_core::IUnknownImpl { + fn DownloadOperation(&self) -> windows_core::Result; + fn Cancel(&self, cancel: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn SetCancel(&self, cancel: windows_core::BOOL) -> windows_core::Result<()>; + fn ResultFilePath(&self, resultfilepath: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn SetResultFilePath(&self, resultfilepath: &windows_core::PCWSTR) -> windows_core::Result<()>; + fn Handled(&self, handled: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn SetHandled(&self, handled: windows_core::BOOL) -> windows_core::Result<()>; + fn GetDeferral(&self) -> windows_core::Result; +} +impl ICoreWebView2DownloadStartingEventArgs_Vtbl { + pub const fn new( + ) -> Self { + unsafe extern "system" fn DownloadOperation< + Identity: ICoreWebView2DownloadStartingEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + downloadoperation: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2DownloadStartingEventArgs_Impl::DownloadOperation(this) { + Ok(ok__) => { + downloadoperation.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + unsafe extern "system" fn Cancel< + Identity: ICoreWebView2DownloadStartingEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + cancel: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2DownloadStartingEventArgs_Impl::Cancel( + this, + core::mem::transmute_copy(&cancel), + ) + .into() + } + } + unsafe extern "system" fn SetCancel< + Identity: ICoreWebView2DownloadStartingEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + cancel: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2DownloadStartingEventArgs_Impl::SetCancel( + this, + core::mem::transmute_copy(&cancel), + ) + .into() + } + } + unsafe extern "system" fn ResultFilePath< + Identity: ICoreWebView2DownloadStartingEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + resultfilepath: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2DownloadStartingEventArgs_Impl::ResultFilePath( + this, + core::mem::transmute_copy(&resultfilepath), + ) + .into() + } + } + unsafe extern "system" fn SetResultFilePath< + Identity: ICoreWebView2DownloadStartingEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + resultfilepath: windows_core::PCWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2DownloadStartingEventArgs_Impl::SetResultFilePath( + this, + core::mem::transmute(&resultfilepath), + ) + .into() + } + } + unsafe extern "system" fn Handled< + Identity: ICoreWebView2DownloadStartingEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + handled: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2DownloadStartingEventArgs_Impl::Handled( + this, + core::mem::transmute_copy(&handled), + ) + .into() + } + } + unsafe extern "system" fn SetHandled< + Identity: ICoreWebView2DownloadStartingEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + handled: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2DownloadStartingEventArgs_Impl::SetHandled( + this, + core::mem::transmute_copy(&handled), + ) + .into() + } + } + unsafe extern "system" fn GetDeferral< + Identity: ICoreWebView2DownloadStartingEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + deferral: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2DownloadStartingEventArgs_Impl::GetDeferral(this) { + Ok(ok__) => { + deferral.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + DownloadOperation: DownloadOperation::, + Cancel: Cancel::, + SetCancel: SetCancel::, + ResultFilePath: ResultFilePath::, + SetResultFilePath: SetResultFilePath::, + Handled: Handled::, + SetHandled: SetHandled::, + GetDeferral: GetDeferral::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2DownloadStartingEventArgs {} +windows_core::imp::define_interface!( + ICoreWebView2DownloadStartingEventHandler, + ICoreWebView2DownloadStartingEventHandler_Vtbl, + 0xefedc989_c396_41ca_83f7_07f845a55724 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2DownloadStartingEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2DownloadStartingEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2DownloadStartingEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2DownloadStartingEventHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2>, + args: windows_core::Ref<'_, ICoreWebView2DownloadStartingEventArgs>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2DownloadStartingEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2DownloadStartingEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2DownloadStartingEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2DownloadStartingEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2DownloadStartingEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2Environment, + ICoreWebView2Environment_Vtbl, + 0xb96d755e_0319_4e92_a296_23436f46a1fc +); +windows_core::imp::interface_hierarchy!(ICoreWebView2Environment, windows_core::IUnknown); +impl ICoreWebView2Environment { + pub unsafe fn CreateCoreWebView2Controller( + &self, + parentwindow: windows::Win32::Foundation::HWND, + handler: P1, + ) -> windows_core::Result<()> + where + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).CreateCoreWebView2Controller)( + windows_core::Interface::as_raw(self), + parentwindow, + handler.param().abi(), + ) + .ok() + } + } + pub unsafe fn CreateWebResourceResponse( + &self, + content: P0, + statuscode: i32, + reasonphrase: P2, + headers: P3, + ) -> windows_core::Result + where + P0: windows_core::Param, + P2: windows_core::Param, + P3: windows_core::Param, + { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).CreateWebResourceResponse)( + windows_core::Interface::as_raw(self), + content.param().abi(), + statuscode, + reasonphrase.param().abi(), + headers.param().abi(), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } + pub unsafe fn BrowserVersionString( + &self, + versioninfo: *mut windows_core::PWSTR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).BrowserVersionString)( + windows_core::Interface::as_raw(self), + versioninfo as _, + ) + .ok() + } + } + pub unsafe fn add_NewBrowserVersionAvailable( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_NewBrowserVersionAvailable)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_NewBrowserVersionAvailable(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_NewBrowserVersionAvailable)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Environment_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub CreateCoreWebView2Controller: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows::Win32::Foundation::HWND, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub CreateWebResourceResponse: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + i32, + windows_core::PCWSTR, + windows_core::PCWSTR, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub BrowserVersionString: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub add_NewBrowserVersionAvailable: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_NewBrowserVersionAvailable: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Environment_Impl: windows_core::IUnknownImpl { + fn CreateCoreWebView2Controller( + &self, + parentwindow: windows::Win32::Foundation::HWND, + handler: windows_core::Ref<'_, ICoreWebView2CreateCoreWebView2ControllerCompletedHandler>, + ) -> windows_core::Result<()>; + fn CreateWebResourceResponse( + &self, + content: windows_core::Ref<'_, windows::Win32::System::Com::IStream>, + statuscode: i32, + reasonphrase: &windows_core::PCWSTR, + headers: &windows_core::PCWSTR, + ) -> windows_core::Result; + fn BrowserVersionString( + &self, + versioninfo: *mut windows_core::PWSTR, + ) -> windows_core::Result<()>; + fn add_NewBrowserVersionAvailable( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2NewBrowserVersionAvailableEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_NewBrowserVersionAvailable(&self, token: i64) -> windows_core::Result<()>; +} +impl ICoreWebView2Environment_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn CreateCoreWebView2Controller< + Identity: ICoreWebView2Environment_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + parentwindow: windows::Win32::Foundation::HWND, + handler: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Environment_Impl::CreateCoreWebView2Controller( + this, + core::mem::transmute_copy(&parentwindow), + core::mem::transmute_copy(&handler), + ) + .into() + } + } + unsafe extern "system" fn CreateWebResourceResponse< + Identity: ICoreWebView2Environment_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + content: *mut core::ffi::c_void, + statuscode: i32, + reasonphrase: windows_core::PCWSTR, + headers: windows_core::PCWSTR, + response: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2Environment_Impl::CreateWebResourceResponse( + this, + core::mem::transmute_copy(&content), + core::mem::transmute_copy(&statuscode), + core::mem::transmute(&reasonphrase), + core::mem::transmute(&headers), + ) { + Ok(ok__) => { + response.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + unsafe extern "system" fn BrowserVersionString< + Identity: ICoreWebView2Environment_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + versioninfo: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Environment_Impl::BrowserVersionString( + this, + core::mem::transmute_copy(&versioninfo), + ) + .into() + } + } + unsafe extern "system" fn add_NewBrowserVersionAvailable< + Identity: ICoreWebView2Environment_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Environment_Impl::add_NewBrowserVersionAvailable( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_NewBrowserVersionAvailable< + Identity: ICoreWebView2Environment_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Environment_Impl::remove_NewBrowserVersionAvailable( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + CreateCoreWebView2Controller: CreateCoreWebView2Controller::, + CreateWebResourceResponse: CreateWebResourceResponse::, + BrowserVersionString: BrowserVersionString::, + add_NewBrowserVersionAvailable: add_NewBrowserVersionAvailable::, + remove_NewBrowserVersionAvailable: remove_NewBrowserVersionAvailable::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Environment {} +windows_core::imp::define_interface!( + ICoreWebView2Environment10, + ICoreWebView2Environment10_Vtbl, + 0xee0eb9df_6f12_46ce_b53f_3f47b9c928e0 +); +impl core::ops::Deref for ICoreWebView2Environment10 { + type Target = ICoreWebView2Environment9; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2Environment10, + windows_core::IUnknown, + ICoreWebView2Environment, + ICoreWebView2Environment2, + ICoreWebView2Environment3, + ICoreWebView2Environment4, + ICoreWebView2Environment5, + ICoreWebView2Environment6, + ICoreWebView2Environment7, + ICoreWebView2Environment8, + ICoreWebView2Environment9 +); +impl ICoreWebView2Environment10 { + pub unsafe fn CreateCoreWebView2ControllerOptions( + &self, + ) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).CreateCoreWebView2ControllerOptions)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } + pub unsafe fn CreateCoreWebView2ControllerWithOptions( + &self, + parentwindow: windows::Win32::Foundation::HWND, + options: P1, + handler: P2, + ) -> windows_core::Result<()> + where + P1: windows_core::Param, + P2: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).CreateCoreWebView2ControllerWithOptions)( + windows_core::Interface::as_raw(self), + parentwindow, + options.param().abi(), + handler.param().abi(), + ) + .ok() + } + } + pub unsafe fn CreateCoreWebView2CompositionControllerWithOptions( + &self, + parentwindow: windows::Win32::Foundation::HWND, + options: P1, + handler: P2, + ) -> windows_core::Result<()> + where + P1: windows_core::Param, + P2: windows_core::Param< + ICoreWebView2CreateCoreWebView2CompositionControllerCompletedHandler, + >, + { + unsafe { + (windows_core::Interface::vtable(self) + .CreateCoreWebView2CompositionControllerWithOptions)( + windows_core::Interface::as_raw(self), + parentwindow, + options.param().abi(), + handler.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Environment10_Vtbl { + pub base__: ICoreWebView2Environment9_Vtbl, + pub CreateCoreWebView2ControllerOptions: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) + -> windows_core::HRESULT, + pub CreateCoreWebView2ControllerWithOptions: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows::Win32::Foundation::HWND, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) + -> windows_core::HRESULT, + pub CreateCoreWebView2CompositionControllerWithOptions: + unsafe extern "system" fn( + *mut core::ffi::c_void, + windows::Win32::Foundation::HWND, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Environment10_Impl: ICoreWebView2Environment9_Impl { + fn CreateCoreWebView2ControllerOptions( + &self, + ) -> windows_core::Result; + fn CreateCoreWebView2ControllerWithOptions( + &self, + parentwindow: windows::Win32::Foundation::HWND, + options: windows_core::Ref<'_, ICoreWebView2ControllerOptions>, + handler: windows_core::Ref<'_, ICoreWebView2CreateCoreWebView2ControllerCompletedHandler>, + ) -> windows_core::Result<()>; + fn CreateCoreWebView2CompositionControllerWithOptions( + &self, + parentwindow: windows::Win32::Foundation::HWND, + options: windows_core::Ref<'_, ICoreWebView2ControllerOptions>, + handler: windows_core::Ref< + '_, + ICoreWebView2CreateCoreWebView2CompositionControllerCompletedHandler, + >, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2Environment10_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn CreateCoreWebView2ControllerOptions< + Identity: ICoreWebView2Environment10_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2Environment10_Impl::CreateCoreWebView2ControllerOptions(this) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + unsafe extern "system" fn CreateCoreWebView2ControllerWithOptions< + Identity: ICoreWebView2Environment10_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + parentwindow: windows::Win32::Foundation::HWND, + options: *mut core::ffi::c_void, + handler: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Environment10_Impl::CreateCoreWebView2ControllerWithOptions( + this, + core::mem::transmute_copy(&parentwindow), + core::mem::transmute_copy(&options), + core::mem::transmute_copy(&handler), + ) + .into() + } + } + unsafe extern "system" fn CreateCoreWebView2CompositionControllerWithOptions< + Identity: ICoreWebView2Environment10_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + parentwindow: windows::Win32::Foundation::HWND, + options: *mut core::ffi::c_void, + handler: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Environment10_Impl::CreateCoreWebView2CompositionControllerWithOptions( + this, + core::mem::transmute_copy(&parentwindow), + core::mem::transmute_copy(&options), + core::mem::transmute_copy(&handler), + ) + .into() + } + } + Self { + base__: ICoreWebView2Environment9_Vtbl::new::(), + CreateCoreWebView2ControllerOptions: CreateCoreWebView2ControllerOptions::< + Identity, + OFFSET, + >, + CreateCoreWebView2ControllerWithOptions: CreateCoreWebView2ControllerWithOptions::< + Identity, + OFFSET, + >, + CreateCoreWebView2CompositionControllerWithOptions: + CreateCoreWebView2CompositionControllerWithOptions::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Environment10 {} +windows_core::imp::define_interface!( + ICoreWebView2Environment11, + ICoreWebView2Environment11_Vtbl, + 0xf0913dc6_a0ec_42ef_9805_91dff3a2966a +); +impl core::ops::Deref for ICoreWebView2Environment11 { + type Target = ICoreWebView2Environment10; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2Environment11, + windows_core::IUnknown, + ICoreWebView2Environment, + ICoreWebView2Environment2, + ICoreWebView2Environment3, + ICoreWebView2Environment4, + ICoreWebView2Environment5, + ICoreWebView2Environment6, + ICoreWebView2Environment7, + ICoreWebView2Environment8, + ICoreWebView2Environment9, + ICoreWebView2Environment10 +); +impl ICoreWebView2Environment11 { + pub unsafe fn FailureReportFolderPath( + &self, + value: *mut windows_core::PWSTR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).FailureReportFolderPath)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Environment11_Vtbl { + pub base__: ICoreWebView2Environment10_Vtbl, + pub FailureReportFolderPath: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Environment11_Impl: ICoreWebView2Environment10_Impl { + fn FailureReportFolderPath(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; +} +impl ICoreWebView2Environment11_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn FailureReportFolderPath< + Identity: ICoreWebView2Environment11_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Environment11_Impl::FailureReportFolderPath( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: ICoreWebView2Environment10_Vtbl::new::(), + FailureReportFolderPath: FailureReportFolderPath::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Environment11 {} +windows_core::imp::define_interface!( + ICoreWebView2Environment12, + ICoreWebView2Environment12_Vtbl, + 0xf503db9b_739f_48dd_b151_fdfcf253f54e +); +impl core::ops::Deref for ICoreWebView2Environment12 { + type Target = ICoreWebView2Environment11; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2Environment12, + windows_core::IUnknown, + ICoreWebView2Environment, + ICoreWebView2Environment2, + ICoreWebView2Environment3, + ICoreWebView2Environment4, + ICoreWebView2Environment5, + ICoreWebView2Environment6, + ICoreWebView2Environment7, + ICoreWebView2Environment8, + ICoreWebView2Environment9, + ICoreWebView2Environment10, + ICoreWebView2Environment11 +); +impl ICoreWebView2Environment12 { + pub unsafe fn CreateSharedBuffer( + &self, + size: u64, + ) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).CreateSharedBuffer)( + windows_core::Interface::as_raw(self), + size, + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Environment12_Vtbl { + pub base__: ICoreWebView2Environment11_Vtbl, + pub CreateSharedBuffer: unsafe extern "system" fn( + *mut core::ffi::c_void, + u64, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Environment12_Impl: ICoreWebView2Environment11_Impl { + fn CreateSharedBuffer(&self, size: u64) -> windows_core::Result; +} +impl ICoreWebView2Environment12_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn CreateSharedBuffer< + Identity: ICoreWebView2Environment12_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + size: u64, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2Environment12_Impl::CreateSharedBuffer( + this, + core::mem::transmute_copy(&size), + ) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: ICoreWebView2Environment11_Vtbl::new::(), + CreateSharedBuffer: CreateSharedBuffer::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Environment12 {} +windows_core::imp::define_interface!( + ICoreWebView2Environment13, + ICoreWebView2Environment13_Vtbl, + 0xaf641f58_72b2_11ee_b962_0242ac120002 +); +impl core::ops::Deref for ICoreWebView2Environment13 { + type Target = ICoreWebView2Environment12; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2Environment13, + windows_core::IUnknown, + ICoreWebView2Environment, + ICoreWebView2Environment2, + ICoreWebView2Environment3, + ICoreWebView2Environment4, + ICoreWebView2Environment5, + ICoreWebView2Environment6, + ICoreWebView2Environment7, + ICoreWebView2Environment8, + ICoreWebView2Environment9, + ICoreWebView2Environment10, + ICoreWebView2Environment11, + ICoreWebView2Environment12 +); +impl ICoreWebView2Environment13 { + pub unsafe fn GetProcessExtendedInfos(&self, handler: P0) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).GetProcessExtendedInfos)( + windows_core::Interface::as_raw(self), + handler.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Environment13_Vtbl { + pub base__: ICoreWebView2Environment12_Vtbl, + pub GetProcessExtendedInfos: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Environment13_Impl: ICoreWebView2Environment12_Impl { + fn GetProcessExtendedInfos( + &self, + handler: windows_core::Ref<'_, ICoreWebView2GetProcessExtendedInfosCompletedHandler>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2Environment13_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn GetProcessExtendedInfos< + Identity: ICoreWebView2Environment13_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + handler: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Environment13_Impl::GetProcessExtendedInfos( + this, + core::mem::transmute_copy(&handler), + ) + .into() + } + } + Self { + base__: ICoreWebView2Environment12_Vtbl::new::(), + GetProcessExtendedInfos: GetProcessExtendedInfos::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Environment13 {} +windows_core::imp::define_interface!( + ICoreWebView2Environment14, + ICoreWebView2Environment14_Vtbl, + 0xa5e9fad9_c875_59da_9bd7_473aa5ca1cef +); +impl core::ops::Deref for ICoreWebView2Environment14 { + type Target = ICoreWebView2Environment13; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2Environment14, + windows_core::IUnknown, + ICoreWebView2Environment, + ICoreWebView2Environment2, + ICoreWebView2Environment3, + ICoreWebView2Environment4, + ICoreWebView2Environment5, + ICoreWebView2Environment6, + ICoreWebView2Environment7, + ICoreWebView2Environment8, + ICoreWebView2Environment9, + ICoreWebView2Environment10, + ICoreWebView2Environment11, + ICoreWebView2Environment12, + ICoreWebView2Environment13 +); +impl ICoreWebView2Environment14 { + pub unsafe fn CreateWebFileSystemFileHandle( + &self, + path: P0, + permission: COREWEBVIEW2_FILE_SYSTEM_HANDLE_PERMISSION, + ) -> windows_core::Result + where + P0: windows_core::Param, + { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).CreateWebFileSystemFileHandle)( + windows_core::Interface::as_raw(self), + path.param().abi(), + permission, + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } + pub unsafe fn CreateWebFileSystemDirectoryHandle( + &self, + path: P0, + permission: COREWEBVIEW2_FILE_SYSTEM_HANDLE_PERMISSION, + ) -> windows_core::Result + where + P0: windows_core::Param, + { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).CreateWebFileSystemDirectoryHandle)( + windows_core::Interface::as_raw(self), + path.param().abi(), + permission, + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } + pub unsafe fn CreateObjectCollection( + &self, + length: u32, + items: *mut Option, + objectcollection: *mut Option, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).CreateObjectCollection)( + windows_core::Interface::as_raw(self), + length, + core::mem::transmute(items), + core::mem::transmute(objectcollection), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Environment14_Vtbl { + pub base__: ICoreWebView2Environment13_Vtbl, + pub CreateWebFileSystemFileHandle: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + COREWEBVIEW2_FILE_SYSTEM_HANDLE_PERMISSION, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub CreateWebFileSystemDirectoryHandle: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + COREWEBVIEW2_FILE_SYSTEM_HANDLE_PERMISSION, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub CreateObjectCollection: unsafe extern "system" fn( + *mut core::ffi::c_void, + u32, + *mut *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Environment14_Impl: ICoreWebView2Environment13_Impl { + fn CreateWebFileSystemFileHandle( + &self, + path: &windows_core::PCWSTR, + permission: COREWEBVIEW2_FILE_SYSTEM_HANDLE_PERMISSION, + ) -> windows_core::Result; + fn CreateWebFileSystemDirectoryHandle( + &self, + path: &windows_core::PCWSTR, + permission: COREWEBVIEW2_FILE_SYSTEM_HANDLE_PERMISSION, + ) -> windows_core::Result; + fn CreateObjectCollection( + &self, + length: u32, + items: windows_core::OutRef<'_, windows_core::IUnknown>, + objectcollection: windows_core::OutRef<'_, ICoreWebView2ObjectCollection>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2Environment14_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn CreateWebFileSystemFileHandle< + Identity: ICoreWebView2Environment14_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + path: windows_core::PCWSTR, + permission: COREWEBVIEW2_FILE_SYSTEM_HANDLE_PERMISSION, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2Environment14_Impl::CreateWebFileSystemFileHandle( + this, + core::mem::transmute(&path), + core::mem::transmute_copy(&permission), + ) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + unsafe extern "system" fn CreateWebFileSystemDirectoryHandle< + Identity: ICoreWebView2Environment14_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + path: windows_core::PCWSTR, + permission: COREWEBVIEW2_FILE_SYSTEM_HANDLE_PERMISSION, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2Environment14_Impl::CreateWebFileSystemDirectoryHandle( + this, + core::mem::transmute(&path), + core::mem::transmute_copy(&permission), + ) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + unsafe extern "system" fn CreateObjectCollection< + Identity: ICoreWebView2Environment14_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + length: u32, + items: *mut *mut core::ffi::c_void, + objectcollection: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Environment14_Impl::CreateObjectCollection( + this, + core::mem::transmute_copy(&length), + core::mem::transmute_copy(&items), + core::mem::transmute_copy(&objectcollection), + ) + .into() + } + } + Self { + base__: ICoreWebView2Environment13_Vtbl::new::(), + CreateWebFileSystemFileHandle: CreateWebFileSystemFileHandle::, + CreateWebFileSystemDirectoryHandle: CreateWebFileSystemDirectoryHandle::< + Identity, + OFFSET, + >, + CreateObjectCollection: CreateObjectCollection::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Environment14 {} +windows_core::imp::define_interface!( + ICoreWebView2Environment15, + ICoreWebView2Environment15_Vtbl, + 0x2ac5ebfb_e654_5961_a667_7971885c7b27 +); +impl core::ops::Deref for ICoreWebView2Environment15 { + type Target = ICoreWebView2Environment14; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2Environment15, + windows_core::IUnknown, + ICoreWebView2Environment, + ICoreWebView2Environment2, + ICoreWebView2Environment3, + ICoreWebView2Environment4, + ICoreWebView2Environment5, + ICoreWebView2Environment6, + ICoreWebView2Environment7, + ICoreWebView2Environment8, + ICoreWebView2Environment9, + ICoreWebView2Environment10, + ICoreWebView2Environment11, + ICoreWebView2Environment12, + ICoreWebView2Environment13, + ICoreWebView2Environment14 +); +impl ICoreWebView2Environment15 { + pub unsafe fn CreateFindOptions(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).CreateFindOptions)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Environment15_Vtbl { + pub base__: ICoreWebView2Environment14_Vtbl, + pub CreateFindOptions: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Environment15_Impl: ICoreWebView2Environment14_Impl { + fn CreateFindOptions(&self) -> windows_core::Result; +} +impl ICoreWebView2Environment15_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn CreateFindOptions< + Identity: ICoreWebView2Environment15_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2Environment15_Impl::CreateFindOptions(this) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: ICoreWebView2Environment14_Vtbl::new::(), + CreateFindOptions: CreateFindOptions::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Environment15 {} +windows_core::imp::define_interface!( + ICoreWebView2Environment2, + ICoreWebView2Environment2_Vtbl, + 0x41f3632b_5ef4_404f_ad82_2d606c5a9a21 +); +impl core::ops::Deref for ICoreWebView2Environment2 { + type Target = ICoreWebView2Environment; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2Environment2, + windows_core::IUnknown, + ICoreWebView2Environment +); +impl ICoreWebView2Environment2 { + pub unsafe fn CreateWebResourceRequest( + &self, + uri: P0, + method: P1, + postdata: P2, + headers: P3, + ) -> windows_core::Result + where + P0: windows_core::Param, + P1: windows_core::Param, + P2: windows_core::Param, + P3: windows_core::Param, + { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).CreateWebResourceRequest)( + windows_core::Interface::as_raw(self), + uri.param().abi(), + method.param().abi(), + postdata.param().abi(), + headers.param().abi(), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Environment2_Vtbl { + pub base__: ICoreWebView2Environment_Vtbl, + pub CreateWebResourceRequest: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + windows_core::PCWSTR, + *mut core::ffi::c_void, + windows_core::PCWSTR, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Environment2_Impl: ICoreWebView2Environment_Impl { + fn CreateWebResourceRequest( + &self, + uri: &windows_core::PCWSTR, + method: &windows_core::PCWSTR, + postdata: windows_core::Ref<'_, windows::Win32::System::Com::IStream>, + headers: &windows_core::PCWSTR, + ) -> windows_core::Result; +} +impl ICoreWebView2Environment2_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn CreateWebResourceRequest< + Identity: ICoreWebView2Environment2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + uri: windows_core::PCWSTR, + method: windows_core::PCWSTR, + postdata: *mut core::ffi::c_void, + headers: windows_core::PCWSTR, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2Environment2_Impl::CreateWebResourceRequest( + this, + core::mem::transmute(&uri), + core::mem::transmute(&method), + core::mem::transmute_copy(&postdata), + core::mem::transmute(&headers), + ) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: ICoreWebView2Environment_Vtbl::new::(), + CreateWebResourceRequest: CreateWebResourceRequest::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Environment2 {} +windows_core::imp::define_interface!( + ICoreWebView2Environment3, + ICoreWebView2Environment3_Vtbl, + 0x80a22ae3_be7c_4ce2_afe1_5a50056cdeeb +); +impl core::ops::Deref for ICoreWebView2Environment3 { + type Target = ICoreWebView2Environment2; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2Environment3, + windows_core::IUnknown, + ICoreWebView2Environment, + ICoreWebView2Environment2 +); +impl ICoreWebView2Environment3 { + pub unsafe fn CreateCoreWebView2CompositionController( + &self, + parentwindow: windows::Win32::Foundation::HWND, + handler: P1, + ) -> windows_core::Result<()> + where + P1: windows_core::Param< + ICoreWebView2CreateCoreWebView2CompositionControllerCompletedHandler, + >, + { + unsafe { + (windows_core::Interface::vtable(self).CreateCoreWebView2CompositionController)( + windows_core::Interface::as_raw(self), + parentwindow, + handler.param().abi(), + ) + .ok() + } + } + pub unsafe fn CreateCoreWebView2PointerInfo( + &self, + ) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).CreateCoreWebView2PointerInfo)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Environment3_Vtbl { + pub base__: ICoreWebView2Environment2_Vtbl, + pub CreateCoreWebView2CompositionController: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows::Win32::Foundation::HWND, + *mut core::ffi::c_void, + ) + -> windows_core::HRESULT, + pub CreateCoreWebView2PointerInfo: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Environment3_Impl: ICoreWebView2Environment2_Impl { + fn CreateCoreWebView2CompositionController( + &self, + parentwindow: windows::Win32::Foundation::HWND, + handler: windows_core::Ref< + '_, + ICoreWebView2CreateCoreWebView2CompositionControllerCompletedHandler, + >, + ) -> windows_core::Result<()>; + fn CreateCoreWebView2PointerInfo(&self) -> windows_core::Result; +} +impl ICoreWebView2Environment3_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn CreateCoreWebView2CompositionController< + Identity: ICoreWebView2Environment3_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + parentwindow: windows::Win32::Foundation::HWND, + handler: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Environment3_Impl::CreateCoreWebView2CompositionController( + this, + core::mem::transmute_copy(&parentwindow), + core::mem::transmute_copy(&handler), + ) + .into() + } + } + unsafe extern "system" fn CreateCoreWebView2PointerInfo< + Identity: ICoreWebView2Environment3_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2Environment3_Impl::CreateCoreWebView2PointerInfo(this) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: ICoreWebView2Environment2_Vtbl::new::(), + CreateCoreWebView2CompositionController: CreateCoreWebView2CompositionController::< + Identity, + OFFSET, + >, + CreateCoreWebView2PointerInfo: CreateCoreWebView2PointerInfo::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Environment3 {} +windows_core::imp::define_interface!( + ICoreWebView2Environment4, + ICoreWebView2Environment4_Vtbl, + 0x20944379_6dcf_41d6_a0a0_abc0fc50de0d +); +impl core::ops::Deref for ICoreWebView2Environment4 { + type Target = ICoreWebView2Environment3; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2Environment4, + windows_core::IUnknown, + ICoreWebView2Environment, + ICoreWebView2Environment2, + ICoreWebView2Environment3 +); +impl ICoreWebView2Environment4 { + pub unsafe fn GetAutomationProviderForWindow( + &self, + hwnd: windows::Win32::Foundation::HWND, + ) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).GetAutomationProviderForWindow)( + windows_core::Interface::as_raw(self), + hwnd, + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Environment4_Vtbl { + pub base__: ICoreWebView2Environment3_Vtbl, + pub GetAutomationProviderForWindow: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows::Win32::Foundation::HWND, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Environment4_Impl: ICoreWebView2Environment3_Impl { + fn GetAutomationProviderForWindow( + &self, + hwnd: windows::Win32::Foundation::HWND, + ) -> windows_core::Result; +} +impl ICoreWebView2Environment4_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn GetAutomationProviderForWindow< + Identity: ICoreWebView2Environment4_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + hwnd: windows::Win32::Foundation::HWND, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2Environment4_Impl::GetAutomationProviderForWindow( + this, + core::mem::transmute_copy(&hwnd), + ) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: ICoreWebView2Environment3_Vtbl::new::(), + GetAutomationProviderForWindow: GetAutomationProviderForWindow::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Environment4 {} +windows_core::imp::define_interface!( + ICoreWebView2Environment5, + ICoreWebView2Environment5_Vtbl, + 0x319e423d_e0d7_4b8d_9254_ae9475de9b17 +); +impl core::ops::Deref for ICoreWebView2Environment5 { + type Target = ICoreWebView2Environment4; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2Environment5, + windows_core::IUnknown, + ICoreWebView2Environment, + ICoreWebView2Environment2, + ICoreWebView2Environment3, + ICoreWebView2Environment4 +); +impl ICoreWebView2Environment5 { + pub unsafe fn add_BrowserProcessExited( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_BrowserProcessExited)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_BrowserProcessExited(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_BrowserProcessExited)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Environment5_Vtbl { + pub base__: ICoreWebView2Environment4_Vtbl, + pub add_BrowserProcessExited: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_BrowserProcessExited: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Environment5_Impl: ICoreWebView2Environment4_Impl { + fn add_BrowserProcessExited( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2BrowserProcessExitedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_BrowserProcessExited(&self, token: i64) -> windows_core::Result<()>; +} +impl ICoreWebView2Environment5_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn add_BrowserProcessExited< + Identity: ICoreWebView2Environment5_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Environment5_Impl::add_BrowserProcessExited( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_BrowserProcessExited< + Identity: ICoreWebView2Environment5_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Environment5_Impl::remove_BrowserProcessExited( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + Self { + base__: ICoreWebView2Environment4_Vtbl::new::(), + add_BrowserProcessExited: add_BrowserProcessExited::, + remove_BrowserProcessExited: remove_BrowserProcessExited::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Environment5 {} +windows_core::imp::define_interface!( + ICoreWebView2Environment6, + ICoreWebView2Environment6_Vtbl, + 0xe59ee362_acbd_4857_9a8e_d3644d9459a9 +); +impl core::ops::Deref for ICoreWebView2Environment6 { + type Target = ICoreWebView2Environment5; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2Environment6, + windows_core::IUnknown, + ICoreWebView2Environment, + ICoreWebView2Environment2, + ICoreWebView2Environment3, + ICoreWebView2Environment4, + ICoreWebView2Environment5 +); +impl ICoreWebView2Environment6 { + pub unsafe fn CreatePrintSettings(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).CreatePrintSettings)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Environment6_Vtbl { + pub base__: ICoreWebView2Environment5_Vtbl, + pub CreatePrintSettings: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Environment6_Impl: ICoreWebView2Environment5_Impl { + fn CreatePrintSettings(&self) -> windows_core::Result; +} +impl ICoreWebView2Environment6_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn CreatePrintSettings< + Identity: ICoreWebView2Environment6_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2Environment6_Impl::CreatePrintSettings(this) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: ICoreWebView2Environment5_Vtbl::new::(), + CreatePrintSettings: CreatePrintSettings::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Environment6 {} +windows_core::imp::define_interface!( + ICoreWebView2Environment7, + ICoreWebView2Environment7_Vtbl, + 0x43c22296_3bbd_43a4_9c00_5c0df6dd29a2 +); +impl core::ops::Deref for ICoreWebView2Environment7 { + type Target = ICoreWebView2Environment6; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2Environment7, + windows_core::IUnknown, + ICoreWebView2Environment, + ICoreWebView2Environment2, + ICoreWebView2Environment3, + ICoreWebView2Environment4, + ICoreWebView2Environment5, + ICoreWebView2Environment6 +); +impl ICoreWebView2Environment7 { + pub unsafe fn UserDataFolder( + &self, + value: *mut windows_core::PWSTR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).UserDataFolder)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Environment7_Vtbl { + pub base__: ICoreWebView2Environment6_Vtbl, + pub UserDataFolder: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Environment7_Impl: ICoreWebView2Environment6_Impl { + fn UserDataFolder(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; +} +impl ICoreWebView2Environment7_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn UserDataFolder< + Identity: ICoreWebView2Environment7_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Environment7_Impl::UserDataFolder( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: ICoreWebView2Environment6_Vtbl::new::(), + UserDataFolder: UserDataFolder::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Environment7 {} +windows_core::imp::define_interface!( + ICoreWebView2Environment8, + ICoreWebView2Environment8_Vtbl, + 0xd6eb91dd_c3d2_45e5_bd29_6dc2bc4de9cf +); +impl core::ops::Deref for ICoreWebView2Environment8 { + type Target = ICoreWebView2Environment7; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2Environment8, + windows_core::IUnknown, + ICoreWebView2Environment, + ICoreWebView2Environment2, + ICoreWebView2Environment3, + ICoreWebView2Environment4, + ICoreWebView2Environment5, + ICoreWebView2Environment6, + ICoreWebView2Environment7 +); +impl ICoreWebView2Environment8 { + pub unsafe fn add_ProcessInfosChanged( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_ProcessInfosChanged)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_ProcessInfosChanged(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_ProcessInfosChanged)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } + pub unsafe fn GetProcessInfos( + &self, + ) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).GetProcessInfos)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Environment8_Vtbl { + pub base__: ICoreWebView2Environment7_Vtbl, + pub add_ProcessInfosChanged: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_ProcessInfosChanged: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, + pub GetProcessInfos: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Environment8_Impl: ICoreWebView2Environment7_Impl { + fn add_ProcessInfosChanged( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2ProcessInfosChangedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_ProcessInfosChanged(&self, token: i64) -> windows_core::Result<()>; + fn GetProcessInfos(&self) -> windows_core::Result; +} +impl ICoreWebView2Environment8_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn add_ProcessInfosChanged< + Identity: ICoreWebView2Environment8_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Environment8_Impl::add_ProcessInfosChanged( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_ProcessInfosChanged< + Identity: ICoreWebView2Environment8_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Environment8_Impl::remove_ProcessInfosChanged( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn GetProcessInfos< + Identity: ICoreWebView2Environment8_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2Environment8_Impl::GetProcessInfos(this) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: ICoreWebView2Environment7_Vtbl::new::(), + add_ProcessInfosChanged: add_ProcessInfosChanged::, + remove_ProcessInfosChanged: remove_ProcessInfosChanged::, + GetProcessInfos: GetProcessInfos::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Environment8 {} +windows_core::imp::define_interface!( + ICoreWebView2Environment9, + ICoreWebView2Environment9_Vtbl, + 0xf06f41bf_4b5a_49d8_b9f6_fa16cd29f274 +); +impl core::ops::Deref for ICoreWebView2Environment9 { + type Target = ICoreWebView2Environment8; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2Environment9, + windows_core::IUnknown, + ICoreWebView2Environment, + ICoreWebView2Environment2, + ICoreWebView2Environment3, + ICoreWebView2Environment4, + ICoreWebView2Environment5, + ICoreWebView2Environment6, + ICoreWebView2Environment7, + ICoreWebView2Environment8 +); +impl ICoreWebView2Environment9 { + pub unsafe fn CreateContextMenuItem( + &self, + label: P0, + iconstream: P1, + kind: COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND, + ) -> windows_core::Result + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).CreateContextMenuItem)( + windows_core::Interface::as_raw(self), + label.param().abi(), + iconstream.param().abi(), + kind, + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Environment9_Vtbl { + pub base__: ICoreWebView2Environment8_Vtbl, + pub CreateContextMenuItem: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + *mut core::ffi::c_void, + COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Environment9_Impl: ICoreWebView2Environment8_Impl { + fn CreateContextMenuItem( + &self, + label: &windows_core::PCWSTR, + iconstream: windows_core::Ref<'_, windows::Win32::System::Com::IStream>, + kind: COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND, + ) -> windows_core::Result; +} +impl ICoreWebView2Environment9_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn CreateContextMenuItem< + Identity: ICoreWebView2Environment9_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + label: windows_core::PCWSTR, + iconstream: *mut core::ffi::c_void, + kind: COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2Environment9_Impl::CreateContextMenuItem( + this, + core::mem::transmute(&label), + core::mem::transmute_copy(&iconstream), + core::mem::transmute_copy(&kind), + ) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: ICoreWebView2Environment8_Vtbl::new::(), + CreateContextMenuItem: CreateContextMenuItem::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Environment9 {} +windows_core::imp::define_interface!( + ICoreWebView2EnvironmentOptions, + ICoreWebView2EnvironmentOptions_Vtbl, + 0x2fde08a8_1e9a_4766_8c05_95a9ceb9d1c5 +); +windows_core::imp::interface_hierarchy!(ICoreWebView2EnvironmentOptions, windows_core::IUnknown); +impl ICoreWebView2EnvironmentOptions { + pub unsafe fn AdditionalBrowserArguments( + &self, + value: *mut windows_core::PWSTR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).AdditionalBrowserArguments)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetAdditionalBrowserArguments(&self, value: P0) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).SetAdditionalBrowserArguments)( + windows_core::Interface::as_raw(self), + value.param().abi(), + ) + .ok() + } + } + pub unsafe fn Language(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Language)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetLanguage(&self, value: P0) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).SetLanguage)( + windows_core::Interface::as_raw(self), + value.param().abi(), + ) + .ok() + } + } + pub unsafe fn TargetCompatibleBrowserVersion( + &self, + value: *mut windows_core::PWSTR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).TargetCompatibleBrowserVersion)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetTargetCompatibleBrowserVersion( + &self, + value: P0, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).SetTargetCompatibleBrowserVersion)( + windows_core::Interface::as_raw(self), + value.param().abi(), + ) + .ok() + } + } + pub unsafe fn AllowSingleSignOnUsingOSPrimaryAccount( + &self, + allow: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).AllowSingleSignOnUsingOSPrimaryAccount)( + windows_core::Interface::as_raw(self), + allow as _, + ) + .ok() + } + } + pub unsafe fn SetAllowSingleSignOnUsingOSPrimaryAccount( + &self, + allow: bool, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetAllowSingleSignOnUsingOSPrimaryAccount)( + windows_core::Interface::as_raw(self), + allow.into(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2EnvironmentOptions_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub AdditionalBrowserArguments: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub SetAdditionalBrowserArguments: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + ) -> windows_core::HRESULT, + pub Language: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub SetLanguage: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + ) -> windows_core::HRESULT, + pub TargetCompatibleBrowserVersion: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub SetTargetCompatibleBrowserVersion: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + ) -> windows_core::HRESULT, + pub AllowSingleSignOnUsingOSPrimaryAccount: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) + -> windows_core::HRESULT, + pub SetAllowSingleSignOnUsingOSPrimaryAccount: + unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2EnvironmentOptions_Impl: windows_core::IUnknownImpl { + fn AdditionalBrowserArguments( + &self, + value: *mut windows_core::PWSTR, + ) -> windows_core::Result<()>; + fn SetAdditionalBrowserArguments( + &self, + value: &windows_core::PCWSTR, + ) -> windows_core::Result<()>; + fn Language(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn SetLanguage(&self, value: &windows_core::PCWSTR) -> windows_core::Result<()>; + fn TargetCompatibleBrowserVersion( + &self, + value: *mut windows_core::PWSTR, + ) -> windows_core::Result<()>; + fn SetTargetCompatibleBrowserVersion( + &self, + value: &windows_core::PCWSTR, + ) -> windows_core::Result<()>; + fn AllowSingleSignOnUsingOSPrimaryAccount( + &self, + allow: *mut windows_core::BOOL, + ) -> windows_core::Result<()>; + fn SetAllowSingleSignOnUsingOSPrimaryAccount( + &self, + allow: windows_core::BOOL, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2EnvironmentOptions_Vtbl { + pub const fn new() -> Self + { + unsafe extern "system" fn AdditionalBrowserArguments< + Identity: ICoreWebView2EnvironmentOptions_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2EnvironmentOptions_Impl::AdditionalBrowserArguments( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetAdditionalBrowserArguments< + Identity: ICoreWebView2EnvironmentOptions_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::PCWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2EnvironmentOptions_Impl::SetAdditionalBrowserArguments( + this, + core::mem::transmute(&value), + ) + .into() + } + } + unsafe extern "system" fn Language< + Identity: ICoreWebView2EnvironmentOptions_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2EnvironmentOptions_Impl::Language( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetLanguage< + Identity: ICoreWebView2EnvironmentOptions_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::PCWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2EnvironmentOptions_Impl::SetLanguage( + this, + core::mem::transmute(&value), + ) + .into() + } + } + unsafe extern "system" fn TargetCompatibleBrowserVersion< + Identity: ICoreWebView2EnvironmentOptions_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2EnvironmentOptions_Impl::TargetCompatibleBrowserVersion( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetTargetCompatibleBrowserVersion< + Identity: ICoreWebView2EnvironmentOptions_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::PCWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2EnvironmentOptions_Impl::SetTargetCompatibleBrowserVersion( + this, + core::mem::transmute(&value), + ) + .into() + } + } + unsafe extern "system" fn AllowSingleSignOnUsingOSPrimaryAccount< + Identity: ICoreWebView2EnvironmentOptions_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + allow: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2EnvironmentOptions_Impl::AllowSingleSignOnUsingOSPrimaryAccount( + this, + core::mem::transmute_copy(&allow), + ) + .into() + } + } + unsafe extern "system" fn SetAllowSingleSignOnUsingOSPrimaryAccount< + Identity: ICoreWebView2EnvironmentOptions_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + allow: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2EnvironmentOptions_Impl::SetAllowSingleSignOnUsingOSPrimaryAccount( + this, + core::mem::transmute_copy(&allow), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + AdditionalBrowserArguments: AdditionalBrowserArguments::, + SetAdditionalBrowserArguments: SetAdditionalBrowserArguments::, + Language: Language::, + SetLanguage: SetLanguage::, + TargetCompatibleBrowserVersion: TargetCompatibleBrowserVersion::, + SetTargetCompatibleBrowserVersion: SetTargetCompatibleBrowserVersion::, + AllowSingleSignOnUsingOSPrimaryAccount: AllowSingleSignOnUsingOSPrimaryAccount::< + Identity, + OFFSET, + >, + SetAllowSingleSignOnUsingOSPrimaryAccount: SetAllowSingleSignOnUsingOSPrimaryAccount::< + Identity, + OFFSET, + >, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2EnvironmentOptions {} +windows_core::imp::define_interface!( + ICoreWebView2EnvironmentOptions2, + ICoreWebView2EnvironmentOptions2_Vtbl, + 0xff85c98a_1ba7_4a6b_90c8_2b752c89e9e2 +); +windows_core::imp::interface_hierarchy!(ICoreWebView2EnvironmentOptions2, windows_core::IUnknown); +impl ICoreWebView2EnvironmentOptions2 { + pub unsafe fn ExclusiveUserDataFolderAccess( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ExclusiveUserDataFolderAccess)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetExclusiveUserDataFolderAccess(&self, value: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetExclusiveUserDataFolderAccess)( + windows_core::Interface::as_raw(self), + value.into(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2EnvironmentOptions2_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub ExclusiveUserDataFolderAccess: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetExclusiveUserDataFolderAccess: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2EnvironmentOptions2_Impl: windows_core::IUnknownImpl { + fn ExclusiveUserDataFolderAccess( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()>; + fn SetExclusiveUserDataFolderAccess( + &self, + value: windows_core::BOOL, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2EnvironmentOptions2_Vtbl { + pub const fn new() -> Self + { + unsafe extern "system" fn ExclusiveUserDataFolderAccess< + Identity: ICoreWebView2EnvironmentOptions2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2EnvironmentOptions2_Impl::ExclusiveUserDataFolderAccess( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetExclusiveUserDataFolderAccess< + Identity: ICoreWebView2EnvironmentOptions2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2EnvironmentOptions2_Impl::SetExclusiveUserDataFolderAccess( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + ExclusiveUserDataFolderAccess: ExclusiveUserDataFolderAccess::, + SetExclusiveUserDataFolderAccess: SetExclusiveUserDataFolderAccess::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2EnvironmentOptions2 {} +windows_core::imp::define_interface!( + ICoreWebView2EnvironmentOptions3, + ICoreWebView2EnvironmentOptions3_Vtbl, + 0x4a5c436e_a9e3_4a2e_89c3_910d3513f5cc +); +windows_core::imp::interface_hierarchy!(ICoreWebView2EnvironmentOptions3, windows_core::IUnknown); +impl ICoreWebView2EnvironmentOptions3 { + pub unsafe fn IsCustomCrashReportingEnabled( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).IsCustomCrashReportingEnabled)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetIsCustomCrashReportingEnabled(&self, value: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetIsCustomCrashReportingEnabled)( + windows_core::Interface::as_raw(self), + value.into(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2EnvironmentOptions3_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub IsCustomCrashReportingEnabled: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetIsCustomCrashReportingEnabled: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2EnvironmentOptions3_Impl: windows_core::IUnknownImpl { + fn IsCustomCrashReportingEnabled( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()>; + fn SetIsCustomCrashReportingEnabled( + &self, + value: windows_core::BOOL, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2EnvironmentOptions3_Vtbl { + pub const fn new() -> Self + { + unsafe extern "system" fn IsCustomCrashReportingEnabled< + Identity: ICoreWebView2EnvironmentOptions3_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2EnvironmentOptions3_Impl::IsCustomCrashReportingEnabled( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetIsCustomCrashReportingEnabled< + Identity: ICoreWebView2EnvironmentOptions3_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2EnvironmentOptions3_Impl::SetIsCustomCrashReportingEnabled( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + IsCustomCrashReportingEnabled: IsCustomCrashReportingEnabled::, + SetIsCustomCrashReportingEnabled: SetIsCustomCrashReportingEnabled::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2EnvironmentOptions3 {} +windows_core::imp::define_interface!( + ICoreWebView2EnvironmentOptions4, + ICoreWebView2EnvironmentOptions4_Vtbl, + 0xac52d13f_0d38_475a_9dca_876580d6793e +); +windows_core::imp::interface_hierarchy!(ICoreWebView2EnvironmentOptions4, windows_core::IUnknown); +impl ICoreWebView2EnvironmentOptions4 { + pub unsafe fn GetCustomSchemeRegistrations( + &self, + count: *mut u32, + schemeregistrations: *mut *mut Option, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).GetCustomSchemeRegistrations)( + windows_core::Interface::as_raw(self), + count as _, + schemeregistrations as _, + ) + .ok() + } + } + pub unsafe fn SetCustomSchemeRegistrations( + &self, + count: u32, + ) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).SetCustomSchemeRegistrations)( + windows_core::Interface::as_raw(self), + count, + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2EnvironmentOptions4_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub GetCustomSchemeRegistrations: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut u32, + *mut *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub SetCustomSchemeRegistrations: unsafe extern "system" fn( + *mut core::ffi::c_void, + u32, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2EnvironmentOptions4_Impl: windows_core::IUnknownImpl { + fn GetCustomSchemeRegistrations( + &self, + count: *mut u32, + schemeregistrations: *mut *mut Option, + ) -> windows_core::Result<()>; + fn SetCustomSchemeRegistrations( + &self, + count: u32, + ) -> windows_core::Result; +} +impl ICoreWebView2EnvironmentOptions4_Vtbl { + pub const fn new() -> Self + { + unsafe extern "system" fn GetCustomSchemeRegistrations< + Identity: ICoreWebView2EnvironmentOptions4_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + count: *mut u32, + schemeregistrations: *mut *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2EnvironmentOptions4_Impl::GetCustomSchemeRegistrations( + this, + core::mem::transmute_copy(&count), + core::mem::transmute_copy(&schemeregistrations), + ) + .into() + } + } + unsafe extern "system" fn SetCustomSchemeRegistrations< + Identity: ICoreWebView2EnvironmentOptions4_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + count: u32, + schemeregistrations: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2EnvironmentOptions4_Impl::SetCustomSchemeRegistrations( + this, + core::mem::transmute_copy(&count), + ) { + Ok(ok__) => { + schemeregistrations.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + GetCustomSchemeRegistrations: GetCustomSchemeRegistrations::, + SetCustomSchemeRegistrations: SetCustomSchemeRegistrations::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2EnvironmentOptions4 {} +windows_core::imp::define_interface!( + ICoreWebView2EnvironmentOptions5, + ICoreWebView2EnvironmentOptions5_Vtbl, + 0x0ae35d64_c47f_4464_814e_259c345d1501 +); +windows_core::imp::interface_hierarchy!(ICoreWebView2EnvironmentOptions5, windows_core::IUnknown); +impl ICoreWebView2EnvironmentOptions5 { + pub unsafe fn EnableTrackingPrevention( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).EnableTrackingPrevention)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetEnableTrackingPrevention(&self, value: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetEnableTrackingPrevention)( + windows_core::Interface::as_raw(self), + value.into(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2EnvironmentOptions5_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub EnableTrackingPrevention: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetEnableTrackingPrevention: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2EnvironmentOptions5_Impl: windows_core::IUnknownImpl { + fn EnableTrackingPrevention(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn SetEnableTrackingPrevention(&self, value: windows_core::BOOL) -> windows_core::Result<()>; +} +impl ICoreWebView2EnvironmentOptions5_Vtbl { + pub const fn new() -> Self + { + unsafe extern "system" fn EnableTrackingPrevention< + Identity: ICoreWebView2EnvironmentOptions5_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2EnvironmentOptions5_Impl::EnableTrackingPrevention( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetEnableTrackingPrevention< + Identity: ICoreWebView2EnvironmentOptions5_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2EnvironmentOptions5_Impl::SetEnableTrackingPrevention( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + EnableTrackingPrevention: EnableTrackingPrevention::, + SetEnableTrackingPrevention: SetEnableTrackingPrevention::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2EnvironmentOptions5 {} +windows_core::imp::define_interface!( + ICoreWebView2EnvironmentOptions6, + ICoreWebView2EnvironmentOptions6_Vtbl, + 0x57d29cc3_c84f_42a0_b0e2_effbd5e179de +); +windows_core::imp::interface_hierarchy!(ICoreWebView2EnvironmentOptions6, windows_core::IUnknown); +impl ICoreWebView2EnvironmentOptions6 { + pub unsafe fn AreBrowserExtensionsEnabled( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).AreBrowserExtensionsEnabled)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetAreBrowserExtensionsEnabled(&self, value: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetAreBrowserExtensionsEnabled)( + windows_core::Interface::as_raw(self), + value.into(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2EnvironmentOptions6_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub AreBrowserExtensionsEnabled: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetAreBrowserExtensionsEnabled: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2EnvironmentOptions6_Impl: windows_core::IUnknownImpl { + fn AreBrowserExtensionsEnabled( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()>; + fn SetAreBrowserExtensionsEnabled(&self, value: windows_core::BOOL) + -> windows_core::Result<()>; +} +impl ICoreWebView2EnvironmentOptions6_Vtbl { + pub const fn new() -> Self + { + unsafe extern "system" fn AreBrowserExtensionsEnabled< + Identity: ICoreWebView2EnvironmentOptions6_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2EnvironmentOptions6_Impl::AreBrowserExtensionsEnabled( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetAreBrowserExtensionsEnabled< + Identity: ICoreWebView2EnvironmentOptions6_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2EnvironmentOptions6_Impl::SetAreBrowserExtensionsEnabled( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + AreBrowserExtensionsEnabled: AreBrowserExtensionsEnabled::, + SetAreBrowserExtensionsEnabled: SetAreBrowserExtensionsEnabled::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2EnvironmentOptions6 {} +windows_core::imp::define_interface!( + ICoreWebView2EnvironmentOptions7, + ICoreWebView2EnvironmentOptions7_Vtbl, + 0xc48d539f_e39f_441c_ae68_1f66e570bdc5 +); +windows_core::imp::interface_hierarchy!(ICoreWebView2EnvironmentOptions7, windows_core::IUnknown); +impl ICoreWebView2EnvironmentOptions7 { + pub unsafe fn ChannelSearchKind( + &self, + value: *mut COREWEBVIEW2_CHANNEL_SEARCH_KIND, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ChannelSearchKind)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetChannelSearchKind( + &self, + value: COREWEBVIEW2_CHANNEL_SEARCH_KIND, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetChannelSearchKind)( + windows_core::Interface::as_raw(self), + value, + ) + .ok() + } + } + pub unsafe fn ReleaseChannels( + &self, + value: *mut COREWEBVIEW2_RELEASE_CHANNELS, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ReleaseChannels)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetReleaseChannels( + &self, + value: COREWEBVIEW2_RELEASE_CHANNELS, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetReleaseChannels)( + windows_core::Interface::as_raw(self), + value, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2EnvironmentOptions7_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub ChannelSearchKind: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_CHANNEL_SEARCH_KIND, + ) -> windows_core::HRESULT, + pub SetChannelSearchKind: unsafe extern "system" fn( + *mut core::ffi::c_void, + COREWEBVIEW2_CHANNEL_SEARCH_KIND, + ) -> windows_core::HRESULT, + pub ReleaseChannels: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_RELEASE_CHANNELS, + ) -> windows_core::HRESULT, + pub SetReleaseChannels: unsafe extern "system" fn( + *mut core::ffi::c_void, + COREWEBVIEW2_RELEASE_CHANNELS, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2EnvironmentOptions7_Impl: windows_core::IUnknownImpl { + fn ChannelSearchKind( + &self, + value: *mut COREWEBVIEW2_CHANNEL_SEARCH_KIND, + ) -> windows_core::Result<()>; + fn SetChannelSearchKind( + &self, + value: COREWEBVIEW2_CHANNEL_SEARCH_KIND, + ) -> windows_core::Result<()>; + fn ReleaseChannels( + &self, + value: *mut COREWEBVIEW2_RELEASE_CHANNELS, + ) -> windows_core::Result<()>; + fn SetReleaseChannels(&self, value: COREWEBVIEW2_RELEASE_CHANNELS) -> windows_core::Result<()>; +} +impl ICoreWebView2EnvironmentOptions7_Vtbl { + pub const fn new() -> Self + { + unsafe extern "system" fn ChannelSearchKind< + Identity: ICoreWebView2EnvironmentOptions7_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut COREWEBVIEW2_CHANNEL_SEARCH_KIND, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2EnvironmentOptions7_Impl::ChannelSearchKind( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetChannelSearchKind< + Identity: ICoreWebView2EnvironmentOptions7_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: COREWEBVIEW2_CHANNEL_SEARCH_KIND, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2EnvironmentOptions7_Impl::SetChannelSearchKind( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn ReleaseChannels< + Identity: ICoreWebView2EnvironmentOptions7_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut COREWEBVIEW2_RELEASE_CHANNELS, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2EnvironmentOptions7_Impl::ReleaseChannels( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetReleaseChannels< + Identity: ICoreWebView2EnvironmentOptions7_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: COREWEBVIEW2_RELEASE_CHANNELS, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2EnvironmentOptions7_Impl::SetReleaseChannels( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + ChannelSearchKind: ChannelSearchKind::, + SetChannelSearchKind: SetChannelSearchKind::, + ReleaseChannels: ReleaseChannels::, + SetReleaseChannels: SetReleaseChannels::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2EnvironmentOptions7 {} +windows_core::imp::define_interface!( + ICoreWebView2EnvironmentOptions8, + ICoreWebView2EnvironmentOptions8_Vtbl, + 0x7c7ecf51_e918_5caf_853c_e9a2bcc27775 +); +windows_core::imp::interface_hierarchy!(ICoreWebView2EnvironmentOptions8, windows_core::IUnknown); +impl ICoreWebView2EnvironmentOptions8 { + pub unsafe fn ScrollBarStyle( + &self, + value: *mut COREWEBVIEW2_SCROLLBAR_STYLE, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ScrollBarStyle)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetScrollBarStyle( + &self, + value: COREWEBVIEW2_SCROLLBAR_STYLE, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetScrollBarStyle)( + windows_core::Interface::as_raw(self), + value, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2EnvironmentOptions8_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub ScrollBarStyle: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_SCROLLBAR_STYLE, + ) -> windows_core::HRESULT, + pub SetScrollBarStyle: unsafe extern "system" fn( + *mut core::ffi::c_void, + COREWEBVIEW2_SCROLLBAR_STYLE, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2EnvironmentOptions8_Impl: windows_core::IUnknownImpl { + fn ScrollBarStyle(&self, value: *mut COREWEBVIEW2_SCROLLBAR_STYLE) -> windows_core::Result<()>; + fn SetScrollBarStyle(&self, value: COREWEBVIEW2_SCROLLBAR_STYLE) -> windows_core::Result<()>; +} +impl ICoreWebView2EnvironmentOptions8_Vtbl { + pub const fn new() -> Self + { + unsafe extern "system" fn ScrollBarStyle< + Identity: ICoreWebView2EnvironmentOptions8_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut COREWEBVIEW2_SCROLLBAR_STYLE, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2EnvironmentOptions8_Impl::ScrollBarStyle( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetScrollBarStyle< + Identity: ICoreWebView2EnvironmentOptions8_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: COREWEBVIEW2_SCROLLBAR_STYLE, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2EnvironmentOptions8_Impl::SetScrollBarStyle( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + ScrollBarStyle: ScrollBarStyle::, + SetScrollBarStyle: SetScrollBarStyle::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2EnvironmentOptions8 {} +windows_core::imp::define_interface!( + ICoreWebView2EstimatedEndTimeChangedEventHandler, + ICoreWebView2EstimatedEndTimeChangedEventHandler_Vtbl, + 0x28f0d425_93fe_4e63_9f8d_2aeec6d3ba1e +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2EstimatedEndTimeChangedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2EstimatedEndTimeChangedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2EstimatedEndTimeChangedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2EstimatedEndTimeChangedEventHandler_Impl: + windows_core::IUnknownImpl +{ + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2DownloadOperation>, + args: windows_core::Ref<'_, windows_core::IUnknown>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2EstimatedEndTimeChangedEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2EstimatedEndTimeChangedEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2EstimatedEndTimeChangedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2EstimatedEndTimeChangedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2EstimatedEndTimeChangedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2ExecuteScriptCompletedHandler, + ICoreWebView2ExecuteScriptCompletedHandler_Vtbl, + 0x49511172_cc67_4bca_9923_137112f4c4cc +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2ExecuteScriptCompletedHandler, + windows_core::IUnknown +); +impl ICoreWebView2ExecuteScriptCompletedHandler { + pub unsafe fn Invoke( + &self, + errorcode: windows_core::HRESULT, + result: P1, + ) -> windows_core::Result<()> + where + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + errorcode, + result.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2ExecuteScriptCompletedHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::HRESULT, + windows_core::PCWSTR, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2ExecuteScriptCompletedHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + errorcode: windows_core::HRESULT, + result: &windows_core::PCWSTR, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2ExecuteScriptCompletedHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2ExecuteScriptCompletedHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2ExecuteScriptCompletedHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + errorcode: windows_core::HRESULT, + result: windows_core::PCWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ExecuteScriptCompletedHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&errorcode), + core::mem::transmute(&result), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2ExecuteScriptCompletedHandler {} +windows_core::imp::define_interface!( + ICoreWebView2ExecuteScriptResult, + ICoreWebView2ExecuteScriptResult_Vtbl, + 0x0ce15963_3698_4df7_9399_71ed6cdd8c9f +); +windows_core::imp::interface_hierarchy!(ICoreWebView2ExecuteScriptResult, windows_core::IUnknown); +impl ICoreWebView2ExecuteScriptResult { + pub unsafe fn Succeeded(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Succeeded)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn ResultAsJson( + &self, + jsonresult: *mut windows_core::PWSTR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ResultAsJson)( + windows_core::Interface::as_raw(self), + jsonresult as _, + ) + .ok() + } + } + pub unsafe fn TryGetResultAsString( + &self, + stringresult: *mut windows_core::PWSTR, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).TryGetResultAsString)( + windows_core::Interface::as_raw(self), + stringresult as _, + value as _, + ) + .ok() + } + } + pub unsafe fn Exception(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).Exception)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2ExecuteScriptResult_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Succeeded: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub ResultAsJson: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub TryGetResultAsString: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub Exception: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2ExecuteScriptResult_Impl: windows_core::IUnknownImpl { + fn Succeeded(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn ResultAsJson(&self, jsonresult: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn TryGetResultAsString( + &self, + stringresult: *mut windows_core::PWSTR, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()>; + fn Exception(&self) -> windows_core::Result; +} +impl ICoreWebView2ExecuteScriptResult_Vtbl { + pub const fn new() -> Self + { + unsafe extern "system" fn Succeeded< + Identity: ICoreWebView2ExecuteScriptResult_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ExecuteScriptResult_Impl::Succeeded( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn ResultAsJson< + Identity: ICoreWebView2ExecuteScriptResult_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + jsonresult: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ExecuteScriptResult_Impl::ResultAsJson( + this, + core::mem::transmute_copy(&jsonresult), + ) + .into() + } + } + unsafe extern "system" fn TryGetResultAsString< + Identity: ICoreWebView2ExecuteScriptResult_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + stringresult: *mut windows_core::PWSTR, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ExecuteScriptResult_Impl::TryGetResultAsString( + this, + core::mem::transmute_copy(&stringresult), + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn Exception< + Identity: ICoreWebView2ExecuteScriptResult_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + exception: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2ExecuteScriptResult_Impl::Exception(this) { + Ok(ok__) => { + exception.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Succeeded: Succeeded::, + ResultAsJson: ResultAsJson::, + TryGetResultAsString: TryGetResultAsString::, + Exception: Exception::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2ExecuteScriptResult {} +windows_core::imp::define_interface!( + ICoreWebView2ExecuteScriptWithResultCompletedHandler, + ICoreWebView2ExecuteScriptWithResultCompletedHandler_Vtbl, + 0x1bb5317b_8238_4c67_a7ff_baf6558f289d +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2ExecuteScriptWithResultCompletedHandler, + windows_core::IUnknown +); +impl ICoreWebView2ExecuteScriptWithResultCompletedHandler { + pub unsafe fn Invoke( + &self, + errorcode: windows_core::HRESULT, + result: P1, + ) -> windows_core::Result<()> + where + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + errorcode, + result.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2ExecuteScriptWithResultCompletedHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::HRESULT, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2ExecuteScriptWithResultCompletedHandler_Impl: + windows_core::IUnknownImpl +{ + fn Invoke( + &self, + errorcode: windows_core::HRESULT, + result: windows_core::Ref<'_, ICoreWebView2ExecuteScriptResult>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2ExecuteScriptWithResultCompletedHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2ExecuteScriptWithResultCompletedHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2ExecuteScriptWithResultCompletedHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + errorcode: windows_core::HRESULT, + result: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ExecuteScriptWithResultCompletedHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&errorcode), + core::mem::transmute_copy(&result), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == & < ICoreWebView2ExecuteScriptWithResultCompletedHandler as windows_core::Interface >::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2ExecuteScriptWithResultCompletedHandler {} +windows_core::imp::define_interface!( + ICoreWebView2FaviconChangedEventHandler, + ICoreWebView2FaviconChangedEventHandler_Vtbl, + 0x2913da94_833d_4de0_8dca_900fc524a1a4 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2FaviconChangedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2FaviconChangedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2FaviconChangedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2FaviconChangedEventHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2>, + args: windows_core::Ref<'_, windows_core::IUnknown>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2FaviconChangedEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2FaviconChangedEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2FaviconChangedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2FaviconChangedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2FaviconChangedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2File, + ICoreWebView2File_Vtbl, + 0xf2c19559_6bc1_4583_a757_90021be9afec +); +windows_core::imp::interface_hierarchy!(ICoreWebView2File, windows_core::IUnknown); +impl ICoreWebView2File { + pub unsafe fn Path(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Path)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2File_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Path: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2File_Impl: windows_core::IUnknownImpl { + fn Path(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; +} +impl ICoreWebView2File_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn Path( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2File_Impl::Path(this, core::mem::transmute_copy(&value)).into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Path: Path::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2File {} +windows_core::imp::define_interface!( + ICoreWebView2FileSystemHandle, + ICoreWebView2FileSystemHandle_Vtbl, + 0xc65100ac_0de2_5551_a362_23d9bd1d0e1f +); +windows_core::imp::interface_hierarchy!(ICoreWebView2FileSystemHandle, windows_core::IUnknown); +impl ICoreWebView2FileSystemHandle { + pub unsafe fn Kind( + &self, + value: *mut COREWEBVIEW2_FILE_SYSTEM_HANDLE_KIND, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Kind)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn Path(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Path)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn Permission( + &self, + value: *mut COREWEBVIEW2_FILE_SYSTEM_HANDLE_PERMISSION, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Permission)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2FileSystemHandle_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Kind: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_FILE_SYSTEM_HANDLE_KIND, + ) -> windows_core::HRESULT, + pub Path: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub Permission: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_FILE_SYSTEM_HANDLE_PERMISSION, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2FileSystemHandle_Impl: windows_core::IUnknownImpl { + fn Kind(&self, value: *mut COREWEBVIEW2_FILE_SYSTEM_HANDLE_KIND) -> windows_core::Result<()>; + fn Path(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn Permission( + &self, + value: *mut COREWEBVIEW2_FILE_SYSTEM_HANDLE_PERMISSION, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2FileSystemHandle_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn Kind< + Identity: ICoreWebView2FileSystemHandle_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut COREWEBVIEW2_FILE_SYSTEM_HANDLE_KIND, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2FileSystemHandle_Impl::Kind(this, core::mem::transmute_copy(&value)) + .into() + } + } + unsafe extern "system" fn Path< + Identity: ICoreWebView2FileSystemHandle_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2FileSystemHandle_Impl::Path(this, core::mem::transmute_copy(&value)) + .into() + } + } + unsafe extern "system" fn Permission< + Identity: ICoreWebView2FileSystemHandle_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut COREWEBVIEW2_FILE_SYSTEM_HANDLE_PERMISSION, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2FileSystemHandle_Impl::Permission( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Kind: Kind::, + Path: Path::, + Permission: Permission::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2FileSystemHandle {} +windows_core::imp::define_interface!( + ICoreWebView2Find, + ICoreWebView2Find_Vtbl, + 0xa3ec0f5f_ddbc_54ed_8546_af75a785b9a6 +); +windows_core::imp::interface_hierarchy!(ICoreWebView2Find, windows_core::IUnknown); +impl ICoreWebView2Find { + pub unsafe fn ActiveMatchIndex(&self, value: *mut i32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ActiveMatchIndex)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn MatchCount(&self, value: *mut i32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).MatchCount)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn add_ActiveMatchIndexChanged( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_ActiveMatchIndexChanged)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_ActiveMatchIndexChanged(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_ActiveMatchIndexChanged)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } + pub unsafe fn add_MatchCountChanged( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_MatchCountChanged)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_MatchCountChanged(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_MatchCountChanged)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } + pub unsafe fn Start(&self, options: P0, handler: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Start)( + windows_core::Interface::as_raw(self), + options.param().abi(), + handler.param().abi(), + ) + .ok() + } + } + pub unsafe fn FindNext(&self) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).FindNext)(windows_core::Interface::as_raw(self)) + .ok() + } + } + pub unsafe fn FindPrevious(&self) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).FindPrevious)(windows_core::Interface::as_raw( + self, + )) + .ok() + } + } + pub unsafe fn Stop(&self) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Stop)(windows_core::Interface::as_raw(self)).ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Find_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub ActiveMatchIndex: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut i32) -> windows_core::HRESULT, + pub MatchCount: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut i32) -> windows_core::HRESULT, + pub add_ActiveMatchIndexChanged: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_ActiveMatchIndexChanged: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, + pub add_MatchCountChanged: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_MatchCountChanged: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, + pub Start: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub FindNext: unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT, + pub FindPrevious: unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT, + pub Stop: unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Find_Impl: windows_core::IUnknownImpl { + fn ActiveMatchIndex(&self, value: *mut i32) -> windows_core::Result<()>; + fn MatchCount(&self, value: *mut i32) -> windows_core::Result<()>; + fn add_ActiveMatchIndexChanged( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2FindActiveMatchIndexChangedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_ActiveMatchIndexChanged(&self, token: i64) -> windows_core::Result<()>; + fn add_MatchCountChanged( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2FindMatchCountChangedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_MatchCountChanged(&self, token: i64) -> windows_core::Result<()>; + fn Start( + &self, + options: windows_core::Ref<'_, ICoreWebView2FindOptions>, + handler: windows_core::Ref<'_, ICoreWebView2FindStartCompletedHandler>, + ) -> windows_core::Result<()>; + fn FindNext(&self) -> windows_core::Result<()>; + fn FindPrevious(&self) -> windows_core::Result<()>; + fn Stop(&self) -> windows_core::Result<()>; +} +impl ICoreWebView2Find_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn ActiveMatchIndex< + Identity: ICoreWebView2Find_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut i32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Find_Impl::ActiveMatchIndex(this, core::mem::transmute_copy(&value)) + .into() + } + } + unsafe extern "system" fn MatchCount< + Identity: ICoreWebView2Find_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut i32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Find_Impl::MatchCount(this, core::mem::transmute_copy(&value)).into() + } + } + unsafe extern "system" fn add_ActiveMatchIndexChanged< + Identity: ICoreWebView2Find_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Find_Impl::add_ActiveMatchIndexChanged( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_ActiveMatchIndexChanged< + Identity: ICoreWebView2Find_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Find_Impl::remove_ActiveMatchIndexChanged( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn add_MatchCountChanged< + Identity: ICoreWebView2Find_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Find_Impl::add_MatchCountChanged( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_MatchCountChanged< + Identity: ICoreWebView2Find_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Find_Impl::remove_MatchCountChanged( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn Start( + this: *mut core::ffi::c_void, + options: *mut core::ffi::c_void, + handler: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Find_Impl::Start( + this, + core::mem::transmute_copy(&options), + core::mem::transmute_copy(&handler), + ) + .into() + } + } + unsafe extern "system" fn FindNext< + Identity: ICoreWebView2Find_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Find_Impl::FindNext(this).into() + } + } + unsafe extern "system" fn FindPrevious< + Identity: ICoreWebView2Find_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Find_Impl::FindPrevious(this).into() + } + } + unsafe extern "system" fn Stop( + this: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Find_Impl::Stop(this).into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + ActiveMatchIndex: ActiveMatchIndex::, + MatchCount: MatchCount::, + add_ActiveMatchIndexChanged: add_ActiveMatchIndexChanged::, + remove_ActiveMatchIndexChanged: remove_ActiveMatchIndexChanged::, + add_MatchCountChanged: add_MatchCountChanged::, + remove_MatchCountChanged: remove_MatchCountChanged::, + Start: Start::, + FindNext: FindNext::, + FindPrevious: FindPrevious::, + Stop: Stop::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Find {} +windows_core::imp::define_interface!( + ICoreWebView2FindActiveMatchIndexChangedEventHandler, + ICoreWebView2FindActiveMatchIndexChangedEventHandler_Vtbl, + 0x0054f514_9a8e_5876_aed5_30b37f8c86a5 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2FindActiveMatchIndexChangedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2FindActiveMatchIndexChangedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2FindActiveMatchIndexChangedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2FindActiveMatchIndexChangedEventHandler_Impl: + windows_core::IUnknownImpl +{ + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2Find>, + args: windows_core::Ref<'_, windows_core::IUnknown>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2FindActiveMatchIndexChangedEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2FindActiveMatchIndexChangedEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2FindActiveMatchIndexChangedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2FindActiveMatchIndexChangedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == & < ICoreWebView2FindActiveMatchIndexChangedEventHandler as windows_core::Interface >::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2FindActiveMatchIndexChangedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2FindMatchCountChangedEventHandler, + ICoreWebView2FindMatchCountChangedEventHandler_Vtbl, + 0xda0d6827_4254_5b10_a6d9_412076afc9f3 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2FindMatchCountChangedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2FindMatchCountChangedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2FindMatchCountChangedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2FindMatchCountChangedEventHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2Find>, + args: windows_core::Ref<'_, windows_core::IUnknown>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2FindMatchCountChangedEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2FindMatchCountChangedEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2FindMatchCountChangedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2FindMatchCountChangedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2FindMatchCountChangedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2FindOptions, + ICoreWebView2FindOptions_Vtbl, + 0xe82e3b2b_a4af_5bc6_94c6_18b44157a16c +); +windows_core::imp::interface_hierarchy!(ICoreWebView2FindOptions, windows_core::IUnknown); +impl ICoreWebView2FindOptions { + pub unsafe fn FindTerm(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).FindTerm)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetFindTerm(&self, value: P0) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).SetFindTerm)( + windows_core::Interface::as_raw(self), + value.param().abi(), + ) + .ok() + } + } + pub unsafe fn IsCaseSensitive( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).IsCaseSensitive)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetIsCaseSensitive(&self, value: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetIsCaseSensitive)( + windows_core::Interface::as_raw(self), + value.into(), + ) + .ok() + } + } + pub unsafe fn ShouldHighlightAllMatches( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ShouldHighlightAllMatches)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetShouldHighlightAllMatches(&self, value: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetShouldHighlightAllMatches)( + windows_core::Interface::as_raw(self), + value.into(), + ) + .ok() + } + } + pub unsafe fn ShouldMatchWord( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ShouldMatchWord)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetShouldMatchWord(&self, value: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetShouldMatchWord)( + windows_core::Interface::as_raw(self), + value.into(), + ) + .ok() + } + } + pub unsafe fn SuppressDefaultFindDialog( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SuppressDefaultFindDialog)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetSuppressDefaultFindDialog(&self, value: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetSuppressDefaultFindDialog)( + windows_core::Interface::as_raw(self), + value.into(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2FindOptions_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub FindTerm: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub SetFindTerm: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + ) -> windows_core::HRESULT, + pub IsCaseSensitive: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetIsCaseSensitive: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, + pub ShouldHighlightAllMatches: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetShouldHighlightAllMatches: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, + pub ShouldMatchWord: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetShouldMatchWord: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SuppressDefaultFindDialog: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetSuppressDefaultFindDialog: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2FindOptions_Impl: windows_core::IUnknownImpl { + fn FindTerm(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn SetFindTerm(&self, value: &windows_core::PCWSTR) -> windows_core::Result<()>; + fn IsCaseSensitive(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn SetIsCaseSensitive(&self, value: windows_core::BOOL) -> windows_core::Result<()>; + fn ShouldHighlightAllMatches(&self, value: *mut windows_core::BOOL) + -> windows_core::Result<()>; + fn SetShouldHighlightAllMatches(&self, value: windows_core::BOOL) -> windows_core::Result<()>; + fn ShouldMatchWord(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn SetShouldMatchWord(&self, value: windows_core::BOOL) -> windows_core::Result<()>; + fn SuppressDefaultFindDialog(&self, value: *mut windows_core::BOOL) + -> windows_core::Result<()>; + fn SetSuppressDefaultFindDialog(&self, value: windows_core::BOOL) -> windows_core::Result<()>; +} +impl ICoreWebView2FindOptions_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn FindTerm< + Identity: ICoreWebView2FindOptions_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2FindOptions_Impl::FindTerm(this, core::mem::transmute_copy(&value)) + .into() + } + } + unsafe extern "system" fn SetFindTerm< + Identity: ICoreWebView2FindOptions_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::PCWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2FindOptions_Impl::SetFindTerm(this, core::mem::transmute(&value)) + .into() + } + } + unsafe extern "system" fn IsCaseSensitive< + Identity: ICoreWebView2FindOptions_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2FindOptions_Impl::IsCaseSensitive( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetIsCaseSensitive< + Identity: ICoreWebView2FindOptions_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2FindOptions_Impl::SetIsCaseSensitive( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn ShouldHighlightAllMatches< + Identity: ICoreWebView2FindOptions_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2FindOptions_Impl::ShouldHighlightAllMatches( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetShouldHighlightAllMatches< + Identity: ICoreWebView2FindOptions_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2FindOptions_Impl::SetShouldHighlightAllMatches( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn ShouldMatchWord< + Identity: ICoreWebView2FindOptions_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2FindOptions_Impl::ShouldMatchWord( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetShouldMatchWord< + Identity: ICoreWebView2FindOptions_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2FindOptions_Impl::SetShouldMatchWord( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SuppressDefaultFindDialog< + Identity: ICoreWebView2FindOptions_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2FindOptions_Impl::SuppressDefaultFindDialog( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetSuppressDefaultFindDialog< + Identity: ICoreWebView2FindOptions_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2FindOptions_Impl::SetSuppressDefaultFindDialog( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + FindTerm: FindTerm::, + SetFindTerm: SetFindTerm::, + IsCaseSensitive: IsCaseSensitive::, + SetIsCaseSensitive: SetIsCaseSensitive::, + ShouldHighlightAllMatches: ShouldHighlightAllMatches::, + SetShouldHighlightAllMatches: SetShouldHighlightAllMatches::, + ShouldMatchWord: ShouldMatchWord::, + SetShouldMatchWord: SetShouldMatchWord::, + SuppressDefaultFindDialog: SuppressDefaultFindDialog::, + SetSuppressDefaultFindDialog: SetSuppressDefaultFindDialog::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2FindOptions {} +windows_core::imp::define_interface!( + ICoreWebView2FindStartCompletedHandler, + ICoreWebView2FindStartCompletedHandler_Vtbl, + 0x6a90ecaf_44b0_5bd9_8f07_1967e17be9fb +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2FindStartCompletedHandler, + windows_core::IUnknown +); +impl ICoreWebView2FindStartCompletedHandler { + pub unsafe fn Invoke(&self, errorcode: windows_core::HRESULT) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + errorcode, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2FindStartCompletedHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::HRESULT, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2FindStartCompletedHandler_Impl: windows_core::IUnknownImpl { + fn Invoke(&self, errorcode: windows_core::HRESULT) -> windows_core::Result<()>; +} +impl ICoreWebView2FindStartCompletedHandler_Vtbl { + pub const fn new( + ) -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2FindStartCompletedHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + errorcode: windows_core::HRESULT, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2FindStartCompletedHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&errorcode), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2FindStartCompletedHandler {} +windows_core::imp::define_interface!( + ICoreWebView2FocusChangedEventHandler, + ICoreWebView2FocusChangedEventHandler_Vtbl, + 0x05ea24bd_6452_4926_9014_4b82b498135d +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2FocusChangedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2FocusChangedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2FocusChangedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2FocusChangedEventHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2Controller>, + args: windows_core::Ref<'_, windows_core::IUnknown>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2FocusChangedEventHandler_Vtbl { + pub const fn new( + ) -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2FocusChangedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2FocusChangedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2FocusChangedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2Frame, + ICoreWebView2Frame_Vtbl, + 0xf1131a5e_9ba9_11eb_a8b3_0242ac130003 +); +windows_core::imp::interface_hierarchy!(ICoreWebView2Frame, windows_core::IUnknown); +impl ICoreWebView2Frame { + pub unsafe fn Name(&self, name: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Name)( + windows_core::Interface::as_raw(self), + name as _, + ) + .ok() + } + } + pub unsafe fn add_NameChanged( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_NameChanged)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_NameChanged(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_NameChanged)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } + pub unsafe fn AddHostObjectToScriptWithOrigins( + &self, + name: P0, + object: *mut windows::Win32::System::Variant::VARIANT, + originscount: u32, + origins: *const windows_core::PCWSTR, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).AddHostObjectToScriptWithOrigins)( + windows_core::Interface::as_raw(self), + name.param().abi(), + core::mem::transmute(object), + originscount, + origins, + ) + .ok() + } + } + pub unsafe fn RemoveHostObjectFromScript(&self, name: P0) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).RemoveHostObjectFromScript)( + windows_core::Interface::as_raw(self), + name.param().abi(), + ) + .ok() + } + } + pub unsafe fn add_Destroyed( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_Destroyed)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_Destroyed(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_Destroyed)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } + pub unsafe fn IsDestroyed( + &self, + destroyed: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).IsDestroyed)( + windows_core::Interface::as_raw(self), + destroyed as _, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Frame_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Name: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub add_NameChanged: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_NameChanged: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, + pub AddHostObjectToScriptWithOrigins: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + *mut windows::Win32::System::Variant::VARIANT, + u32, + *const windows_core::PCWSTR, + ) -> windows_core::HRESULT, + pub RemoveHostObjectFromScript: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + ) -> windows_core::HRESULT, + pub add_Destroyed: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_Destroyed: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, + pub IsDestroyed: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Frame_Impl: windows_core::IUnknownImpl { + fn Name(&self, name: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn add_NameChanged( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2FrameNameChangedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_NameChanged(&self, token: i64) -> windows_core::Result<()>; + fn AddHostObjectToScriptWithOrigins( + &self, + name: &windows_core::PCWSTR, + object: *mut windows::Win32::System::Variant::VARIANT, + originscount: u32, + origins: *const windows_core::PCWSTR, + ) -> windows_core::Result<()>; + fn RemoveHostObjectFromScript(&self, name: &windows_core::PCWSTR) -> windows_core::Result<()>; + fn add_Destroyed( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2FrameDestroyedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_Destroyed(&self, token: i64) -> windows_core::Result<()>; + fn IsDestroyed(&self, destroyed: *mut windows_core::BOOL) -> windows_core::Result<()>; +} +impl ICoreWebView2Frame_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn Name( + this: *mut core::ffi::c_void, + name: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Frame_Impl::Name(this, core::mem::transmute_copy(&name)).into() + } + } + unsafe extern "system" fn add_NameChanged< + Identity: ICoreWebView2Frame_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Frame_Impl::add_NameChanged( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_NameChanged< + Identity: ICoreWebView2Frame_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Frame_Impl::remove_NameChanged(this, core::mem::transmute_copy(&token)) + .into() + } + } + unsafe extern "system" fn AddHostObjectToScriptWithOrigins< + Identity: ICoreWebView2Frame_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + name: windows_core::PCWSTR, + object: *mut windows::Win32::System::Variant::VARIANT, + originscount: u32, + origins: *const windows_core::PCWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Frame_Impl::AddHostObjectToScriptWithOrigins( + this, + core::mem::transmute(&name), + core::mem::transmute_copy(&object), + core::mem::transmute_copy(&originscount), + core::mem::transmute_copy(&origins), + ) + .into() + } + } + unsafe extern "system" fn RemoveHostObjectFromScript< + Identity: ICoreWebView2Frame_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + name: windows_core::PCWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Frame_Impl::RemoveHostObjectFromScript( + this, + core::mem::transmute(&name), + ) + .into() + } + } + unsafe extern "system" fn add_Destroyed< + Identity: ICoreWebView2Frame_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Frame_Impl::add_Destroyed( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_Destroyed< + Identity: ICoreWebView2Frame_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Frame_Impl::remove_Destroyed(this, core::mem::transmute_copy(&token)) + .into() + } + } + unsafe extern "system" fn IsDestroyed< + Identity: ICoreWebView2Frame_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + destroyed: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Frame_Impl::IsDestroyed(this, core::mem::transmute_copy(&destroyed)) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Name: Name::, + add_NameChanged: add_NameChanged::, + remove_NameChanged: remove_NameChanged::, + AddHostObjectToScriptWithOrigins: AddHostObjectToScriptWithOrigins::, + RemoveHostObjectFromScript: RemoveHostObjectFromScript::, + add_Destroyed: add_Destroyed::, + remove_Destroyed: remove_Destroyed::, + IsDestroyed: IsDestroyed::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Frame {} +windows_core::imp::define_interface!( + ICoreWebView2Frame2, + ICoreWebView2Frame2_Vtbl, + 0x7a6a5834_d185_4dbf_b63f_4a9bc43107d4 +); +impl core::ops::Deref for ICoreWebView2Frame2 { + type Target = ICoreWebView2Frame; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2Frame2, + windows_core::IUnknown, + ICoreWebView2Frame +); +impl ICoreWebView2Frame2 { + pub unsafe fn add_NavigationStarting( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_NavigationStarting)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_NavigationStarting(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_NavigationStarting)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } + pub unsafe fn add_ContentLoading( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_ContentLoading)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_ContentLoading(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_ContentLoading)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } + pub unsafe fn add_NavigationCompleted( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_NavigationCompleted)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_NavigationCompleted(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_NavigationCompleted)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } + pub unsafe fn add_DOMContentLoaded( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_DOMContentLoaded)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_DOMContentLoaded(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_DOMContentLoaded)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } + pub unsafe fn ExecuteScript( + &self, + javascript: P0, + handler: P1, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).ExecuteScript)( + windows_core::Interface::as_raw(self), + javascript.param().abi(), + handler.param().abi(), + ) + .ok() + } + } + pub unsafe fn PostWebMessageAsJson(&self, webmessageasjson: P0) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).PostWebMessageAsJson)( + windows_core::Interface::as_raw(self), + webmessageasjson.param().abi(), + ) + .ok() + } + } + pub unsafe fn PostWebMessageAsString( + &self, + webmessageasstring: P0, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).PostWebMessageAsString)( + windows_core::Interface::as_raw(self), + webmessageasstring.param().abi(), + ) + .ok() + } + } + pub unsafe fn add_WebMessageReceived( + &self, + handler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_WebMessageReceived)( + windows_core::Interface::as_raw(self), + handler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_WebMessageReceived(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_WebMessageReceived)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Frame2_Vtbl { + pub base__: ICoreWebView2Frame_Vtbl, + pub add_NavigationStarting: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_NavigationStarting: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, + pub add_ContentLoading: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_ContentLoading: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, + pub add_NavigationCompleted: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_NavigationCompleted: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, + pub add_DOMContentLoaded: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_DOMContentLoaded: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, + pub ExecuteScript: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub PostWebMessageAsJson: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + ) -> windows_core::HRESULT, + pub PostWebMessageAsString: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + ) -> windows_core::HRESULT, + pub add_WebMessageReceived: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_WebMessageReceived: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Frame2_Impl: ICoreWebView2Frame_Impl { + fn add_NavigationStarting( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2FrameNavigationStartingEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_NavigationStarting(&self, token: i64) -> windows_core::Result<()>; + fn add_ContentLoading( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2FrameContentLoadingEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_ContentLoading(&self, token: i64) -> windows_core::Result<()>; + fn add_NavigationCompleted( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2FrameNavigationCompletedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_NavigationCompleted(&self, token: i64) -> windows_core::Result<()>; + fn add_DOMContentLoaded( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2FrameDOMContentLoadedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_DOMContentLoaded(&self, token: i64) -> windows_core::Result<()>; + fn ExecuteScript( + &self, + javascript: &windows_core::PCWSTR, + handler: windows_core::Ref<'_, ICoreWebView2ExecuteScriptCompletedHandler>, + ) -> windows_core::Result<()>; + fn PostWebMessageAsJson( + &self, + webmessageasjson: &windows_core::PCWSTR, + ) -> windows_core::Result<()>; + fn PostWebMessageAsString( + &self, + webmessageasstring: &windows_core::PCWSTR, + ) -> windows_core::Result<()>; + fn add_WebMessageReceived( + &self, + handler: windows_core::Ref<'_, ICoreWebView2FrameWebMessageReceivedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_WebMessageReceived(&self, token: i64) -> windows_core::Result<()>; +} +impl ICoreWebView2Frame2_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn add_NavigationStarting< + Identity: ICoreWebView2Frame2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Frame2_Impl::add_NavigationStarting( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_NavigationStarting< + Identity: ICoreWebView2Frame2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Frame2_Impl::remove_NavigationStarting( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn add_ContentLoading< + Identity: ICoreWebView2Frame2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Frame2_Impl::add_ContentLoading( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_ContentLoading< + Identity: ICoreWebView2Frame2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Frame2_Impl::remove_ContentLoading( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn add_NavigationCompleted< + Identity: ICoreWebView2Frame2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Frame2_Impl::add_NavigationCompleted( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_NavigationCompleted< + Identity: ICoreWebView2Frame2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Frame2_Impl::remove_NavigationCompleted( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn add_DOMContentLoaded< + Identity: ICoreWebView2Frame2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Frame2_Impl::add_DOMContentLoaded( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_DOMContentLoaded< + Identity: ICoreWebView2Frame2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Frame2_Impl::remove_DOMContentLoaded( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn ExecuteScript< + Identity: ICoreWebView2Frame2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + javascript: windows_core::PCWSTR, + handler: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Frame2_Impl::ExecuteScript( + this, + core::mem::transmute(&javascript), + core::mem::transmute_copy(&handler), + ) + .into() + } + } + unsafe extern "system" fn PostWebMessageAsJson< + Identity: ICoreWebView2Frame2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + webmessageasjson: windows_core::PCWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Frame2_Impl::PostWebMessageAsJson( + this, + core::mem::transmute(&webmessageasjson), + ) + .into() + } + } + unsafe extern "system" fn PostWebMessageAsString< + Identity: ICoreWebView2Frame2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + webmessageasstring: windows_core::PCWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Frame2_Impl::PostWebMessageAsString( + this, + core::mem::transmute(&webmessageasstring), + ) + .into() + } + } + unsafe extern "system" fn add_WebMessageReceived< + Identity: ICoreWebView2Frame2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + handler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Frame2_Impl::add_WebMessageReceived( + this, + core::mem::transmute_copy(&handler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_WebMessageReceived< + Identity: ICoreWebView2Frame2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Frame2_Impl::remove_WebMessageReceived( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + Self { + base__: ICoreWebView2Frame_Vtbl::new::(), + add_NavigationStarting: add_NavigationStarting::, + remove_NavigationStarting: remove_NavigationStarting::, + add_ContentLoading: add_ContentLoading::, + remove_ContentLoading: remove_ContentLoading::, + add_NavigationCompleted: add_NavigationCompleted::, + remove_NavigationCompleted: remove_NavigationCompleted::, + add_DOMContentLoaded: add_DOMContentLoaded::, + remove_DOMContentLoaded: remove_DOMContentLoaded::, + ExecuteScript: ExecuteScript::, + PostWebMessageAsJson: PostWebMessageAsJson::, + PostWebMessageAsString: PostWebMessageAsString::, + add_WebMessageReceived: add_WebMessageReceived::, + remove_WebMessageReceived: remove_WebMessageReceived::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Frame2 {} +windows_core::imp::define_interface!( + ICoreWebView2Frame3, + ICoreWebView2Frame3_Vtbl, + 0xb50d82cc_cc28_481d_9614_cb048895e6a0 +); +impl core::ops::Deref for ICoreWebView2Frame3 { + type Target = ICoreWebView2Frame2; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2Frame3, + windows_core::IUnknown, + ICoreWebView2Frame, + ICoreWebView2Frame2 +); +impl ICoreWebView2Frame3 { + pub unsafe fn add_PermissionRequested( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_PermissionRequested)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_PermissionRequested(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_PermissionRequested)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Frame3_Vtbl { + pub base__: ICoreWebView2Frame2_Vtbl, + pub add_PermissionRequested: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_PermissionRequested: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Frame3_Impl: ICoreWebView2Frame2_Impl { + fn add_PermissionRequested( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2FramePermissionRequestedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_PermissionRequested(&self, token: i64) -> windows_core::Result<()>; +} +impl ICoreWebView2Frame3_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn add_PermissionRequested< + Identity: ICoreWebView2Frame3_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Frame3_Impl::add_PermissionRequested( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_PermissionRequested< + Identity: ICoreWebView2Frame3_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Frame3_Impl::remove_PermissionRequested( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + Self { + base__: ICoreWebView2Frame2_Vtbl::new::(), + add_PermissionRequested: add_PermissionRequested::, + remove_PermissionRequested: remove_PermissionRequested::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Frame3 {} +windows_core::imp::define_interface!( + ICoreWebView2Frame4, + ICoreWebView2Frame4_Vtbl, + 0x188782dc_92aa_4732_ab3c_fcc59f6f68b9 +); +impl core::ops::Deref for ICoreWebView2Frame4 { + type Target = ICoreWebView2Frame3; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2Frame4, + windows_core::IUnknown, + ICoreWebView2Frame, + ICoreWebView2Frame2, + ICoreWebView2Frame3 +); +impl ICoreWebView2Frame4 { + pub unsafe fn PostSharedBufferToScript( + &self, + sharedbuffer: P0, + access: COREWEBVIEW2_SHARED_BUFFER_ACCESS, + additionaldataasjson: P2, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + P2: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).PostSharedBufferToScript)( + windows_core::Interface::as_raw(self), + sharedbuffer.param().abi(), + access, + additionaldataasjson.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Frame4_Vtbl { + pub base__: ICoreWebView2Frame3_Vtbl, + pub PostSharedBufferToScript: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + COREWEBVIEW2_SHARED_BUFFER_ACCESS, + windows_core::PCWSTR, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Frame4_Impl: ICoreWebView2Frame3_Impl { + fn PostSharedBufferToScript( + &self, + sharedbuffer: windows_core::Ref<'_, ICoreWebView2SharedBuffer>, + access: COREWEBVIEW2_SHARED_BUFFER_ACCESS, + additionaldataasjson: &windows_core::PCWSTR, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2Frame4_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn PostSharedBufferToScript< + Identity: ICoreWebView2Frame4_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sharedbuffer: *mut core::ffi::c_void, + access: COREWEBVIEW2_SHARED_BUFFER_ACCESS, + additionaldataasjson: windows_core::PCWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Frame4_Impl::PostSharedBufferToScript( + this, + core::mem::transmute_copy(&sharedbuffer), + core::mem::transmute_copy(&access), + core::mem::transmute(&additionaldataasjson), + ) + .into() + } + } + Self { + base__: ICoreWebView2Frame3_Vtbl::new::(), + PostSharedBufferToScript: PostSharedBufferToScript::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Frame4 {} +windows_core::imp::define_interface!( + ICoreWebView2Frame5, + ICoreWebView2Frame5_Vtbl, + 0x99d199c4_7305_11ee_b962_0242ac120002 +); +impl core::ops::Deref for ICoreWebView2Frame5 { + type Target = ICoreWebView2Frame4; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2Frame5, + windows_core::IUnknown, + ICoreWebView2Frame, + ICoreWebView2Frame2, + ICoreWebView2Frame3, + ICoreWebView2Frame4 +); +impl ICoreWebView2Frame5 { + pub unsafe fn FrameId(&self, value: *mut u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).FrameId)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Frame5_Vtbl { + pub base__: ICoreWebView2Frame4_Vtbl, + pub FrameId: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut u32) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Frame5_Impl: ICoreWebView2Frame4_Impl { + fn FrameId(&self, value: *mut u32) -> windows_core::Result<()>; +} +impl ICoreWebView2Frame5_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn FrameId< + Identity: ICoreWebView2Frame5_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Frame5_Impl::FrameId(this, core::mem::transmute_copy(&value)).into() + } + } + Self { + base__: ICoreWebView2Frame4_Vtbl::new::(), + FrameId: FrameId::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Frame5 {} +windows_core::imp::define_interface!( + ICoreWebView2Frame6, + ICoreWebView2Frame6_Vtbl, + 0x0de611fd_31e9_5ddc_9d71_95eda26eff32 +); +impl core::ops::Deref for ICoreWebView2Frame6 { + type Target = ICoreWebView2Frame5; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2Frame6, + windows_core::IUnknown, + ICoreWebView2Frame, + ICoreWebView2Frame2, + ICoreWebView2Frame3, + ICoreWebView2Frame4, + ICoreWebView2Frame5 +); +impl ICoreWebView2Frame6 { + pub unsafe fn add_ScreenCaptureStarting( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_ScreenCaptureStarting)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_ScreenCaptureStarting(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_ScreenCaptureStarting)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Frame6_Vtbl { + pub base__: ICoreWebView2Frame5_Vtbl, + pub add_ScreenCaptureStarting: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_ScreenCaptureStarting: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Frame6_Impl: ICoreWebView2Frame5_Impl { + fn add_ScreenCaptureStarting( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2FrameScreenCaptureStartingEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_ScreenCaptureStarting(&self, token: i64) -> windows_core::Result<()>; +} +impl ICoreWebView2Frame6_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn add_ScreenCaptureStarting< + Identity: ICoreWebView2Frame6_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Frame6_Impl::add_ScreenCaptureStarting( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_ScreenCaptureStarting< + Identity: ICoreWebView2Frame6_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Frame6_Impl::remove_ScreenCaptureStarting( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + Self { + base__: ICoreWebView2Frame5_Vtbl::new::(), + add_ScreenCaptureStarting: add_ScreenCaptureStarting::, + remove_ScreenCaptureStarting: remove_ScreenCaptureStarting::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Frame6 {} +windows_core::imp::define_interface!( + ICoreWebView2Frame7, + ICoreWebView2Frame7_Vtbl, + 0x3598cfa2_d85d_5a9f_9228_4dde1f59ec64 +); +impl core::ops::Deref for ICoreWebView2Frame7 { + type Target = ICoreWebView2Frame6; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2Frame7, + windows_core::IUnknown, + ICoreWebView2Frame, + ICoreWebView2Frame2, + ICoreWebView2Frame3, + ICoreWebView2Frame4, + ICoreWebView2Frame5, + ICoreWebView2Frame6 +); +impl ICoreWebView2Frame7 { + pub unsafe fn add_FrameCreated( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_FrameCreated)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_FrameCreated(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_FrameCreated)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Frame7_Vtbl { + pub base__: ICoreWebView2Frame6_Vtbl, + pub add_FrameCreated: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_FrameCreated: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Frame7_Impl: ICoreWebView2Frame6_Impl { + fn add_FrameCreated( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2FrameChildFrameCreatedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_FrameCreated(&self, token: i64) -> windows_core::Result<()>; +} +impl ICoreWebView2Frame7_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn add_FrameCreated< + Identity: ICoreWebView2Frame7_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Frame7_Impl::add_FrameCreated( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_FrameCreated< + Identity: ICoreWebView2Frame7_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Frame7_Impl::remove_FrameCreated( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + Self { + base__: ICoreWebView2Frame6_Vtbl::new::(), + add_FrameCreated: add_FrameCreated::, + remove_FrameCreated: remove_FrameCreated::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Frame7 {} +windows_core::imp::define_interface!( + ICoreWebView2FrameChildFrameCreatedEventHandler, + ICoreWebView2FrameChildFrameCreatedEventHandler_Vtbl, + 0x569e40e7_46b7_563d_83ae_1073155664d7 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2FrameChildFrameCreatedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2FrameChildFrameCreatedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2FrameChildFrameCreatedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2FrameChildFrameCreatedEventHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2Frame>, + args: windows_core::Ref<'_, ICoreWebView2FrameCreatedEventArgs>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2FrameChildFrameCreatedEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2FrameChildFrameCreatedEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2FrameChildFrameCreatedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2FrameChildFrameCreatedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2FrameChildFrameCreatedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2FrameContentLoadingEventHandler, + ICoreWebView2FrameContentLoadingEventHandler_Vtbl, + 0x0d6156f2_d332_49a7_9e03_7d8f2feeee54 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2FrameContentLoadingEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2FrameContentLoadingEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2FrameContentLoadingEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2FrameContentLoadingEventHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2Frame>, + args: windows_core::Ref<'_, ICoreWebView2ContentLoadingEventArgs>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2FrameContentLoadingEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2FrameContentLoadingEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2FrameContentLoadingEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2FrameContentLoadingEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2FrameContentLoadingEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2FrameCreatedEventArgs, + ICoreWebView2FrameCreatedEventArgs_Vtbl, + 0x4d6e7b5e_9baa_11eb_a8b3_0242ac130003 +); +windows_core::imp::interface_hierarchy!(ICoreWebView2FrameCreatedEventArgs, windows_core::IUnknown); +impl ICoreWebView2FrameCreatedEventArgs { + pub unsafe fn Frame(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).Frame)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2FrameCreatedEventArgs_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Frame: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2FrameCreatedEventArgs_Impl: windows_core::IUnknownImpl { + fn Frame(&self) -> windows_core::Result; +} +impl ICoreWebView2FrameCreatedEventArgs_Vtbl { + pub const fn new( + ) -> Self { + unsafe extern "system" fn Frame< + Identity: ICoreWebView2FrameCreatedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2FrameCreatedEventArgs_Impl::Frame(this) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Frame: Frame::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2FrameCreatedEventArgs {} +windows_core::imp::define_interface!( + ICoreWebView2FrameCreatedEventHandler, + ICoreWebView2FrameCreatedEventHandler_Vtbl, + 0x38059770_9baa_11eb_a8b3_0242ac130003 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2FrameCreatedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2FrameCreatedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2FrameCreatedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2FrameCreatedEventHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2>, + args: windows_core::Ref<'_, ICoreWebView2FrameCreatedEventArgs>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2FrameCreatedEventHandler_Vtbl { + pub const fn new( + ) -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2FrameCreatedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2FrameCreatedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2FrameCreatedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2FrameDOMContentLoadedEventHandler, + ICoreWebView2FrameDOMContentLoadedEventHandler_Vtbl, + 0x38d9520d_340f_4d1e_a775_43fce9753683 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2FrameDOMContentLoadedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2FrameDOMContentLoadedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2FrameDOMContentLoadedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2FrameDOMContentLoadedEventHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2Frame>, + args: windows_core::Ref<'_, ICoreWebView2DOMContentLoadedEventArgs>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2FrameDOMContentLoadedEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2FrameDOMContentLoadedEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2FrameDOMContentLoadedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2FrameDOMContentLoadedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2FrameDOMContentLoadedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2FrameDestroyedEventHandler, + ICoreWebView2FrameDestroyedEventHandler_Vtbl, + 0x59dd7b4c_9baa_11eb_a8b3_0242ac130003 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2FrameDestroyedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2FrameDestroyedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2FrameDestroyedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2FrameDestroyedEventHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2Frame>, + args: windows_core::Ref<'_, windows_core::IUnknown>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2FrameDestroyedEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2FrameDestroyedEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2FrameDestroyedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2FrameDestroyedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2FrameDestroyedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2FrameInfo, + ICoreWebView2FrameInfo_Vtbl, + 0xda86b8a1_bdf3_4f11_9955_528cefa59727 +); +windows_core::imp::interface_hierarchy!(ICoreWebView2FrameInfo, windows_core::IUnknown); +impl ICoreWebView2FrameInfo { + pub unsafe fn Name(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Name)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn Source(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Source)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2FrameInfo_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Name: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub Source: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2FrameInfo_Impl: windows_core::IUnknownImpl { + fn Name(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn Source(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; +} +impl ICoreWebView2FrameInfo_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn Name< + Identity: ICoreWebView2FrameInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2FrameInfo_Impl::Name(this, core::mem::transmute_copy(&value)).into() + } + } + unsafe extern "system" fn Source< + Identity: ICoreWebView2FrameInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2FrameInfo_Impl::Source(this, core::mem::transmute_copy(&value)).into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Name: Name::, + Source: Source::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2FrameInfo {} +windows_core::imp::define_interface!( + ICoreWebView2FrameInfo2, + ICoreWebView2FrameInfo2_Vtbl, + 0x56f85cfa_72c4_11ee_b962_0242ac120002 +); +impl core::ops::Deref for ICoreWebView2FrameInfo2 { + type Target = ICoreWebView2FrameInfo; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2FrameInfo2, + windows_core::IUnknown, + ICoreWebView2FrameInfo +); +impl ICoreWebView2FrameInfo2 { + pub unsafe fn ParentFrameInfo(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).ParentFrameInfo)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } + pub unsafe fn FrameId(&self, id: *mut u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).FrameId)( + windows_core::Interface::as_raw(self), + id as _, + ) + .ok() + } + } + pub unsafe fn FrameKind(&self, kind: *mut COREWEBVIEW2_FRAME_KIND) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).FrameKind)( + windows_core::Interface::as_raw(self), + kind as _, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2FrameInfo2_Vtbl { + pub base__: ICoreWebView2FrameInfo_Vtbl, + pub ParentFrameInfo: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub FrameId: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut u32) -> windows_core::HRESULT, + pub FrameKind: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_FRAME_KIND, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2FrameInfo2_Impl: ICoreWebView2FrameInfo_Impl { + fn ParentFrameInfo(&self) -> windows_core::Result; + fn FrameId(&self, id: *mut u32) -> windows_core::Result<()>; + fn FrameKind(&self, kind: *mut COREWEBVIEW2_FRAME_KIND) -> windows_core::Result<()>; +} +impl ICoreWebView2FrameInfo2_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn ParentFrameInfo< + Identity: ICoreWebView2FrameInfo2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + frameinfo: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2FrameInfo2_Impl::ParentFrameInfo(this) { + Ok(ok__) => { + frameinfo.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + unsafe extern "system" fn FrameId< + Identity: ICoreWebView2FrameInfo2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + id: *mut u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2FrameInfo2_Impl::FrameId(this, core::mem::transmute_copy(&id)).into() + } + } + unsafe extern "system" fn FrameKind< + Identity: ICoreWebView2FrameInfo2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + kind: *mut COREWEBVIEW2_FRAME_KIND, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2FrameInfo2_Impl::FrameKind(this, core::mem::transmute_copy(&kind)) + .into() + } + } + Self { + base__: ICoreWebView2FrameInfo_Vtbl::new::(), + ParentFrameInfo: ParentFrameInfo::, + FrameId: FrameId::, + FrameKind: FrameKind::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2FrameInfo2 {} +windows_core::imp::define_interface!( + ICoreWebView2FrameInfoCollection, + ICoreWebView2FrameInfoCollection_Vtbl, + 0x8f834154_d38e_4d90_affb_6800a7272839 +); +windows_core::imp::interface_hierarchy!(ICoreWebView2FrameInfoCollection, windows_core::IUnknown); +impl ICoreWebView2FrameInfoCollection { + pub unsafe fn GetIterator( + &self, + ) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).GetIterator)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2FrameInfoCollection_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub GetIterator: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2FrameInfoCollection_Impl: windows_core::IUnknownImpl { + fn GetIterator(&self) -> windows_core::Result; +} +impl ICoreWebView2FrameInfoCollection_Vtbl { + pub const fn new() -> Self + { + unsafe extern "system" fn GetIterator< + Identity: ICoreWebView2FrameInfoCollection_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2FrameInfoCollection_Impl::GetIterator(this) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + GetIterator: GetIterator::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2FrameInfoCollection {} +windows_core::imp::define_interface!( + ICoreWebView2FrameInfoCollectionIterator, + ICoreWebView2FrameInfoCollectionIterator_Vtbl, + 0x1bf89e2d_1b2b_4629_b28f_05099b41bb03 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2FrameInfoCollectionIterator, + windows_core::IUnknown +); +impl ICoreWebView2FrameInfoCollectionIterator { + pub unsafe fn HasCurrent(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).HasCurrent)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn GetCurrent(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).GetCurrent)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } + pub unsafe fn MoveNext(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).MoveNext)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2FrameInfoCollectionIterator_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub HasCurrent: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub GetCurrent: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub MoveNext: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2FrameInfoCollectionIterator_Impl: windows_core::IUnknownImpl { + fn HasCurrent(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn GetCurrent(&self) -> windows_core::Result; + fn MoveNext(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; +} +impl ICoreWebView2FrameInfoCollectionIterator_Vtbl { + pub const fn new< + Identity: ICoreWebView2FrameInfoCollectionIterator_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn HasCurrent< + Identity: ICoreWebView2FrameInfoCollectionIterator_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2FrameInfoCollectionIterator_Impl::HasCurrent( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn GetCurrent< + Identity: ICoreWebView2FrameInfoCollectionIterator_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2FrameInfoCollectionIterator_Impl::GetCurrent(this) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + unsafe extern "system" fn MoveNext< + Identity: ICoreWebView2FrameInfoCollectionIterator_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2FrameInfoCollectionIterator_Impl::MoveNext( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + HasCurrent: HasCurrent::, + GetCurrent: GetCurrent::, + MoveNext: MoveNext::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2FrameInfoCollectionIterator {} +windows_core::imp::define_interface!( + ICoreWebView2FrameNameChangedEventHandler, + ICoreWebView2FrameNameChangedEventHandler_Vtbl, + 0x435c7dc8_9baa_11eb_a8b3_0242ac130003 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2FrameNameChangedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2FrameNameChangedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2FrameNameChangedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2FrameNameChangedEventHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2Frame>, + args: windows_core::Ref<'_, windows_core::IUnknown>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2FrameNameChangedEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2FrameNameChangedEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2FrameNameChangedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2FrameNameChangedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2FrameNameChangedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2FrameNavigationCompletedEventHandler, + ICoreWebView2FrameNavigationCompletedEventHandler_Vtbl, + 0x609302ad_0e36_4f9a_a210_6a45272842a9 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2FrameNavigationCompletedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2FrameNavigationCompletedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2FrameNavigationCompletedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2FrameNavigationCompletedEventHandler_Impl: + windows_core::IUnknownImpl +{ + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2Frame>, + args: windows_core::Ref<'_, ICoreWebView2NavigationCompletedEventArgs>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2FrameNavigationCompletedEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2FrameNavigationCompletedEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2FrameNavigationCompletedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2FrameNavigationCompletedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2FrameNavigationCompletedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2FrameNavigationStartingEventHandler, + ICoreWebView2FrameNavigationStartingEventHandler_Vtbl, + 0xe79908bf_2d5d_4968_83db_263fea2c1da3 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2FrameNavigationStartingEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2FrameNavigationStartingEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2FrameNavigationStartingEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2FrameNavigationStartingEventHandler_Impl: + windows_core::IUnknownImpl +{ + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2Frame>, + args: windows_core::Ref<'_, ICoreWebView2NavigationStartingEventArgs>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2FrameNavigationStartingEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2FrameNavigationStartingEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2FrameNavigationStartingEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2FrameNavigationStartingEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2FrameNavigationStartingEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2FramePermissionRequestedEventHandler, + ICoreWebView2FramePermissionRequestedEventHandler_Vtbl, + 0x845d0edd_8bd8_429b_9915_4821789f23e9 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2FramePermissionRequestedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2FramePermissionRequestedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2FramePermissionRequestedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2FramePermissionRequestedEventHandler_Impl: + windows_core::IUnknownImpl +{ + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2Frame>, + args: windows_core::Ref<'_, ICoreWebView2PermissionRequestedEventArgs2>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2FramePermissionRequestedEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2FramePermissionRequestedEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2FramePermissionRequestedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2FramePermissionRequestedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2FramePermissionRequestedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2FrameScreenCaptureStartingEventHandler, + ICoreWebView2FrameScreenCaptureStartingEventHandler_Vtbl, + 0xa6c1d8ad_bb80_59c5_895b_fba1698b9309 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2FrameScreenCaptureStartingEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2FrameScreenCaptureStartingEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2FrameScreenCaptureStartingEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2FrameScreenCaptureStartingEventHandler_Impl: + windows_core::IUnknownImpl +{ + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2Frame>, + args: windows_core::Ref<'_, ICoreWebView2ScreenCaptureStartingEventArgs>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2FrameScreenCaptureStartingEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2FrameScreenCaptureStartingEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2FrameScreenCaptureStartingEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2FrameScreenCaptureStartingEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == & < ICoreWebView2FrameScreenCaptureStartingEventHandler as windows_core::Interface >::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2FrameScreenCaptureStartingEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2FrameWebMessageReceivedEventHandler, + ICoreWebView2FrameWebMessageReceivedEventHandler_Vtbl, + 0xe371e005_6d1d_4517_934b_a8f1629c62a5 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2FrameWebMessageReceivedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2FrameWebMessageReceivedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2FrameWebMessageReceivedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2FrameWebMessageReceivedEventHandler_Impl: + windows_core::IUnknownImpl +{ + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2Frame>, + args: windows_core::Ref<'_, ICoreWebView2WebMessageReceivedEventArgs>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2FrameWebMessageReceivedEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2FrameWebMessageReceivedEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2FrameWebMessageReceivedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2FrameWebMessageReceivedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2FrameWebMessageReceivedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2GetCookiesCompletedHandler, + ICoreWebView2GetCookiesCompletedHandler_Vtbl, + 0x5a4f5069_5c15_47c3_8646_f4de1c116670 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2GetCookiesCompletedHandler, + windows_core::IUnknown +); +impl ICoreWebView2GetCookiesCompletedHandler { + pub unsafe fn Invoke( + &self, + errorcode: windows_core::HRESULT, + result: P1, + ) -> windows_core::Result<()> + where + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + errorcode, + result.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2GetCookiesCompletedHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::HRESULT, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2GetCookiesCompletedHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + errorcode: windows_core::HRESULT, + result: windows_core::Ref<'_, ICoreWebView2CookieList>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2GetCookiesCompletedHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2GetCookiesCompletedHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2GetCookiesCompletedHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + errorcode: windows_core::HRESULT, + result: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2GetCookiesCompletedHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&errorcode), + core::mem::transmute_copy(&result), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2GetCookiesCompletedHandler {} +windows_core::imp::define_interface!( + ICoreWebView2GetFaviconCompletedHandler, + ICoreWebView2GetFaviconCompletedHandler_Vtbl, + 0xa2508329_7da8_49d7_8c05_fa125e4aee8d +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2GetFaviconCompletedHandler, + windows_core::IUnknown +); +impl ICoreWebView2GetFaviconCompletedHandler { + pub unsafe fn Invoke( + &self, + errorcode: windows_core::HRESULT, + result: P1, + ) -> windows_core::Result<()> + where + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + errorcode, + result.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2GetFaviconCompletedHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::HRESULT, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2GetFaviconCompletedHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + errorcode: windows_core::HRESULT, + result: windows_core::Ref<'_, windows::Win32::System::Com::IStream>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2GetFaviconCompletedHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2GetFaviconCompletedHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2GetFaviconCompletedHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + errorcode: windows_core::HRESULT, + result: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2GetFaviconCompletedHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&errorcode), + core::mem::transmute_copy(&result), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2GetFaviconCompletedHandler {} +windows_core::imp::define_interface!( + ICoreWebView2GetNonDefaultPermissionSettingsCompletedHandler, + ICoreWebView2GetNonDefaultPermissionSettingsCompletedHandler_Vtbl, + 0x38274481_a15c_4563_94cf_990edc9aeb95 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2GetNonDefaultPermissionSettingsCompletedHandler, + windows_core::IUnknown +); +impl ICoreWebView2GetNonDefaultPermissionSettingsCompletedHandler { + pub unsafe fn Invoke( + &self, + errorcode: windows_core::HRESULT, + result: P1, + ) -> windows_core::Result<()> + where + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + errorcode, + result.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2GetNonDefaultPermissionSettingsCompletedHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::HRESULT, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2GetNonDefaultPermissionSettingsCompletedHandler_Impl: + windows_core::IUnknownImpl +{ + fn Invoke( + &self, + errorcode: windows_core::HRESULT, + result: windows_core::Ref<'_, ICoreWebView2PermissionSettingCollectionView>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2GetNonDefaultPermissionSettingsCompletedHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2GetNonDefaultPermissionSettingsCompletedHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2GetNonDefaultPermissionSettingsCompletedHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + errorcode: windows_core::HRESULT, + result: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2GetNonDefaultPermissionSettingsCompletedHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&errorcode), + core::mem::transmute_copy(&result), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == & < ICoreWebView2GetNonDefaultPermissionSettingsCompletedHandler as windows_core::Interface >::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2GetNonDefaultPermissionSettingsCompletedHandler {} +windows_core::imp::define_interface!( + ICoreWebView2GetProcessExtendedInfosCompletedHandler, + ICoreWebView2GetProcessExtendedInfosCompletedHandler_Vtbl, + 0xf45e55aa_3bc2_11ee_be56_0242ac120002 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2GetProcessExtendedInfosCompletedHandler, + windows_core::IUnknown +); +impl ICoreWebView2GetProcessExtendedInfosCompletedHandler { + pub unsafe fn Invoke( + &self, + errorcode: windows_core::HRESULT, + result: P1, + ) -> windows_core::Result<()> + where + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + errorcode, + result.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2GetProcessExtendedInfosCompletedHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::HRESULT, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2GetProcessExtendedInfosCompletedHandler_Impl: + windows_core::IUnknownImpl +{ + fn Invoke( + &self, + errorcode: windows_core::HRESULT, + result: windows_core::Ref<'_, ICoreWebView2ProcessExtendedInfoCollection>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2GetProcessExtendedInfosCompletedHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2GetProcessExtendedInfosCompletedHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2GetProcessExtendedInfosCompletedHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + errorcode: windows_core::HRESULT, + result: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2GetProcessExtendedInfosCompletedHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&errorcode), + core::mem::transmute_copy(&result), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == & < ICoreWebView2GetProcessExtendedInfosCompletedHandler as windows_core::Interface >::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2GetProcessExtendedInfosCompletedHandler {} +windows_core::imp::define_interface!( + ICoreWebView2HistoryChangedEventHandler, + ICoreWebView2HistoryChangedEventHandler_Vtbl, + 0xc79a420c_efd9_4058_9295_3e8b4bcab645 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2HistoryChangedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2HistoryChangedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2HistoryChangedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2HistoryChangedEventHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2>, + args: windows_core::Ref<'_, windows_core::IUnknown>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2HistoryChangedEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2HistoryChangedEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2HistoryChangedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2HistoryChangedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2HistoryChangedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2HttpHeadersCollectionIterator, + ICoreWebView2HttpHeadersCollectionIterator_Vtbl, + 0x0702fc30_f43b_47bb_ab52_a42cb552ad9f +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2HttpHeadersCollectionIterator, + windows_core::IUnknown +); +impl ICoreWebView2HttpHeadersCollectionIterator { + pub unsafe fn GetCurrentHeader( + &self, + name: *mut windows_core::PWSTR, + value: *mut windows_core::PWSTR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).GetCurrentHeader)( + windows_core::Interface::as_raw(self), + name as _, + value as _, + ) + .ok() + } + } + pub unsafe fn HasCurrentHeader( + &self, + hascurrent: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).HasCurrentHeader)( + windows_core::Interface::as_raw(self), + hascurrent as _, + ) + .ok() + } + } + pub unsafe fn MoveNext(&self, hasnext: *mut windows_core::BOOL) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).MoveNext)( + windows_core::Interface::as_raw(self), + hasnext as _, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2HttpHeadersCollectionIterator_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub GetCurrentHeader: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub HasCurrentHeader: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub MoveNext: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2HttpHeadersCollectionIterator_Impl: windows_core::IUnknownImpl { + fn GetCurrentHeader( + &self, + name: *mut windows_core::PWSTR, + value: *mut windows_core::PWSTR, + ) -> windows_core::Result<()>; + fn HasCurrentHeader(&self, hascurrent: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn MoveNext(&self, hasnext: *mut windows_core::BOOL) -> windows_core::Result<()>; +} +impl ICoreWebView2HttpHeadersCollectionIterator_Vtbl { + pub const fn new< + Identity: ICoreWebView2HttpHeadersCollectionIterator_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn GetCurrentHeader< + Identity: ICoreWebView2HttpHeadersCollectionIterator_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + name: *mut windows_core::PWSTR, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2HttpHeadersCollectionIterator_Impl::GetCurrentHeader( + this, + core::mem::transmute_copy(&name), + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn HasCurrentHeader< + Identity: ICoreWebView2HttpHeadersCollectionIterator_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + hascurrent: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2HttpHeadersCollectionIterator_Impl::HasCurrentHeader( + this, + core::mem::transmute_copy(&hascurrent), + ) + .into() + } + } + unsafe extern "system" fn MoveNext< + Identity: ICoreWebView2HttpHeadersCollectionIterator_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + hasnext: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2HttpHeadersCollectionIterator_Impl::MoveNext( + this, + core::mem::transmute_copy(&hasnext), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + GetCurrentHeader: GetCurrentHeader::, + HasCurrentHeader: HasCurrentHeader::, + MoveNext: MoveNext::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2HttpHeadersCollectionIterator {} +windows_core::imp::define_interface!( + ICoreWebView2HttpRequestHeaders, + ICoreWebView2HttpRequestHeaders_Vtbl, + 0xe86cac0e_5523_465c_b536_8fb9fc8c8c60 +); +windows_core::imp::interface_hierarchy!(ICoreWebView2HttpRequestHeaders, windows_core::IUnknown); +impl ICoreWebView2HttpRequestHeaders { + pub unsafe fn GetHeader( + &self, + name: P0, + value: *mut windows_core::PWSTR, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).GetHeader)( + windows_core::Interface::as_raw(self), + name.param().abi(), + value as _, + ) + .ok() + } + } + pub unsafe fn GetHeaders( + &self, + name: P0, + ) -> windows_core::Result + where + P0: windows_core::Param, + { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).GetHeaders)( + windows_core::Interface::as_raw(self), + name.param().abi(), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } + pub unsafe fn Contains( + &self, + name: P0, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Contains)( + windows_core::Interface::as_raw(self), + name.param().abi(), + value as _, + ) + .ok() + } + } + pub unsafe fn SetHeader(&self, name: P0, value: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).SetHeader)( + windows_core::Interface::as_raw(self), + name.param().abi(), + value.param().abi(), + ) + .ok() + } + } + pub unsafe fn RemoveHeader(&self, name: P0) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).RemoveHeader)( + windows_core::Interface::as_raw(self), + name.param().abi(), + ) + .ok() + } + } + pub unsafe fn GetIterator( + &self, + ) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).GetIterator)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2HttpRequestHeaders_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub GetHeader: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub GetHeaders: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub Contains: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetHeader: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + windows_core::PCWSTR, + ) -> windows_core::HRESULT, + pub RemoveHeader: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + ) -> windows_core::HRESULT, + pub GetIterator: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2HttpRequestHeaders_Impl: windows_core::IUnknownImpl { + fn GetHeader( + &self, + name: &windows_core::PCWSTR, + value: *mut windows_core::PWSTR, + ) -> windows_core::Result<()>; + fn GetHeaders( + &self, + name: &windows_core::PCWSTR, + ) -> windows_core::Result; + fn Contains( + &self, + name: &windows_core::PCWSTR, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()>; + fn SetHeader( + &self, + name: &windows_core::PCWSTR, + value: &windows_core::PCWSTR, + ) -> windows_core::Result<()>; + fn RemoveHeader(&self, name: &windows_core::PCWSTR) -> windows_core::Result<()>; + fn GetIterator(&self) -> windows_core::Result; +} +impl ICoreWebView2HttpRequestHeaders_Vtbl { + pub const fn new() -> Self + { + unsafe extern "system" fn GetHeader< + Identity: ICoreWebView2HttpRequestHeaders_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + name: windows_core::PCWSTR, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2HttpRequestHeaders_Impl::GetHeader( + this, + core::mem::transmute(&name), + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn GetHeaders< + Identity: ICoreWebView2HttpRequestHeaders_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + name: windows_core::PCWSTR, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2HttpRequestHeaders_Impl::GetHeaders( + this, + core::mem::transmute(&name), + ) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + unsafe extern "system" fn Contains< + Identity: ICoreWebView2HttpRequestHeaders_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + name: windows_core::PCWSTR, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2HttpRequestHeaders_Impl::Contains( + this, + core::mem::transmute(&name), + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetHeader< + Identity: ICoreWebView2HttpRequestHeaders_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + name: windows_core::PCWSTR, + value: windows_core::PCWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2HttpRequestHeaders_Impl::SetHeader( + this, + core::mem::transmute(&name), + core::mem::transmute(&value), + ) + .into() + } + } + unsafe extern "system" fn RemoveHeader< + Identity: ICoreWebView2HttpRequestHeaders_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + name: windows_core::PCWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2HttpRequestHeaders_Impl::RemoveHeader( + this, + core::mem::transmute(&name), + ) + .into() + } + } + unsafe extern "system" fn GetIterator< + Identity: ICoreWebView2HttpRequestHeaders_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2HttpRequestHeaders_Impl::GetIterator(this) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + GetHeader: GetHeader::, + GetHeaders: GetHeaders::, + Contains: Contains::, + SetHeader: SetHeader::, + RemoveHeader: RemoveHeader::, + GetIterator: GetIterator::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2HttpRequestHeaders {} +windows_core::imp::define_interface!( + ICoreWebView2HttpResponseHeaders, + ICoreWebView2HttpResponseHeaders_Vtbl, + 0x03c5ff5a_9b45_4a88_881c_89a9f328619c +); +windows_core::imp::interface_hierarchy!(ICoreWebView2HttpResponseHeaders, windows_core::IUnknown); +impl ICoreWebView2HttpResponseHeaders { + pub unsafe fn AppendHeader(&self, name: P0, value: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).AppendHeader)( + windows_core::Interface::as_raw(self), + name.param().abi(), + value.param().abi(), + ) + .ok() + } + } + pub unsafe fn Contains( + &self, + name: P0, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Contains)( + windows_core::Interface::as_raw(self), + name.param().abi(), + value as _, + ) + .ok() + } + } + pub unsafe fn GetHeader( + &self, + name: P0, + value: *mut windows_core::PWSTR, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).GetHeader)( + windows_core::Interface::as_raw(self), + name.param().abi(), + value as _, + ) + .ok() + } + } + pub unsafe fn GetHeaders( + &self, + name: P0, + ) -> windows_core::Result + where + P0: windows_core::Param, + { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).GetHeaders)( + windows_core::Interface::as_raw(self), + name.param().abi(), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } + pub unsafe fn GetIterator( + &self, + ) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).GetIterator)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2HttpResponseHeaders_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub AppendHeader: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + windows_core::PCWSTR, + ) -> windows_core::HRESULT, + pub Contains: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub GetHeader: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub GetHeaders: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub GetIterator: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2HttpResponseHeaders_Impl: windows_core::IUnknownImpl { + fn AppendHeader( + &self, + name: &windows_core::PCWSTR, + value: &windows_core::PCWSTR, + ) -> windows_core::Result<()>; + fn Contains( + &self, + name: &windows_core::PCWSTR, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()>; + fn GetHeader( + &self, + name: &windows_core::PCWSTR, + value: *mut windows_core::PWSTR, + ) -> windows_core::Result<()>; + fn GetHeaders( + &self, + name: &windows_core::PCWSTR, + ) -> windows_core::Result; + fn GetIterator(&self) -> windows_core::Result; +} +impl ICoreWebView2HttpResponseHeaders_Vtbl { + pub const fn new() -> Self + { + unsafe extern "system" fn AppendHeader< + Identity: ICoreWebView2HttpResponseHeaders_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + name: windows_core::PCWSTR, + value: windows_core::PCWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2HttpResponseHeaders_Impl::AppendHeader( + this, + core::mem::transmute(&name), + core::mem::transmute(&value), + ) + .into() + } + } + unsafe extern "system" fn Contains< + Identity: ICoreWebView2HttpResponseHeaders_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + name: windows_core::PCWSTR, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2HttpResponseHeaders_Impl::Contains( + this, + core::mem::transmute(&name), + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn GetHeader< + Identity: ICoreWebView2HttpResponseHeaders_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + name: windows_core::PCWSTR, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2HttpResponseHeaders_Impl::GetHeader( + this, + core::mem::transmute(&name), + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn GetHeaders< + Identity: ICoreWebView2HttpResponseHeaders_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + name: windows_core::PCWSTR, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2HttpResponseHeaders_Impl::GetHeaders( + this, + core::mem::transmute(&name), + ) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + unsafe extern "system" fn GetIterator< + Identity: ICoreWebView2HttpResponseHeaders_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2HttpResponseHeaders_Impl::GetIterator(this) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + AppendHeader: AppendHeader::, + Contains: Contains::, + GetHeader: GetHeader::, + GetHeaders: GetHeaders::, + GetIterator: GetIterator::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2HttpResponseHeaders {} +windows_core::imp::define_interface!( + ICoreWebView2IsDefaultDownloadDialogOpenChangedEventHandler, + ICoreWebView2IsDefaultDownloadDialogOpenChangedEventHandler_Vtbl, + 0x3117da26_ae13_438d_bd46_edbeb2c4ce81 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2IsDefaultDownloadDialogOpenChangedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2IsDefaultDownloadDialogOpenChangedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2IsDefaultDownloadDialogOpenChangedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2IsDefaultDownloadDialogOpenChangedEventHandler_Impl: + windows_core::IUnknownImpl +{ + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2>, + args: windows_core::Ref<'_, windows_core::IUnknown>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2IsDefaultDownloadDialogOpenChangedEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2IsDefaultDownloadDialogOpenChangedEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2IsDefaultDownloadDialogOpenChangedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2IsDefaultDownloadDialogOpenChangedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == & < ICoreWebView2IsDefaultDownloadDialogOpenChangedEventHandler as windows_core::Interface >::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2IsDefaultDownloadDialogOpenChangedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2IsDocumentPlayingAudioChangedEventHandler, + ICoreWebView2IsDocumentPlayingAudioChangedEventHandler_Vtbl, + 0x5def109a_2f4b_49fa_b7f6_11c39e513328 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2IsDocumentPlayingAudioChangedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2IsDocumentPlayingAudioChangedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2IsDocumentPlayingAudioChangedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2IsDocumentPlayingAudioChangedEventHandler_Impl: + windows_core::IUnknownImpl +{ + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2>, + args: windows_core::Ref<'_, windows_core::IUnknown>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2IsDocumentPlayingAudioChangedEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2IsDocumentPlayingAudioChangedEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2IsDocumentPlayingAudioChangedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2IsDocumentPlayingAudioChangedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == & < ICoreWebView2IsDocumentPlayingAudioChangedEventHandler as windows_core::Interface >::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2IsDocumentPlayingAudioChangedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2IsMutedChangedEventHandler, + ICoreWebView2IsMutedChangedEventHandler_Vtbl, + 0x57d90347_cd0e_4952_a4a2_7483a2756f08 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2IsMutedChangedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2IsMutedChangedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2IsMutedChangedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2IsMutedChangedEventHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2>, + args: windows_core::Ref<'_, windows_core::IUnknown>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2IsMutedChangedEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2IsMutedChangedEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2IsMutedChangedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2IsMutedChangedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2IsMutedChangedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2LaunchingExternalUriSchemeEventArgs, + ICoreWebView2LaunchingExternalUriSchemeEventArgs_Vtbl, + 0x07d1a6c3_7175_4ba1_9306_e593ca07e46c +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2LaunchingExternalUriSchemeEventArgs, + windows_core::IUnknown +); +impl ICoreWebView2LaunchingExternalUriSchemeEventArgs { + pub unsafe fn Uri(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Uri)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn InitiatingOrigin( + &self, + value: *mut windows_core::PWSTR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).InitiatingOrigin)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn IsUserInitiated( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).IsUserInitiated)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn Cancel(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Cancel)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetCancel(&self, value: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetCancel)( + windows_core::Interface::as_raw(self), + value.into(), + ) + .ok() + } + } + pub unsafe fn GetDeferral(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).GetDeferral)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2LaunchingExternalUriSchemeEventArgs_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Uri: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub InitiatingOrigin: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub IsUserInitiated: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub Cancel: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetCancel: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, + pub GetDeferral: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2LaunchingExternalUriSchemeEventArgs_Impl: + windows_core::IUnknownImpl +{ + fn Uri(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn InitiatingOrigin(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn IsUserInitiated(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn Cancel(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn SetCancel(&self, value: windows_core::BOOL) -> windows_core::Result<()>; + fn GetDeferral(&self) -> windows_core::Result; +} +impl ICoreWebView2LaunchingExternalUriSchemeEventArgs_Vtbl { + pub const fn new< + Identity: ICoreWebView2LaunchingExternalUriSchemeEventArgs_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Uri< + Identity: ICoreWebView2LaunchingExternalUriSchemeEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2LaunchingExternalUriSchemeEventArgs_Impl::Uri( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn InitiatingOrigin< + Identity: ICoreWebView2LaunchingExternalUriSchemeEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2LaunchingExternalUriSchemeEventArgs_Impl::InitiatingOrigin( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn IsUserInitiated< + Identity: ICoreWebView2LaunchingExternalUriSchemeEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2LaunchingExternalUriSchemeEventArgs_Impl::IsUserInitiated( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn Cancel< + Identity: ICoreWebView2LaunchingExternalUriSchemeEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2LaunchingExternalUriSchemeEventArgs_Impl::Cancel( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetCancel< + Identity: ICoreWebView2LaunchingExternalUriSchemeEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2LaunchingExternalUriSchemeEventArgs_Impl::SetCancel( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn GetDeferral< + Identity: ICoreWebView2LaunchingExternalUriSchemeEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2LaunchingExternalUriSchemeEventArgs_Impl::GetDeferral(this) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Uri: Uri::, + InitiatingOrigin: InitiatingOrigin::, + IsUserInitiated: IsUserInitiated::, + Cancel: Cancel::, + SetCancel: SetCancel::, + GetDeferral: GetDeferral::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2LaunchingExternalUriSchemeEventArgs {} +windows_core::imp::define_interface!( + ICoreWebView2LaunchingExternalUriSchemeEventHandler, + ICoreWebView2LaunchingExternalUriSchemeEventHandler_Vtbl, + 0x74f712e0_8165_43a9_a13f_0cce597e75df +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2LaunchingExternalUriSchemeEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2LaunchingExternalUriSchemeEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2LaunchingExternalUriSchemeEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2LaunchingExternalUriSchemeEventHandler_Impl: + windows_core::IUnknownImpl +{ + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2>, + args: windows_core::Ref<'_, ICoreWebView2LaunchingExternalUriSchemeEventArgs>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2LaunchingExternalUriSchemeEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2LaunchingExternalUriSchemeEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2LaunchingExternalUriSchemeEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2LaunchingExternalUriSchemeEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == & < ICoreWebView2LaunchingExternalUriSchemeEventHandler as windows_core::Interface >::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2LaunchingExternalUriSchemeEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2MoveFocusRequestedEventArgs, + ICoreWebView2MoveFocusRequestedEventArgs_Vtbl, + 0x2d6aa13b_3839_4a15_92fc_d88b3c0d9c9d +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2MoveFocusRequestedEventArgs, + windows_core::IUnknown +); +impl ICoreWebView2MoveFocusRequestedEventArgs { + pub unsafe fn Reason( + &self, + reason: *mut COREWEBVIEW2_MOVE_FOCUS_REASON, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Reason)( + windows_core::Interface::as_raw(self), + reason as _, + ) + .ok() + } + } + pub unsafe fn Handled(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Handled)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetHandled(&self, value: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetHandled)( + windows_core::Interface::as_raw(self), + value.into(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2MoveFocusRequestedEventArgs_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Reason: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_MOVE_FOCUS_REASON, + ) -> windows_core::HRESULT, + pub Handled: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetHandled: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2MoveFocusRequestedEventArgs_Impl: windows_core::IUnknownImpl { + fn Reason(&self, reason: *mut COREWEBVIEW2_MOVE_FOCUS_REASON) -> windows_core::Result<()>; + fn Handled(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn SetHandled(&self, value: windows_core::BOOL) -> windows_core::Result<()>; +} +impl ICoreWebView2MoveFocusRequestedEventArgs_Vtbl { + pub const fn new< + Identity: ICoreWebView2MoveFocusRequestedEventArgs_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Reason< + Identity: ICoreWebView2MoveFocusRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + reason: *mut COREWEBVIEW2_MOVE_FOCUS_REASON, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2MoveFocusRequestedEventArgs_Impl::Reason( + this, + core::mem::transmute_copy(&reason), + ) + .into() + } + } + unsafe extern "system" fn Handled< + Identity: ICoreWebView2MoveFocusRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2MoveFocusRequestedEventArgs_Impl::Handled( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetHandled< + Identity: ICoreWebView2MoveFocusRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2MoveFocusRequestedEventArgs_Impl::SetHandled( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Reason: Reason::, + Handled: Handled::, + SetHandled: SetHandled::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2MoveFocusRequestedEventArgs {} +windows_core::imp::define_interface!( + ICoreWebView2MoveFocusRequestedEventHandler, + ICoreWebView2MoveFocusRequestedEventHandler_Vtbl, + 0x69035451_6dc7_4cb8_9bce_b2bd70ad289f +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2MoveFocusRequestedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2MoveFocusRequestedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2MoveFocusRequestedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2MoveFocusRequestedEventHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2Controller>, + args: windows_core::Ref<'_, ICoreWebView2MoveFocusRequestedEventArgs>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2MoveFocusRequestedEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2MoveFocusRequestedEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2MoveFocusRequestedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2MoveFocusRequestedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2MoveFocusRequestedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2NavigationCompletedEventArgs, + ICoreWebView2NavigationCompletedEventArgs_Vtbl, + 0x30d68b7d_20d9_4752_a9ca_ec8448fbb5c1 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2NavigationCompletedEventArgs, + windows_core::IUnknown +); +impl ICoreWebView2NavigationCompletedEventArgs { + pub unsafe fn IsSuccess(&self, issuccess: *mut windows_core::BOOL) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).IsSuccess)( + windows_core::Interface::as_raw(self), + issuccess as _, + ) + .ok() + } + } + pub unsafe fn WebErrorStatus( + &self, + weberrorstatus: *mut COREWEBVIEW2_WEB_ERROR_STATUS, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).WebErrorStatus)( + windows_core::Interface::as_raw(self), + weberrorstatus as _, + ) + .ok() + } + } + pub unsafe fn NavigationId(&self, navigationid: *mut u64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).NavigationId)( + windows_core::Interface::as_raw(self), + navigationid as _, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2NavigationCompletedEventArgs_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub IsSuccess: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub WebErrorStatus: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_WEB_ERROR_STATUS, + ) -> windows_core::HRESULT, + pub NavigationId: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut u64) -> windows_core::HRESULT, +} +pub trait ICoreWebView2NavigationCompletedEventArgs_Impl: windows_core::IUnknownImpl { + fn IsSuccess(&self, issuccess: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn WebErrorStatus( + &self, + weberrorstatus: *mut COREWEBVIEW2_WEB_ERROR_STATUS, + ) -> windows_core::Result<()>; + fn NavigationId(&self, navigationid: *mut u64) -> windows_core::Result<()>; +} +impl ICoreWebView2NavigationCompletedEventArgs_Vtbl { + pub const fn new< + Identity: ICoreWebView2NavigationCompletedEventArgs_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn IsSuccess< + Identity: ICoreWebView2NavigationCompletedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + issuccess: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2NavigationCompletedEventArgs_Impl::IsSuccess( + this, + core::mem::transmute_copy(&issuccess), + ) + .into() + } + } + unsafe extern "system" fn WebErrorStatus< + Identity: ICoreWebView2NavigationCompletedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + weberrorstatus: *mut COREWEBVIEW2_WEB_ERROR_STATUS, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2NavigationCompletedEventArgs_Impl::WebErrorStatus( + this, + core::mem::transmute_copy(&weberrorstatus), + ) + .into() + } + } + unsafe extern "system" fn NavigationId< + Identity: ICoreWebView2NavigationCompletedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + navigationid: *mut u64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2NavigationCompletedEventArgs_Impl::NavigationId( + this, + core::mem::transmute_copy(&navigationid), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + IsSuccess: IsSuccess::, + WebErrorStatus: WebErrorStatus::, + NavigationId: NavigationId::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2NavigationCompletedEventArgs {} +windows_core::imp::define_interface!( + ICoreWebView2NavigationCompletedEventArgs2, + ICoreWebView2NavigationCompletedEventArgs2_Vtbl, + 0xfdf8b738_ee1e_4db2_a329_8d7d7b74d792 +); +impl core::ops::Deref for ICoreWebView2NavigationCompletedEventArgs2 { + type Target = ICoreWebView2NavigationCompletedEventArgs; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2NavigationCompletedEventArgs2, + windows_core::IUnknown, + ICoreWebView2NavigationCompletedEventArgs +); +impl ICoreWebView2NavigationCompletedEventArgs2 { + pub unsafe fn HttpStatusCode(&self, value: *mut i32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).HttpStatusCode)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2NavigationCompletedEventArgs2_Vtbl { + pub base__: ICoreWebView2NavigationCompletedEventArgs_Vtbl, + pub HttpStatusCode: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut i32) -> windows_core::HRESULT, +} +pub trait ICoreWebView2NavigationCompletedEventArgs2_Impl: + ICoreWebView2NavigationCompletedEventArgs_Impl +{ + fn HttpStatusCode(&self, value: *mut i32) -> windows_core::Result<()>; +} +impl ICoreWebView2NavigationCompletedEventArgs2_Vtbl { + pub const fn new< + Identity: ICoreWebView2NavigationCompletedEventArgs2_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn HttpStatusCode< + Identity: ICoreWebView2NavigationCompletedEventArgs2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut i32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2NavigationCompletedEventArgs2_Impl::HttpStatusCode( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: ICoreWebView2NavigationCompletedEventArgs_Vtbl::new::(), + HttpStatusCode: HttpStatusCode::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2NavigationCompletedEventArgs2 {} +windows_core::imp::define_interface!( + ICoreWebView2NavigationCompletedEventHandler, + ICoreWebView2NavigationCompletedEventHandler_Vtbl, + 0xd33a35bf_1c49_4f98_93ab_006e0533fe1c +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2NavigationCompletedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2NavigationCompletedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2NavigationCompletedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2NavigationCompletedEventHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2>, + args: windows_core::Ref<'_, ICoreWebView2NavigationCompletedEventArgs>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2NavigationCompletedEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2NavigationCompletedEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2NavigationCompletedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2NavigationCompletedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2NavigationCompletedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2NavigationStartingEventArgs, + ICoreWebView2NavigationStartingEventArgs_Vtbl, + 0x5b495469_e119_438a_9b18_7604f25f2e49 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2NavigationStartingEventArgs, + windows_core::IUnknown +); +impl ICoreWebView2NavigationStartingEventArgs { + pub unsafe fn Uri(&self, uri: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Uri)( + windows_core::Interface::as_raw(self), + uri as _, + ) + .ok() + } + } + pub unsafe fn IsUserInitiated( + &self, + isuserinitiated: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).IsUserInitiated)( + windows_core::Interface::as_raw(self), + isuserinitiated as _, + ) + .ok() + } + } + pub unsafe fn IsRedirected( + &self, + isredirected: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).IsRedirected)( + windows_core::Interface::as_raw(self), + isredirected as _, + ) + .ok() + } + } + pub unsafe fn RequestHeaders(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).RequestHeaders)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } + pub unsafe fn Cancel(&self, cancel: *mut windows_core::BOOL) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Cancel)( + windows_core::Interface::as_raw(self), + cancel as _, + ) + .ok() + } + } + pub unsafe fn SetCancel(&self, cancel: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetCancel)( + windows_core::Interface::as_raw(self), + cancel.into(), + ) + .ok() + } + } + pub unsafe fn NavigationId(&self, navigationid: *mut u64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).NavigationId)( + windows_core::Interface::as_raw(self), + navigationid as _, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2NavigationStartingEventArgs_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Uri: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub IsUserInitiated: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub IsRedirected: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub RequestHeaders: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub Cancel: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetCancel: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, + pub NavigationId: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut u64) -> windows_core::HRESULT, +} +pub trait ICoreWebView2NavigationStartingEventArgs_Impl: windows_core::IUnknownImpl { + fn Uri(&self, uri: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn IsUserInitiated(&self, isuserinitiated: *mut windows_core::BOOL) + -> windows_core::Result<()>; + fn IsRedirected(&self, isredirected: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn RequestHeaders(&self) -> windows_core::Result; + fn Cancel(&self, cancel: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn SetCancel(&self, cancel: windows_core::BOOL) -> windows_core::Result<()>; + fn NavigationId(&self, navigationid: *mut u64) -> windows_core::Result<()>; +} +impl ICoreWebView2NavigationStartingEventArgs_Vtbl { + pub const fn new< + Identity: ICoreWebView2NavigationStartingEventArgs_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Uri< + Identity: ICoreWebView2NavigationStartingEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + uri: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2NavigationStartingEventArgs_Impl::Uri( + this, + core::mem::transmute_copy(&uri), + ) + .into() + } + } + unsafe extern "system" fn IsUserInitiated< + Identity: ICoreWebView2NavigationStartingEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + isuserinitiated: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2NavigationStartingEventArgs_Impl::IsUserInitiated( + this, + core::mem::transmute_copy(&isuserinitiated), + ) + .into() + } + } + unsafe extern "system" fn IsRedirected< + Identity: ICoreWebView2NavigationStartingEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + isredirected: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2NavigationStartingEventArgs_Impl::IsRedirected( + this, + core::mem::transmute_copy(&isredirected), + ) + .into() + } + } + unsafe extern "system" fn RequestHeaders< + Identity: ICoreWebView2NavigationStartingEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + requestheaders: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2NavigationStartingEventArgs_Impl::RequestHeaders(this) { + Ok(ok__) => { + requestheaders.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + unsafe extern "system" fn Cancel< + Identity: ICoreWebView2NavigationStartingEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + cancel: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2NavigationStartingEventArgs_Impl::Cancel( + this, + core::mem::transmute_copy(&cancel), + ) + .into() + } + } + unsafe extern "system" fn SetCancel< + Identity: ICoreWebView2NavigationStartingEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + cancel: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2NavigationStartingEventArgs_Impl::SetCancel( + this, + core::mem::transmute_copy(&cancel), + ) + .into() + } + } + unsafe extern "system" fn NavigationId< + Identity: ICoreWebView2NavigationStartingEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + navigationid: *mut u64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2NavigationStartingEventArgs_Impl::NavigationId( + this, + core::mem::transmute_copy(&navigationid), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Uri: Uri::, + IsUserInitiated: IsUserInitiated::, + IsRedirected: IsRedirected::, + RequestHeaders: RequestHeaders::, + Cancel: Cancel::, + SetCancel: SetCancel::, + NavigationId: NavigationId::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2NavigationStartingEventArgs {} +windows_core::imp::define_interface!( + ICoreWebView2NavigationStartingEventArgs2, + ICoreWebView2NavigationStartingEventArgs2_Vtbl, + 0x9086be93_91aa_472d_a7e0_579f2ba006ad +); +impl core::ops::Deref for ICoreWebView2NavigationStartingEventArgs2 { + type Target = ICoreWebView2NavigationStartingEventArgs; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2NavigationStartingEventArgs2, + windows_core::IUnknown, + ICoreWebView2NavigationStartingEventArgs +); +impl ICoreWebView2NavigationStartingEventArgs2 { + pub unsafe fn AdditionalAllowedFrameAncestors( + &self, + value: *mut windows_core::PWSTR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).AdditionalAllowedFrameAncestors)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetAdditionalAllowedFrameAncestors( + &self, + value: P0, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).SetAdditionalAllowedFrameAncestors)( + windows_core::Interface::as_raw(self), + value.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2NavigationStartingEventArgs2_Vtbl { + pub base__: ICoreWebView2NavigationStartingEventArgs_Vtbl, + pub AdditionalAllowedFrameAncestors: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub SetAdditionalAllowedFrameAncestors: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2NavigationStartingEventArgs2_Impl: + ICoreWebView2NavigationStartingEventArgs_Impl +{ + fn AdditionalAllowedFrameAncestors( + &self, + value: *mut windows_core::PWSTR, + ) -> windows_core::Result<()>; + fn SetAdditionalAllowedFrameAncestors( + &self, + value: &windows_core::PCWSTR, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2NavigationStartingEventArgs2_Vtbl { + pub const fn new< + Identity: ICoreWebView2NavigationStartingEventArgs2_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn AdditionalAllowedFrameAncestors< + Identity: ICoreWebView2NavigationStartingEventArgs2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2NavigationStartingEventArgs2_Impl::AdditionalAllowedFrameAncestors( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetAdditionalAllowedFrameAncestors< + Identity: ICoreWebView2NavigationStartingEventArgs2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::PCWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2NavigationStartingEventArgs2_Impl::SetAdditionalAllowedFrameAncestors( + this, + core::mem::transmute(&value), + ) + .into() + } + } + Self { + base__: ICoreWebView2NavigationStartingEventArgs_Vtbl::new::(), + AdditionalAllowedFrameAncestors: AdditionalAllowedFrameAncestors::, + SetAdditionalAllowedFrameAncestors: SetAdditionalAllowedFrameAncestors::< + Identity, + OFFSET, + >, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2NavigationStartingEventArgs2 {} +windows_core::imp::define_interface!( + ICoreWebView2NavigationStartingEventArgs3, + ICoreWebView2NavigationStartingEventArgs3_Vtbl, + 0xddffe494_4942_4bd2_ab73_35b8ff40e19f +); +impl core::ops::Deref for ICoreWebView2NavigationStartingEventArgs3 { + type Target = ICoreWebView2NavigationStartingEventArgs2; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2NavigationStartingEventArgs3, + windows_core::IUnknown, + ICoreWebView2NavigationStartingEventArgs, + ICoreWebView2NavigationStartingEventArgs2 +); +impl ICoreWebView2NavigationStartingEventArgs3 { + pub unsafe fn NavigationKind( + &self, + value: *mut COREWEBVIEW2_NAVIGATION_KIND, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).NavigationKind)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2NavigationStartingEventArgs3_Vtbl { + pub base__: ICoreWebView2NavigationStartingEventArgs2_Vtbl, + pub NavigationKind: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_NAVIGATION_KIND, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2NavigationStartingEventArgs3_Impl: + ICoreWebView2NavigationStartingEventArgs2_Impl +{ + fn NavigationKind(&self, value: *mut COREWEBVIEW2_NAVIGATION_KIND) -> windows_core::Result<()>; +} +impl ICoreWebView2NavigationStartingEventArgs3_Vtbl { + pub const fn new< + Identity: ICoreWebView2NavigationStartingEventArgs3_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn NavigationKind< + Identity: ICoreWebView2NavigationStartingEventArgs3_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut COREWEBVIEW2_NAVIGATION_KIND, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2NavigationStartingEventArgs3_Impl::NavigationKind( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: ICoreWebView2NavigationStartingEventArgs2_Vtbl::new::(), + NavigationKind: NavigationKind::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2NavigationStartingEventArgs3 {} +windows_core::imp::define_interface!( + ICoreWebView2NavigationStartingEventHandler, + ICoreWebView2NavigationStartingEventHandler_Vtbl, + 0x9adbe429_f36d_432b_9ddc_f8881fbd76e3 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2NavigationStartingEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2NavigationStartingEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2NavigationStartingEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2NavigationStartingEventHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2>, + args: windows_core::Ref<'_, ICoreWebView2NavigationStartingEventArgs>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2NavigationStartingEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2NavigationStartingEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2NavigationStartingEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2NavigationStartingEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2NavigationStartingEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2NewBrowserVersionAvailableEventHandler, + ICoreWebView2NewBrowserVersionAvailableEventHandler_Vtbl, + 0xf9a2976e_d34e_44fc_adee_81b6b57ca914 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2NewBrowserVersionAvailableEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2NewBrowserVersionAvailableEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2NewBrowserVersionAvailableEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2NewBrowserVersionAvailableEventHandler_Impl: + windows_core::IUnknownImpl +{ + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2Environment>, + args: windows_core::Ref<'_, windows_core::IUnknown>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2NewBrowserVersionAvailableEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2NewBrowserVersionAvailableEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2NewBrowserVersionAvailableEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2NewBrowserVersionAvailableEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == & < ICoreWebView2NewBrowserVersionAvailableEventHandler as windows_core::Interface >::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2NewBrowserVersionAvailableEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2NewWindowRequestedEventArgs, + ICoreWebView2NewWindowRequestedEventArgs_Vtbl, + 0x34acb11c_fc37_4418_9132_f9c21d1eafb9 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2NewWindowRequestedEventArgs, + windows_core::IUnknown +); +impl ICoreWebView2NewWindowRequestedEventArgs { + pub unsafe fn Uri(&self, uri: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Uri)( + windows_core::Interface::as_raw(self), + uri as _, + ) + .ok() + } + } + pub unsafe fn SetNewWindow(&self, newwindow: P0) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).SetNewWindow)( + windows_core::Interface::as_raw(self), + newwindow.param().abi(), + ) + .ok() + } + } + pub unsafe fn NewWindow(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).NewWindow)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } + pub unsafe fn SetHandled(&self, handled: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetHandled)( + windows_core::Interface::as_raw(self), + handled.into(), + ) + .ok() + } + } + pub unsafe fn Handled(&self, handled: *mut windows_core::BOOL) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Handled)( + windows_core::Interface::as_raw(self), + handled as _, + ) + .ok() + } + } + pub unsafe fn IsUserInitiated( + &self, + isuserinitiated: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).IsUserInitiated)( + windows_core::Interface::as_raw(self), + isuserinitiated as _, + ) + .ok() + } + } + pub unsafe fn GetDeferral(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).GetDeferral)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } + pub unsafe fn WindowFeatures(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).WindowFeatures)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2NewWindowRequestedEventArgs_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Uri: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub SetNewWindow: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub NewWindow: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub SetHandled: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, + pub Handled: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub IsUserInitiated: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub GetDeferral: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub WindowFeatures: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2NewWindowRequestedEventArgs_Impl: windows_core::IUnknownImpl { + fn Uri(&self, uri: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn SetNewWindow( + &self, + newwindow: windows_core::Ref<'_, ICoreWebView2>, + ) -> windows_core::Result<()>; + fn NewWindow(&self) -> windows_core::Result; + fn SetHandled(&self, handled: windows_core::BOOL) -> windows_core::Result<()>; + fn Handled(&self, handled: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn IsUserInitiated(&self, isuserinitiated: *mut windows_core::BOOL) + -> windows_core::Result<()>; + fn GetDeferral(&self) -> windows_core::Result; + fn WindowFeatures(&self) -> windows_core::Result; +} +impl ICoreWebView2NewWindowRequestedEventArgs_Vtbl { + pub const fn new< + Identity: ICoreWebView2NewWindowRequestedEventArgs_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Uri< + Identity: ICoreWebView2NewWindowRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + uri: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2NewWindowRequestedEventArgs_Impl::Uri( + this, + core::mem::transmute_copy(&uri), + ) + .into() + } + } + unsafe extern "system" fn SetNewWindow< + Identity: ICoreWebView2NewWindowRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + newwindow: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2NewWindowRequestedEventArgs_Impl::SetNewWindow( + this, + core::mem::transmute_copy(&newwindow), + ) + .into() + } + } + unsafe extern "system" fn NewWindow< + Identity: ICoreWebView2NewWindowRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + newwindow: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2NewWindowRequestedEventArgs_Impl::NewWindow(this) { + Ok(ok__) => { + newwindow.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + unsafe extern "system" fn SetHandled< + Identity: ICoreWebView2NewWindowRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + handled: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2NewWindowRequestedEventArgs_Impl::SetHandled( + this, + core::mem::transmute_copy(&handled), + ) + .into() + } + } + unsafe extern "system" fn Handled< + Identity: ICoreWebView2NewWindowRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + handled: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2NewWindowRequestedEventArgs_Impl::Handled( + this, + core::mem::transmute_copy(&handled), + ) + .into() + } + } + unsafe extern "system" fn IsUserInitiated< + Identity: ICoreWebView2NewWindowRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + isuserinitiated: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2NewWindowRequestedEventArgs_Impl::IsUserInitiated( + this, + core::mem::transmute_copy(&isuserinitiated), + ) + .into() + } + } + unsafe extern "system" fn GetDeferral< + Identity: ICoreWebView2NewWindowRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + deferral: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2NewWindowRequestedEventArgs_Impl::GetDeferral(this) { + Ok(ok__) => { + deferral.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + unsafe extern "system" fn WindowFeatures< + Identity: ICoreWebView2NewWindowRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2NewWindowRequestedEventArgs_Impl::WindowFeatures(this) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Uri: Uri::, + SetNewWindow: SetNewWindow::, + NewWindow: NewWindow::, + SetHandled: SetHandled::, + Handled: Handled::, + IsUserInitiated: IsUserInitiated::, + GetDeferral: GetDeferral::, + WindowFeatures: WindowFeatures::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2NewWindowRequestedEventArgs {} +windows_core::imp::define_interface!( + ICoreWebView2NewWindowRequestedEventArgs2, + ICoreWebView2NewWindowRequestedEventArgs2_Vtbl, + 0xbbc7baed_74c6_4c92_b63a_7f5aeae03de3 +); +impl core::ops::Deref for ICoreWebView2NewWindowRequestedEventArgs2 { + type Target = ICoreWebView2NewWindowRequestedEventArgs; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2NewWindowRequestedEventArgs2, + windows_core::IUnknown, + ICoreWebView2NewWindowRequestedEventArgs +); +impl ICoreWebView2NewWindowRequestedEventArgs2 { + pub unsafe fn Name(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Name)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2NewWindowRequestedEventArgs2_Vtbl { + pub base__: ICoreWebView2NewWindowRequestedEventArgs_Vtbl, + pub Name: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2NewWindowRequestedEventArgs2_Impl: + ICoreWebView2NewWindowRequestedEventArgs_Impl +{ + fn Name(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; +} +impl ICoreWebView2NewWindowRequestedEventArgs2_Vtbl { + pub const fn new< + Identity: ICoreWebView2NewWindowRequestedEventArgs2_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Name< + Identity: ICoreWebView2NewWindowRequestedEventArgs2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2NewWindowRequestedEventArgs2_Impl::Name( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: ICoreWebView2NewWindowRequestedEventArgs_Vtbl::new::(), + Name: Name::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2NewWindowRequestedEventArgs2 {} +windows_core::imp::define_interface!( + ICoreWebView2NewWindowRequestedEventArgs3, + ICoreWebView2NewWindowRequestedEventArgs3_Vtbl, + 0x842bed3c_6ad6_4dd9_b938_28c96667ad66 +); +impl core::ops::Deref for ICoreWebView2NewWindowRequestedEventArgs3 { + type Target = ICoreWebView2NewWindowRequestedEventArgs2; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2NewWindowRequestedEventArgs3, + windows_core::IUnknown, + ICoreWebView2NewWindowRequestedEventArgs, + ICoreWebView2NewWindowRequestedEventArgs2 +); +impl ICoreWebView2NewWindowRequestedEventArgs3 { + pub unsafe fn OriginalSourceFrameInfo(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).OriginalSourceFrameInfo)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2NewWindowRequestedEventArgs3_Vtbl { + pub base__: ICoreWebView2NewWindowRequestedEventArgs2_Vtbl, + pub OriginalSourceFrameInfo: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2NewWindowRequestedEventArgs3_Impl: + ICoreWebView2NewWindowRequestedEventArgs2_Impl +{ + fn OriginalSourceFrameInfo(&self) -> windows_core::Result; +} +impl ICoreWebView2NewWindowRequestedEventArgs3_Vtbl { + pub const fn new< + Identity: ICoreWebView2NewWindowRequestedEventArgs3_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn OriginalSourceFrameInfo< + Identity: ICoreWebView2NewWindowRequestedEventArgs3_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2NewWindowRequestedEventArgs3_Impl::OriginalSourceFrameInfo(this) + { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: ICoreWebView2NewWindowRequestedEventArgs2_Vtbl::new::(), + OriginalSourceFrameInfo: OriginalSourceFrameInfo::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2NewWindowRequestedEventArgs3 {} +windows_core::imp::define_interface!( + ICoreWebView2NewWindowRequestedEventHandler, + ICoreWebView2NewWindowRequestedEventHandler_Vtbl, + 0xd4c185fe_c81c_4989_97af_2d3fa7ab5651 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2NewWindowRequestedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2NewWindowRequestedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2NewWindowRequestedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2NewWindowRequestedEventHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2>, + args: windows_core::Ref<'_, ICoreWebView2NewWindowRequestedEventArgs>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2NewWindowRequestedEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2NewWindowRequestedEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2NewWindowRequestedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2NewWindowRequestedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2NewWindowRequestedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2NonClientRegionChangedEventArgs, + ICoreWebView2NonClientRegionChangedEventArgs_Vtbl, + 0xab71d500_0820_4a52_809c_48db04ff93bf +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2NonClientRegionChangedEventArgs, + windows_core::IUnknown +); +impl ICoreWebView2NonClientRegionChangedEventArgs { + pub unsafe fn RegionKind( + &self, + value: *mut COREWEBVIEW2_NON_CLIENT_REGION_KIND, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).RegionKind)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2NonClientRegionChangedEventArgs_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub RegionKind: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_NON_CLIENT_REGION_KIND, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2NonClientRegionChangedEventArgs_Impl: windows_core::IUnknownImpl { + fn RegionKind( + &self, + value: *mut COREWEBVIEW2_NON_CLIENT_REGION_KIND, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2NonClientRegionChangedEventArgs_Vtbl { + pub const fn new< + Identity: ICoreWebView2NonClientRegionChangedEventArgs_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn RegionKind< + Identity: ICoreWebView2NonClientRegionChangedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut COREWEBVIEW2_NON_CLIENT_REGION_KIND, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2NonClientRegionChangedEventArgs_Impl::RegionKind( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + RegionKind: RegionKind::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2NonClientRegionChangedEventArgs {} +windows_core::imp::define_interface!( + ICoreWebView2NonClientRegionChangedEventHandler, + ICoreWebView2NonClientRegionChangedEventHandler_Vtbl, + 0x4a794e66_aa6c_46bd_93a3_382196837680 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2NonClientRegionChangedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2NonClientRegionChangedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2NonClientRegionChangedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2NonClientRegionChangedEventHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2CompositionController>, + args: windows_core::Ref<'_, ICoreWebView2NonClientRegionChangedEventArgs>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2NonClientRegionChangedEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2NonClientRegionChangedEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2NonClientRegionChangedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2NonClientRegionChangedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2NonClientRegionChangedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2Notification, + ICoreWebView2Notification_Vtbl, + 0xb7434d98_6bc8_419d_9da5_fb5a96d4dacd +); +windows_core::imp::interface_hierarchy!(ICoreWebView2Notification, windows_core::IUnknown); +impl ICoreWebView2Notification { + pub unsafe fn add_CloseRequested( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_CloseRequested)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_CloseRequested(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_CloseRequested)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } + pub unsafe fn ReportShown(&self) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ReportShown)(windows_core::Interface::as_raw( + self, + )) + .ok() + } + } + pub unsafe fn ReportClicked(&self) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ReportClicked)(windows_core::Interface::as_raw( + self, + )) + .ok() + } + } + pub unsafe fn ReportClosed(&self) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ReportClosed)(windows_core::Interface::as_raw( + self, + )) + .ok() + } + } + pub unsafe fn Body(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Body)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn Direction( + &self, + value: *mut COREWEBVIEW2_TEXT_DIRECTION_KIND, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Direction)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn Language(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Language)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn Tag(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Tag)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn IconUri(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).IconUri)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn Title(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Title)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn BadgeUri(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).BadgeUri)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn BodyImageUri(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).BodyImageUri)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn ShouldRenotify( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ShouldRenotify)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn RequiresInteraction( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).RequiresInteraction)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn IsSilent(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).IsSilent)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn Timestamp(&self, value: *mut f64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Timestamp)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn GetVibrationPattern( + &self, + count: *mut u32, + vibrationpattern: *mut *mut u64, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).GetVibrationPattern)( + windows_core::Interface::as_raw(self), + count as _, + vibrationpattern as _, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Notification_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub add_CloseRequested: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_CloseRequested: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, + pub ReportShown: unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT, + pub ReportClicked: unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT, + pub ReportClosed: unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT, + pub Body: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub Direction: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_TEXT_DIRECTION_KIND, + ) -> windows_core::HRESULT, + pub Language: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub Tag: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub IconUri: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub Title: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub BadgeUri: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub BodyImageUri: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub ShouldRenotify: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub RequiresInteraction: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub IsSilent: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub Timestamp: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut f64) -> windows_core::HRESULT, + pub GetVibrationPattern: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut u32, + *mut *mut u64, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Notification_Impl: windows_core::IUnknownImpl { + fn add_CloseRequested( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2NotificationCloseRequestedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_CloseRequested(&self, token: i64) -> windows_core::Result<()>; + fn ReportShown(&self) -> windows_core::Result<()>; + fn ReportClicked(&self) -> windows_core::Result<()>; + fn ReportClosed(&self) -> windows_core::Result<()>; + fn Body(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn Direction(&self, value: *mut COREWEBVIEW2_TEXT_DIRECTION_KIND) -> windows_core::Result<()>; + fn Language(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn Tag(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn IconUri(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn Title(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn BadgeUri(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn BodyImageUri(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn ShouldRenotify(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn RequiresInteraction(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn IsSilent(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn Timestamp(&self, value: *mut f64) -> windows_core::Result<()>; + fn GetVibrationPattern( + &self, + count: *mut u32, + vibrationpattern: *mut *mut u64, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2Notification_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn add_CloseRequested< + Identity: ICoreWebView2Notification_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Notification_Impl::add_CloseRequested( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_CloseRequested< + Identity: ICoreWebView2Notification_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Notification_Impl::remove_CloseRequested( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn ReportShown< + Identity: ICoreWebView2Notification_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Notification_Impl::ReportShown(this).into() + } + } + unsafe extern "system" fn ReportClicked< + Identity: ICoreWebView2Notification_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Notification_Impl::ReportClicked(this).into() + } + } + unsafe extern "system" fn ReportClosed< + Identity: ICoreWebView2Notification_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Notification_Impl::ReportClosed(this).into() + } + } + unsafe extern "system" fn Body< + Identity: ICoreWebView2Notification_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Notification_Impl::Body(this, core::mem::transmute_copy(&value)).into() + } + } + unsafe extern "system" fn Direction< + Identity: ICoreWebView2Notification_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut COREWEBVIEW2_TEXT_DIRECTION_KIND, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Notification_Impl::Direction(this, core::mem::transmute_copy(&value)) + .into() + } + } + unsafe extern "system" fn Language< + Identity: ICoreWebView2Notification_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Notification_Impl::Language(this, core::mem::transmute_copy(&value)) + .into() + } + } + unsafe extern "system" fn Tag< + Identity: ICoreWebView2Notification_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Notification_Impl::Tag(this, core::mem::transmute_copy(&value)).into() + } + } + unsafe extern "system" fn IconUri< + Identity: ICoreWebView2Notification_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Notification_Impl::IconUri(this, core::mem::transmute_copy(&value)) + .into() + } + } + unsafe extern "system" fn Title< + Identity: ICoreWebView2Notification_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Notification_Impl::Title(this, core::mem::transmute_copy(&value)) + .into() + } + } + unsafe extern "system" fn BadgeUri< + Identity: ICoreWebView2Notification_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Notification_Impl::BadgeUri(this, core::mem::transmute_copy(&value)) + .into() + } + } + unsafe extern "system" fn BodyImageUri< + Identity: ICoreWebView2Notification_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Notification_Impl::BodyImageUri( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn ShouldRenotify< + Identity: ICoreWebView2Notification_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Notification_Impl::ShouldRenotify( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn RequiresInteraction< + Identity: ICoreWebView2Notification_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Notification_Impl::RequiresInteraction( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn IsSilent< + Identity: ICoreWebView2Notification_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Notification_Impl::IsSilent(this, core::mem::transmute_copy(&value)) + .into() + } + } + unsafe extern "system" fn Timestamp< + Identity: ICoreWebView2Notification_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut f64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Notification_Impl::Timestamp(this, core::mem::transmute_copy(&value)) + .into() + } + } + unsafe extern "system" fn GetVibrationPattern< + Identity: ICoreWebView2Notification_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + count: *mut u32, + vibrationpattern: *mut *mut u64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Notification_Impl::GetVibrationPattern( + this, + core::mem::transmute_copy(&count), + core::mem::transmute_copy(&vibrationpattern), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + add_CloseRequested: add_CloseRequested::, + remove_CloseRequested: remove_CloseRequested::, + ReportShown: ReportShown::, + ReportClicked: ReportClicked::, + ReportClosed: ReportClosed::, + Body: Body::, + Direction: Direction::, + Language: Language::, + Tag: Tag::, + IconUri: IconUri::, + Title: Title::, + BadgeUri: BadgeUri::, + BodyImageUri: BodyImageUri::, + ShouldRenotify: ShouldRenotify::, + RequiresInteraction: RequiresInteraction::, + IsSilent: IsSilent::, + Timestamp: Timestamp::, + GetVibrationPattern: GetVibrationPattern::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Notification {} +windows_core::imp::define_interface!( + ICoreWebView2NotificationCloseRequestedEventHandler, + ICoreWebView2NotificationCloseRequestedEventHandler_Vtbl, + 0x47c32d23_1e94_4733_85f1_d9bf4acd0974 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2NotificationCloseRequestedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2NotificationCloseRequestedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2NotificationCloseRequestedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2NotificationCloseRequestedEventHandler_Impl: + windows_core::IUnknownImpl +{ + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2Notification>, + args: windows_core::Ref<'_, windows_core::IUnknown>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2NotificationCloseRequestedEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2NotificationCloseRequestedEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2NotificationCloseRequestedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2NotificationCloseRequestedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == & < ICoreWebView2NotificationCloseRequestedEventHandler as windows_core::Interface >::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2NotificationCloseRequestedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2NotificationReceivedEventArgs, + ICoreWebView2NotificationReceivedEventArgs_Vtbl, + 0x1512dd5b_5514_4f85_886e_21c3a4c9cfe6 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2NotificationReceivedEventArgs, + windows_core::IUnknown +); +impl ICoreWebView2NotificationReceivedEventArgs { + pub unsafe fn SenderOrigin(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SenderOrigin)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn Notification(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).Notification)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } + pub unsafe fn SetHandled(&self, value: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetHandled)( + windows_core::Interface::as_raw(self), + value.into(), + ) + .ok() + } + } + pub unsafe fn Handled(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Handled)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn GetDeferral(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).GetDeferral)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2NotificationReceivedEventArgs_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub SenderOrigin: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub Notification: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub SetHandled: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, + pub Handled: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub GetDeferral: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2NotificationReceivedEventArgs_Impl: windows_core::IUnknownImpl { + fn SenderOrigin(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn Notification(&self) -> windows_core::Result; + fn SetHandled(&self, value: windows_core::BOOL) -> windows_core::Result<()>; + fn Handled(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn GetDeferral(&self) -> windows_core::Result; +} +impl ICoreWebView2NotificationReceivedEventArgs_Vtbl { + pub const fn new< + Identity: ICoreWebView2NotificationReceivedEventArgs_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn SenderOrigin< + Identity: ICoreWebView2NotificationReceivedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2NotificationReceivedEventArgs_Impl::SenderOrigin( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn Notification< + Identity: ICoreWebView2NotificationReceivedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2NotificationReceivedEventArgs_Impl::Notification(this) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + unsafe extern "system" fn SetHandled< + Identity: ICoreWebView2NotificationReceivedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2NotificationReceivedEventArgs_Impl::SetHandled( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn Handled< + Identity: ICoreWebView2NotificationReceivedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2NotificationReceivedEventArgs_Impl::Handled( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn GetDeferral< + Identity: ICoreWebView2NotificationReceivedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + deferral: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2NotificationReceivedEventArgs_Impl::GetDeferral(this) { + Ok(ok__) => { + deferral.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + SenderOrigin: SenderOrigin::, + Notification: Notification::, + SetHandled: SetHandled::, + Handled: Handled::, + GetDeferral: GetDeferral::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2NotificationReceivedEventArgs {} +windows_core::imp::define_interface!( + ICoreWebView2NotificationReceivedEventHandler, + ICoreWebView2NotificationReceivedEventHandler_Vtbl, + 0x89c5d598_8788_423b_be97_e6e01c0f9ee3 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2NotificationReceivedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2NotificationReceivedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2NotificationReceivedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2NotificationReceivedEventHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2>, + args: windows_core::Ref<'_, ICoreWebView2NotificationReceivedEventArgs>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2NotificationReceivedEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2NotificationReceivedEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2NotificationReceivedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2NotificationReceivedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2NotificationReceivedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2ObjectCollection, + ICoreWebView2ObjectCollection_Vtbl, + 0x5cfec11c_25bd_4e8d_9e1a_7acdaeeec047 +); +impl core::ops::Deref for ICoreWebView2ObjectCollection { + type Target = ICoreWebView2ObjectCollectionView; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2ObjectCollection, + windows_core::IUnknown, + ICoreWebView2ObjectCollectionView +); +impl ICoreWebView2ObjectCollection { + pub unsafe fn RemoveValueAtIndex(&self, index: u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).RemoveValueAtIndex)( + windows_core::Interface::as_raw(self), + index, + ) + .ok() + } + } + pub unsafe fn InsertValueAtIndex(&self, index: u32, value: P1) -> windows_core::Result<()> + where + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).InsertValueAtIndex)( + windows_core::Interface::as_raw(self), + index, + value.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2ObjectCollection_Vtbl { + pub base__: ICoreWebView2ObjectCollectionView_Vtbl, + pub RemoveValueAtIndex: + unsafe extern "system" fn(*mut core::ffi::c_void, u32) -> windows_core::HRESULT, + pub InsertValueAtIndex: unsafe extern "system" fn( + *mut core::ffi::c_void, + u32, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2ObjectCollection_Impl: ICoreWebView2ObjectCollectionView_Impl { + fn RemoveValueAtIndex(&self, index: u32) -> windows_core::Result<()>; + fn InsertValueAtIndex( + &self, + index: u32, + value: windows_core::Ref<'_, windows_core::IUnknown>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2ObjectCollection_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn RemoveValueAtIndex< + Identity: ICoreWebView2ObjectCollection_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + index: u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ObjectCollection_Impl::RemoveValueAtIndex( + this, + core::mem::transmute_copy(&index), + ) + .into() + } + } + unsafe extern "system" fn InsertValueAtIndex< + Identity: ICoreWebView2ObjectCollection_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + index: u32, + value: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ObjectCollection_Impl::InsertValueAtIndex( + this, + core::mem::transmute_copy(&index), + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: ICoreWebView2ObjectCollectionView_Vtbl::new::(), + RemoveValueAtIndex: RemoveValueAtIndex::, + InsertValueAtIndex: InsertValueAtIndex::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2ObjectCollection {} +windows_core::imp::define_interface!( + ICoreWebView2ObjectCollectionView, + ICoreWebView2ObjectCollectionView_Vtbl, + 0x0f36fd87_4f69_4415_98da_888f89fb9a33 +); +windows_core::imp::interface_hierarchy!(ICoreWebView2ObjectCollectionView, windows_core::IUnknown); +impl ICoreWebView2ObjectCollectionView { + pub unsafe fn Count(&self, value: *mut u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Count)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn GetValueAtIndex( + &self, + index: u32, + ) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).GetValueAtIndex)( + windows_core::Interface::as_raw(self), + index, + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2ObjectCollectionView_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Count: unsafe extern "system" fn(*mut core::ffi::c_void, *mut u32) -> windows_core::HRESULT, + pub GetValueAtIndex: unsafe extern "system" fn( + *mut core::ffi::c_void, + u32, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2ObjectCollectionView_Impl: windows_core::IUnknownImpl { + fn Count(&self, value: *mut u32) -> windows_core::Result<()>; + fn GetValueAtIndex(&self, index: u32) -> windows_core::Result; +} +impl ICoreWebView2ObjectCollectionView_Vtbl { + pub const fn new() -> Self + { + unsafe extern "system" fn Count< + Identity: ICoreWebView2ObjectCollectionView_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ObjectCollectionView_Impl::Count( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn GetValueAtIndex< + Identity: ICoreWebView2ObjectCollectionView_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + index: u32, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2ObjectCollectionView_Impl::GetValueAtIndex( + this, + core::mem::transmute_copy(&index), + ) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Count: Count::, + GetValueAtIndex: GetValueAtIndex::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2ObjectCollectionView {} +windows_core::imp::define_interface!( + ICoreWebView2PermissionRequestedEventArgs, + ICoreWebView2PermissionRequestedEventArgs_Vtbl, + 0x973ae2ef_ff18_4894_8fb2_3c758f046810 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2PermissionRequestedEventArgs, + windows_core::IUnknown +); +impl ICoreWebView2PermissionRequestedEventArgs { + pub unsafe fn Uri(&self, uri: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Uri)( + windows_core::Interface::as_raw(self), + uri as _, + ) + .ok() + } + } + pub unsafe fn PermissionKind( + &self, + permissionkind: *mut COREWEBVIEW2_PERMISSION_KIND, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).PermissionKind)( + windows_core::Interface::as_raw(self), + permissionkind as _, + ) + .ok() + } + } + pub unsafe fn IsUserInitiated( + &self, + isuserinitiated: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).IsUserInitiated)( + windows_core::Interface::as_raw(self), + isuserinitiated as _, + ) + .ok() + } + } + pub unsafe fn State( + &self, + state: *mut COREWEBVIEW2_PERMISSION_STATE, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).State)( + windows_core::Interface::as_raw(self), + state as _, + ) + .ok() + } + } + pub unsafe fn SetState( + &self, + state: COREWEBVIEW2_PERMISSION_STATE, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetState)( + windows_core::Interface::as_raw(self), + state, + ) + .ok() + } + } + pub unsafe fn GetDeferral(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).GetDeferral)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2PermissionRequestedEventArgs_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Uri: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub PermissionKind: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_PERMISSION_KIND, + ) -> windows_core::HRESULT, + pub IsUserInitiated: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub State: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_PERMISSION_STATE, + ) -> windows_core::HRESULT, + pub SetState: unsafe extern "system" fn( + *mut core::ffi::c_void, + COREWEBVIEW2_PERMISSION_STATE, + ) -> windows_core::HRESULT, + pub GetDeferral: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2PermissionRequestedEventArgs_Impl: windows_core::IUnknownImpl { + fn Uri(&self, uri: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn PermissionKind( + &self, + permissionkind: *mut COREWEBVIEW2_PERMISSION_KIND, + ) -> windows_core::Result<()>; + fn IsUserInitiated(&self, isuserinitiated: *mut windows_core::BOOL) + -> windows_core::Result<()>; + fn State(&self, state: *mut COREWEBVIEW2_PERMISSION_STATE) -> windows_core::Result<()>; + fn SetState(&self, state: COREWEBVIEW2_PERMISSION_STATE) -> windows_core::Result<()>; + fn GetDeferral(&self) -> windows_core::Result; +} +impl ICoreWebView2PermissionRequestedEventArgs_Vtbl { + pub const fn new< + Identity: ICoreWebView2PermissionRequestedEventArgs_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Uri< + Identity: ICoreWebView2PermissionRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + uri: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PermissionRequestedEventArgs_Impl::Uri( + this, + core::mem::transmute_copy(&uri), + ) + .into() + } + } + unsafe extern "system" fn PermissionKind< + Identity: ICoreWebView2PermissionRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + permissionkind: *mut COREWEBVIEW2_PERMISSION_KIND, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PermissionRequestedEventArgs_Impl::PermissionKind( + this, + core::mem::transmute_copy(&permissionkind), + ) + .into() + } + } + unsafe extern "system" fn IsUserInitiated< + Identity: ICoreWebView2PermissionRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + isuserinitiated: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PermissionRequestedEventArgs_Impl::IsUserInitiated( + this, + core::mem::transmute_copy(&isuserinitiated), + ) + .into() + } + } + unsafe extern "system" fn State< + Identity: ICoreWebView2PermissionRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + state: *mut COREWEBVIEW2_PERMISSION_STATE, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PermissionRequestedEventArgs_Impl::State( + this, + core::mem::transmute_copy(&state), + ) + .into() + } + } + unsafe extern "system" fn SetState< + Identity: ICoreWebView2PermissionRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + state: COREWEBVIEW2_PERMISSION_STATE, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PermissionRequestedEventArgs_Impl::SetState( + this, + core::mem::transmute_copy(&state), + ) + .into() + } + } + unsafe extern "system" fn GetDeferral< + Identity: ICoreWebView2PermissionRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + deferral: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2PermissionRequestedEventArgs_Impl::GetDeferral(this) { + Ok(ok__) => { + deferral.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Uri: Uri::, + PermissionKind: PermissionKind::, + IsUserInitiated: IsUserInitiated::, + State: State::, + SetState: SetState::, + GetDeferral: GetDeferral::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2PermissionRequestedEventArgs {} +windows_core::imp::define_interface!( + ICoreWebView2PermissionRequestedEventArgs2, + ICoreWebView2PermissionRequestedEventArgs2_Vtbl, + 0x74d7127f_9de6_4200_8734_42d6fb4ff741 +); +impl core::ops::Deref for ICoreWebView2PermissionRequestedEventArgs2 { + type Target = ICoreWebView2PermissionRequestedEventArgs; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2PermissionRequestedEventArgs2, + windows_core::IUnknown, + ICoreWebView2PermissionRequestedEventArgs +); +impl ICoreWebView2PermissionRequestedEventArgs2 { + pub unsafe fn Handled(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Handled)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetHandled(&self, value: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetHandled)( + windows_core::Interface::as_raw(self), + value.into(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2PermissionRequestedEventArgs2_Vtbl { + pub base__: ICoreWebView2PermissionRequestedEventArgs_Vtbl, + pub Handled: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetHandled: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2PermissionRequestedEventArgs2_Impl: + ICoreWebView2PermissionRequestedEventArgs_Impl +{ + fn Handled(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn SetHandled(&self, value: windows_core::BOOL) -> windows_core::Result<()>; +} +impl ICoreWebView2PermissionRequestedEventArgs2_Vtbl { + pub const fn new< + Identity: ICoreWebView2PermissionRequestedEventArgs2_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Handled< + Identity: ICoreWebView2PermissionRequestedEventArgs2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PermissionRequestedEventArgs2_Impl::Handled( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetHandled< + Identity: ICoreWebView2PermissionRequestedEventArgs2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PermissionRequestedEventArgs2_Impl::SetHandled( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: ICoreWebView2PermissionRequestedEventArgs_Vtbl::new::(), + Handled: Handled::, + SetHandled: SetHandled::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2PermissionRequestedEventArgs2 {} +windows_core::imp::define_interface!( + ICoreWebView2PermissionRequestedEventArgs3, + ICoreWebView2PermissionRequestedEventArgs3_Vtbl, + 0xe61670bc_3dce_4177_86d2_c629ae3cb6ac +); +impl core::ops::Deref for ICoreWebView2PermissionRequestedEventArgs3 { + type Target = ICoreWebView2PermissionRequestedEventArgs2; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2PermissionRequestedEventArgs3, + windows_core::IUnknown, + ICoreWebView2PermissionRequestedEventArgs, + ICoreWebView2PermissionRequestedEventArgs2 +); +impl ICoreWebView2PermissionRequestedEventArgs3 { + pub unsafe fn SavesInProfile( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SavesInProfile)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetSavesInProfile(&self, value: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetSavesInProfile)( + windows_core::Interface::as_raw(self), + value.into(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2PermissionRequestedEventArgs3_Vtbl { + pub base__: ICoreWebView2PermissionRequestedEventArgs2_Vtbl, + pub SavesInProfile: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetSavesInProfile: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2PermissionRequestedEventArgs3_Impl: + ICoreWebView2PermissionRequestedEventArgs2_Impl +{ + fn SavesInProfile(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn SetSavesInProfile(&self, value: windows_core::BOOL) -> windows_core::Result<()>; +} +impl ICoreWebView2PermissionRequestedEventArgs3_Vtbl { + pub const fn new< + Identity: ICoreWebView2PermissionRequestedEventArgs3_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn SavesInProfile< + Identity: ICoreWebView2PermissionRequestedEventArgs3_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PermissionRequestedEventArgs3_Impl::SavesInProfile( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetSavesInProfile< + Identity: ICoreWebView2PermissionRequestedEventArgs3_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PermissionRequestedEventArgs3_Impl::SetSavesInProfile( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: ICoreWebView2PermissionRequestedEventArgs2_Vtbl::new::(), + SavesInProfile: SavesInProfile::, + SetSavesInProfile: SetSavesInProfile::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2PermissionRequestedEventArgs3 {} +windows_core::imp::define_interface!( + ICoreWebView2PermissionRequestedEventHandler, + ICoreWebView2PermissionRequestedEventHandler_Vtbl, + 0x15e1c6a3_c72a_4df3_91d7_d097fbec6bfd +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2PermissionRequestedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2PermissionRequestedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2PermissionRequestedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2PermissionRequestedEventHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2>, + args: windows_core::Ref<'_, ICoreWebView2PermissionRequestedEventArgs>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2PermissionRequestedEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2PermissionRequestedEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2PermissionRequestedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PermissionRequestedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2PermissionRequestedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2PermissionSetting, + ICoreWebView2PermissionSetting_Vtbl, + 0x792b6eca_5576_421c_9119_74ebb3a4ffb3 +); +windows_core::imp::interface_hierarchy!(ICoreWebView2PermissionSetting, windows_core::IUnknown); +impl ICoreWebView2PermissionSetting { + pub unsafe fn PermissionKind( + &self, + value: *mut COREWEBVIEW2_PERMISSION_KIND, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).PermissionKind)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn PermissionOrigin( + &self, + value: *mut windows_core::PWSTR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).PermissionOrigin)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn PermissionState( + &self, + value: *mut COREWEBVIEW2_PERMISSION_STATE, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).PermissionState)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2PermissionSetting_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub PermissionKind: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_PERMISSION_KIND, + ) -> windows_core::HRESULT, + pub PermissionOrigin: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub PermissionState: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_PERMISSION_STATE, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2PermissionSetting_Impl: windows_core::IUnknownImpl { + fn PermissionKind(&self, value: *mut COREWEBVIEW2_PERMISSION_KIND) -> windows_core::Result<()>; + fn PermissionOrigin(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn PermissionState( + &self, + value: *mut COREWEBVIEW2_PERMISSION_STATE, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2PermissionSetting_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn PermissionKind< + Identity: ICoreWebView2PermissionSetting_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut COREWEBVIEW2_PERMISSION_KIND, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PermissionSetting_Impl::PermissionKind( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn PermissionOrigin< + Identity: ICoreWebView2PermissionSetting_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PermissionSetting_Impl::PermissionOrigin( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn PermissionState< + Identity: ICoreWebView2PermissionSetting_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut COREWEBVIEW2_PERMISSION_STATE, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PermissionSetting_Impl::PermissionState( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + PermissionKind: PermissionKind::, + PermissionOrigin: PermissionOrigin::, + PermissionState: PermissionState::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2PermissionSetting {} +windows_core::imp::define_interface!( + ICoreWebView2PermissionSettingCollectionView, + ICoreWebView2PermissionSettingCollectionView_Vtbl, + 0xf5596f62_3de5_47b1_91e8_a4104b596b96 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2PermissionSettingCollectionView, + windows_core::IUnknown +); +impl ICoreWebView2PermissionSettingCollectionView { + pub unsafe fn GetValueAtIndex( + &self, + index: u32, + ) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).GetValueAtIndex)( + windows_core::Interface::as_raw(self), + index, + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } + pub unsafe fn Count(&self, value: *mut u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Count)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2PermissionSettingCollectionView_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub GetValueAtIndex: unsafe extern "system" fn( + *mut core::ffi::c_void, + u32, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub Count: unsafe extern "system" fn(*mut core::ffi::c_void, *mut u32) -> windows_core::HRESULT, +} +pub trait ICoreWebView2PermissionSettingCollectionView_Impl: windows_core::IUnknownImpl { + fn GetValueAtIndex(&self, index: u32) -> windows_core::Result; + fn Count(&self, value: *mut u32) -> windows_core::Result<()>; +} +impl ICoreWebView2PermissionSettingCollectionView_Vtbl { + pub const fn new< + Identity: ICoreWebView2PermissionSettingCollectionView_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn GetValueAtIndex< + Identity: ICoreWebView2PermissionSettingCollectionView_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + index: u32, + permissionsetting: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2PermissionSettingCollectionView_Impl::GetValueAtIndex( + this, + core::mem::transmute_copy(&index), + ) { + Ok(ok__) => { + permissionsetting.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + unsafe extern "system" fn Count< + Identity: ICoreWebView2PermissionSettingCollectionView_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PermissionSettingCollectionView_Impl::Count( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + GetValueAtIndex: GetValueAtIndex::, + Count: Count::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2PermissionSettingCollectionView {} +windows_core::imp::define_interface!( + ICoreWebView2PointerInfo, + ICoreWebView2PointerInfo_Vtbl, + 0xe6995887_d10d_4f5d_9359_4ce46e4f96b9 +); +windows_core::imp::interface_hierarchy!(ICoreWebView2PointerInfo, windows_core::IUnknown); +impl ICoreWebView2PointerInfo { + pub unsafe fn PointerKind(&self, pointerkind: *mut u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).PointerKind)( + windows_core::Interface::as_raw(self), + pointerkind as _, + ) + .ok() + } + } + pub unsafe fn SetPointerKind(&self, pointerkind: u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetPointerKind)( + windows_core::Interface::as_raw(self), + pointerkind, + ) + .ok() + } + } + pub unsafe fn PointerId(&self, pointerid: *mut u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).PointerId)( + windows_core::Interface::as_raw(self), + pointerid as _, + ) + .ok() + } + } + pub unsafe fn SetPointerId(&self, pointerid: u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetPointerId)( + windows_core::Interface::as_raw(self), + pointerid, + ) + .ok() + } + } + pub unsafe fn FrameId(&self, frameid: *mut u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).FrameId)( + windows_core::Interface::as_raw(self), + frameid as _, + ) + .ok() + } + } + pub unsafe fn SetFrameId(&self, frameid: u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetFrameId)( + windows_core::Interface::as_raw(self), + frameid, + ) + .ok() + } + } + pub unsafe fn PointerFlags(&self, pointerflags: *mut u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).PointerFlags)( + windows_core::Interface::as_raw(self), + pointerflags as _, + ) + .ok() + } + } + pub unsafe fn SetPointerFlags(&self, pointerflags: u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetPointerFlags)( + windows_core::Interface::as_raw(self), + pointerflags, + ) + .ok() + } + } + pub unsafe fn PointerDeviceRect( + &self, + pointerdevicerect: *mut windows::Win32::Foundation::RECT, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).PointerDeviceRect)( + windows_core::Interface::as_raw(self), + pointerdevicerect as _, + ) + .ok() + } + } + pub unsafe fn SetPointerDeviceRect( + &self, + pointerdevicerect: windows::Win32::Foundation::RECT, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetPointerDeviceRect)( + windows_core::Interface::as_raw(self), + core::mem::transmute(pointerdevicerect), + ) + .ok() + } + } + pub unsafe fn DisplayRect( + &self, + displayrect: *mut windows::Win32::Foundation::RECT, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).DisplayRect)( + windows_core::Interface::as_raw(self), + displayrect as _, + ) + .ok() + } + } + pub unsafe fn SetDisplayRect( + &self, + displayrect: windows::Win32::Foundation::RECT, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetDisplayRect)( + windows_core::Interface::as_raw(self), + core::mem::transmute(displayrect), + ) + .ok() + } + } + pub unsafe fn PixelLocation( + &self, + pixellocation: *mut windows::Win32::Foundation::POINT, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).PixelLocation)( + windows_core::Interface::as_raw(self), + pixellocation as _, + ) + .ok() + } + } + pub unsafe fn SetPixelLocation( + &self, + pixellocation: windows::Win32::Foundation::POINT, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetPixelLocation)( + windows_core::Interface::as_raw(self), + core::mem::transmute(pixellocation), + ) + .ok() + } + } + pub unsafe fn HimetricLocation( + &self, + himetriclocation: *mut windows::Win32::Foundation::POINT, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).HimetricLocation)( + windows_core::Interface::as_raw(self), + himetriclocation as _, + ) + .ok() + } + } + pub unsafe fn SetHimetricLocation( + &self, + himetriclocation: windows::Win32::Foundation::POINT, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetHimetricLocation)( + windows_core::Interface::as_raw(self), + core::mem::transmute(himetriclocation), + ) + .ok() + } + } + pub unsafe fn PixelLocationRaw( + &self, + pixellocationraw: *mut windows::Win32::Foundation::POINT, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).PixelLocationRaw)( + windows_core::Interface::as_raw(self), + pixellocationraw as _, + ) + .ok() + } + } + pub unsafe fn SetPixelLocationRaw( + &self, + pixellocationraw: windows::Win32::Foundation::POINT, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetPixelLocationRaw)( + windows_core::Interface::as_raw(self), + core::mem::transmute(pixellocationraw), + ) + .ok() + } + } + pub unsafe fn HimetricLocationRaw( + &self, + himetriclocationraw: *mut windows::Win32::Foundation::POINT, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).HimetricLocationRaw)( + windows_core::Interface::as_raw(self), + himetriclocationraw as _, + ) + .ok() + } + } + pub unsafe fn SetHimetricLocationRaw( + &self, + himetriclocationraw: windows::Win32::Foundation::POINT, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetHimetricLocationRaw)( + windows_core::Interface::as_raw(self), + core::mem::transmute(himetriclocationraw), + ) + .ok() + } + } + pub unsafe fn Time(&self, time: *mut u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Time)( + windows_core::Interface::as_raw(self), + time as _, + ) + .ok() + } + } + pub unsafe fn SetTime(&self, time: u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetTime)( + windows_core::Interface::as_raw(self), + time, + ) + .ok() + } + } + pub unsafe fn HistoryCount(&self, historycount: *mut u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).HistoryCount)( + windows_core::Interface::as_raw(self), + historycount as _, + ) + .ok() + } + } + pub unsafe fn SetHistoryCount(&self, historycount: u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetHistoryCount)( + windows_core::Interface::as_raw(self), + historycount, + ) + .ok() + } + } + pub unsafe fn InputData(&self, inputdata: *mut i32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).InputData)( + windows_core::Interface::as_raw(self), + inputdata as _, + ) + .ok() + } + } + pub unsafe fn SetInputData(&self, inputdata: i32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetInputData)( + windows_core::Interface::as_raw(self), + inputdata, + ) + .ok() + } + } + pub unsafe fn KeyStates(&self, keystates: *mut u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).KeyStates)( + windows_core::Interface::as_raw(self), + keystates as _, + ) + .ok() + } + } + pub unsafe fn SetKeyStates(&self, keystates: u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetKeyStates)( + windows_core::Interface::as_raw(self), + keystates, + ) + .ok() + } + } + pub unsafe fn PerformanceCount(&self, performancecount: *mut u64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).PerformanceCount)( + windows_core::Interface::as_raw(self), + performancecount as _, + ) + .ok() + } + } + pub unsafe fn SetPerformanceCount(&self, performancecount: u64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetPerformanceCount)( + windows_core::Interface::as_raw(self), + performancecount, + ) + .ok() + } + } + pub unsafe fn ButtonChangeKind(&self, buttonchangekind: *mut i32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ButtonChangeKind)( + windows_core::Interface::as_raw(self), + buttonchangekind as _, + ) + .ok() + } + } + pub unsafe fn SetButtonChangeKind(&self, buttonchangekind: i32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetButtonChangeKind)( + windows_core::Interface::as_raw(self), + buttonchangekind, + ) + .ok() + } + } + pub unsafe fn PenFlags(&self, penflags: *mut u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).PenFlags)( + windows_core::Interface::as_raw(self), + penflags as _, + ) + .ok() + } + } + pub unsafe fn SetPenFlags(&self, penflags: u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetPenFlags)( + windows_core::Interface::as_raw(self), + penflags, + ) + .ok() + } + } + pub unsafe fn PenMask(&self, penmask: *mut u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).PenMask)( + windows_core::Interface::as_raw(self), + penmask as _, + ) + .ok() + } + } + pub unsafe fn SetPenMask(&self, penmask: u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetPenMask)( + windows_core::Interface::as_raw(self), + penmask, + ) + .ok() + } + } + pub unsafe fn PenPressure(&self, penpressure: *mut u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).PenPressure)( + windows_core::Interface::as_raw(self), + penpressure as _, + ) + .ok() + } + } + pub unsafe fn SetPenPressure(&self, penpressure: u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetPenPressure)( + windows_core::Interface::as_raw(self), + penpressure, + ) + .ok() + } + } + pub unsafe fn PenRotation(&self, penrotation: *mut u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).PenRotation)( + windows_core::Interface::as_raw(self), + penrotation as _, + ) + .ok() + } + } + pub unsafe fn SetPenRotation(&self, penrotation: u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetPenRotation)( + windows_core::Interface::as_raw(self), + penrotation, + ) + .ok() + } + } + pub unsafe fn PenTiltX(&self, pentiltx: *mut i32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).PenTiltX)( + windows_core::Interface::as_raw(self), + pentiltx as _, + ) + .ok() + } + } + pub unsafe fn SetPenTiltX(&self, pentiltx: i32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetPenTiltX)( + windows_core::Interface::as_raw(self), + pentiltx, + ) + .ok() + } + } + pub unsafe fn PenTiltY(&self, pentilty: *mut i32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).PenTiltY)( + windows_core::Interface::as_raw(self), + pentilty as _, + ) + .ok() + } + } + pub unsafe fn SetPenTiltY(&self, pentilty: i32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetPenTiltY)( + windows_core::Interface::as_raw(self), + pentilty, + ) + .ok() + } + } + pub unsafe fn TouchFlags(&self, touchflags: *mut u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).TouchFlags)( + windows_core::Interface::as_raw(self), + touchflags as _, + ) + .ok() + } + } + pub unsafe fn SetTouchFlags(&self, touchflags: u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetTouchFlags)( + windows_core::Interface::as_raw(self), + touchflags, + ) + .ok() + } + } + pub unsafe fn TouchMask(&self, touchmask: *mut u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).TouchMask)( + windows_core::Interface::as_raw(self), + touchmask as _, + ) + .ok() + } + } + pub unsafe fn SetTouchMask(&self, touchmask: u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetTouchMask)( + windows_core::Interface::as_raw(self), + touchmask, + ) + .ok() + } + } + pub unsafe fn TouchContact( + &self, + touchcontact: *mut windows::Win32::Foundation::RECT, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).TouchContact)( + windows_core::Interface::as_raw(self), + touchcontact as _, + ) + .ok() + } + } + pub unsafe fn SetTouchContact( + &self, + touchcontact: windows::Win32::Foundation::RECT, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetTouchContact)( + windows_core::Interface::as_raw(self), + core::mem::transmute(touchcontact), + ) + .ok() + } + } + pub unsafe fn TouchContactRaw( + &self, + touchcontactraw: *mut windows::Win32::Foundation::RECT, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).TouchContactRaw)( + windows_core::Interface::as_raw(self), + touchcontactraw as _, + ) + .ok() + } + } + pub unsafe fn SetTouchContactRaw( + &self, + touchcontactraw: windows::Win32::Foundation::RECT, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetTouchContactRaw)( + windows_core::Interface::as_raw(self), + core::mem::transmute(touchcontactraw), + ) + .ok() + } + } + pub unsafe fn TouchOrientation(&self, touchorientation: *mut u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).TouchOrientation)( + windows_core::Interface::as_raw(self), + touchorientation as _, + ) + .ok() + } + } + pub unsafe fn SetTouchOrientation(&self, touchorientation: u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetTouchOrientation)( + windows_core::Interface::as_raw(self), + touchorientation, + ) + .ok() + } + } + pub unsafe fn TouchPressure(&self, touchpressure: *mut u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).TouchPressure)( + windows_core::Interface::as_raw(self), + touchpressure as _, + ) + .ok() + } + } + pub unsafe fn SetTouchPressure(&self, touchpressure: u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetTouchPressure)( + windows_core::Interface::as_raw(self), + touchpressure, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2PointerInfo_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub PointerKind: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut u32) -> windows_core::HRESULT, + pub SetPointerKind: + unsafe extern "system" fn(*mut core::ffi::c_void, u32) -> windows_core::HRESULT, + pub PointerId: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut u32) -> windows_core::HRESULT, + pub SetPointerId: + unsafe extern "system" fn(*mut core::ffi::c_void, u32) -> windows_core::HRESULT, + pub FrameId: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut u32) -> windows_core::HRESULT, + pub SetFrameId: unsafe extern "system" fn(*mut core::ffi::c_void, u32) -> windows_core::HRESULT, + pub PointerFlags: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut u32) -> windows_core::HRESULT, + pub SetPointerFlags: + unsafe extern "system" fn(*mut core::ffi::c_void, u32) -> windows_core::HRESULT, + pub PointerDeviceRect: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows::Win32::Foundation::RECT, + ) -> windows_core::HRESULT, + pub SetPointerDeviceRect: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows::Win32::Foundation::RECT, + ) -> windows_core::HRESULT, + pub DisplayRect: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows::Win32::Foundation::RECT, + ) -> windows_core::HRESULT, + pub SetDisplayRect: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows::Win32::Foundation::RECT, + ) -> windows_core::HRESULT, + pub PixelLocation: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows::Win32::Foundation::POINT, + ) -> windows_core::HRESULT, + pub SetPixelLocation: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows::Win32::Foundation::POINT, + ) -> windows_core::HRESULT, + pub HimetricLocation: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows::Win32::Foundation::POINT, + ) -> windows_core::HRESULT, + pub SetHimetricLocation: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows::Win32::Foundation::POINT, + ) -> windows_core::HRESULT, + pub PixelLocationRaw: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows::Win32::Foundation::POINT, + ) -> windows_core::HRESULT, + pub SetPixelLocationRaw: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows::Win32::Foundation::POINT, + ) -> windows_core::HRESULT, + pub HimetricLocationRaw: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows::Win32::Foundation::POINT, + ) -> windows_core::HRESULT, + pub SetHimetricLocationRaw: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows::Win32::Foundation::POINT, + ) -> windows_core::HRESULT, + pub Time: unsafe extern "system" fn(*mut core::ffi::c_void, *mut u32) -> windows_core::HRESULT, + pub SetTime: unsafe extern "system" fn(*mut core::ffi::c_void, u32) -> windows_core::HRESULT, + pub HistoryCount: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut u32) -> windows_core::HRESULT, + pub SetHistoryCount: + unsafe extern "system" fn(*mut core::ffi::c_void, u32) -> windows_core::HRESULT, + pub InputData: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut i32) -> windows_core::HRESULT, + pub SetInputData: + unsafe extern "system" fn(*mut core::ffi::c_void, i32) -> windows_core::HRESULT, + pub KeyStates: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut u32) -> windows_core::HRESULT, + pub SetKeyStates: + unsafe extern "system" fn(*mut core::ffi::c_void, u32) -> windows_core::HRESULT, + pub PerformanceCount: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut u64) -> windows_core::HRESULT, + pub SetPerformanceCount: + unsafe extern "system" fn(*mut core::ffi::c_void, u64) -> windows_core::HRESULT, + pub ButtonChangeKind: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut i32) -> windows_core::HRESULT, + pub SetButtonChangeKind: + unsafe extern "system" fn(*mut core::ffi::c_void, i32) -> windows_core::HRESULT, + pub PenFlags: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut u32) -> windows_core::HRESULT, + pub SetPenFlags: + unsafe extern "system" fn(*mut core::ffi::c_void, u32) -> windows_core::HRESULT, + pub PenMask: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut u32) -> windows_core::HRESULT, + pub SetPenMask: unsafe extern "system" fn(*mut core::ffi::c_void, u32) -> windows_core::HRESULT, + pub PenPressure: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut u32) -> windows_core::HRESULT, + pub SetPenPressure: + unsafe extern "system" fn(*mut core::ffi::c_void, u32) -> windows_core::HRESULT, + pub PenRotation: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut u32) -> windows_core::HRESULT, + pub SetPenRotation: + unsafe extern "system" fn(*mut core::ffi::c_void, u32) -> windows_core::HRESULT, + pub PenTiltX: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut i32) -> windows_core::HRESULT, + pub SetPenTiltX: + unsafe extern "system" fn(*mut core::ffi::c_void, i32) -> windows_core::HRESULT, + pub PenTiltY: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut i32) -> windows_core::HRESULT, + pub SetPenTiltY: + unsafe extern "system" fn(*mut core::ffi::c_void, i32) -> windows_core::HRESULT, + pub TouchFlags: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut u32) -> windows_core::HRESULT, + pub SetTouchFlags: + unsafe extern "system" fn(*mut core::ffi::c_void, u32) -> windows_core::HRESULT, + pub TouchMask: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut u32) -> windows_core::HRESULT, + pub SetTouchMask: + unsafe extern "system" fn(*mut core::ffi::c_void, u32) -> windows_core::HRESULT, + pub TouchContact: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows::Win32::Foundation::RECT, + ) -> windows_core::HRESULT, + pub SetTouchContact: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows::Win32::Foundation::RECT, + ) -> windows_core::HRESULT, + pub TouchContactRaw: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows::Win32::Foundation::RECT, + ) -> windows_core::HRESULT, + pub SetTouchContactRaw: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows::Win32::Foundation::RECT, + ) -> windows_core::HRESULT, + pub TouchOrientation: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut u32) -> windows_core::HRESULT, + pub SetTouchOrientation: + unsafe extern "system" fn(*mut core::ffi::c_void, u32) -> windows_core::HRESULT, + pub TouchPressure: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut u32) -> windows_core::HRESULT, + pub SetTouchPressure: + unsafe extern "system" fn(*mut core::ffi::c_void, u32) -> windows_core::HRESULT, +} +pub trait ICoreWebView2PointerInfo_Impl: windows_core::IUnknownImpl { + fn PointerKind(&self, pointerkind: *mut u32) -> windows_core::Result<()>; + fn SetPointerKind(&self, pointerkind: u32) -> windows_core::Result<()>; + fn PointerId(&self, pointerid: *mut u32) -> windows_core::Result<()>; + fn SetPointerId(&self, pointerid: u32) -> windows_core::Result<()>; + fn FrameId(&self, frameid: *mut u32) -> windows_core::Result<()>; + fn SetFrameId(&self, frameid: u32) -> windows_core::Result<()>; + fn PointerFlags(&self, pointerflags: *mut u32) -> windows_core::Result<()>; + fn SetPointerFlags(&self, pointerflags: u32) -> windows_core::Result<()>; + fn PointerDeviceRect( + &self, + pointerdevicerect: *mut windows::Win32::Foundation::RECT, + ) -> windows_core::Result<()>; + fn SetPointerDeviceRect( + &self, + pointerdevicerect: &windows::Win32::Foundation::RECT, + ) -> windows_core::Result<()>; + fn DisplayRect( + &self, + displayrect: *mut windows::Win32::Foundation::RECT, + ) -> windows_core::Result<()>; + fn SetDisplayRect( + &self, + displayrect: &windows::Win32::Foundation::RECT, + ) -> windows_core::Result<()>; + fn PixelLocation( + &self, + pixellocation: *mut windows::Win32::Foundation::POINT, + ) -> windows_core::Result<()>; + fn SetPixelLocation( + &self, + pixellocation: &windows::Win32::Foundation::POINT, + ) -> windows_core::Result<()>; + fn HimetricLocation( + &self, + himetriclocation: *mut windows::Win32::Foundation::POINT, + ) -> windows_core::Result<()>; + fn SetHimetricLocation( + &self, + himetriclocation: &windows::Win32::Foundation::POINT, + ) -> windows_core::Result<()>; + fn PixelLocationRaw( + &self, + pixellocationraw: *mut windows::Win32::Foundation::POINT, + ) -> windows_core::Result<()>; + fn SetPixelLocationRaw( + &self, + pixellocationraw: &windows::Win32::Foundation::POINT, + ) -> windows_core::Result<()>; + fn HimetricLocationRaw( + &self, + himetriclocationraw: *mut windows::Win32::Foundation::POINT, + ) -> windows_core::Result<()>; + fn SetHimetricLocationRaw( + &self, + himetriclocationraw: &windows::Win32::Foundation::POINT, + ) -> windows_core::Result<()>; + fn Time(&self, time: *mut u32) -> windows_core::Result<()>; + fn SetTime(&self, time: u32) -> windows_core::Result<()>; + fn HistoryCount(&self, historycount: *mut u32) -> windows_core::Result<()>; + fn SetHistoryCount(&self, historycount: u32) -> windows_core::Result<()>; + fn InputData(&self, inputdata: *mut i32) -> windows_core::Result<()>; + fn SetInputData(&self, inputdata: i32) -> windows_core::Result<()>; + fn KeyStates(&self, keystates: *mut u32) -> windows_core::Result<()>; + fn SetKeyStates(&self, keystates: u32) -> windows_core::Result<()>; + fn PerformanceCount(&self, performancecount: *mut u64) -> windows_core::Result<()>; + fn SetPerformanceCount(&self, performancecount: u64) -> windows_core::Result<()>; + fn ButtonChangeKind(&self, buttonchangekind: *mut i32) -> windows_core::Result<()>; + fn SetButtonChangeKind(&self, buttonchangekind: i32) -> windows_core::Result<()>; + fn PenFlags(&self, penflags: *mut u32) -> windows_core::Result<()>; + fn SetPenFlags(&self, penflags: u32) -> windows_core::Result<()>; + fn PenMask(&self, penmask: *mut u32) -> windows_core::Result<()>; + fn SetPenMask(&self, penmask: u32) -> windows_core::Result<()>; + fn PenPressure(&self, penpressure: *mut u32) -> windows_core::Result<()>; + fn SetPenPressure(&self, penpressure: u32) -> windows_core::Result<()>; + fn PenRotation(&self, penrotation: *mut u32) -> windows_core::Result<()>; + fn SetPenRotation(&self, penrotation: u32) -> windows_core::Result<()>; + fn PenTiltX(&self, pentiltx: *mut i32) -> windows_core::Result<()>; + fn SetPenTiltX(&self, pentiltx: i32) -> windows_core::Result<()>; + fn PenTiltY(&self, pentilty: *mut i32) -> windows_core::Result<()>; + fn SetPenTiltY(&self, pentilty: i32) -> windows_core::Result<()>; + fn TouchFlags(&self, touchflags: *mut u32) -> windows_core::Result<()>; + fn SetTouchFlags(&self, touchflags: u32) -> windows_core::Result<()>; + fn TouchMask(&self, touchmask: *mut u32) -> windows_core::Result<()>; + fn SetTouchMask(&self, touchmask: u32) -> windows_core::Result<()>; + fn TouchContact( + &self, + touchcontact: *mut windows::Win32::Foundation::RECT, + ) -> windows_core::Result<()>; + fn SetTouchContact( + &self, + touchcontact: &windows::Win32::Foundation::RECT, + ) -> windows_core::Result<()>; + fn TouchContactRaw( + &self, + touchcontactraw: *mut windows::Win32::Foundation::RECT, + ) -> windows_core::Result<()>; + fn SetTouchContactRaw( + &self, + touchcontactraw: &windows::Win32::Foundation::RECT, + ) -> windows_core::Result<()>; + fn TouchOrientation(&self, touchorientation: *mut u32) -> windows_core::Result<()>; + fn SetTouchOrientation(&self, touchorientation: u32) -> windows_core::Result<()>; + fn TouchPressure(&self, touchpressure: *mut u32) -> windows_core::Result<()>; + fn SetTouchPressure(&self, touchpressure: u32) -> windows_core::Result<()>; +} +impl ICoreWebView2PointerInfo_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn PointerKind< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + pointerkind: *mut u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::PointerKind( + this, + core::mem::transmute_copy(&pointerkind), + ) + .into() + } + } + unsafe extern "system" fn SetPointerKind< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + pointerkind: u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::SetPointerKind( + this, + core::mem::transmute_copy(&pointerkind), + ) + .into() + } + } + unsafe extern "system" fn PointerId< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + pointerid: *mut u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::PointerId( + this, + core::mem::transmute_copy(&pointerid), + ) + .into() + } + } + unsafe extern "system" fn SetPointerId< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + pointerid: u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::SetPointerId( + this, + core::mem::transmute_copy(&pointerid), + ) + .into() + } + } + unsafe extern "system" fn FrameId< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + frameid: *mut u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::FrameId(this, core::mem::transmute_copy(&frameid)) + .into() + } + } + unsafe extern "system" fn SetFrameId< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + frameid: u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::SetFrameId(this, core::mem::transmute_copy(&frameid)) + .into() + } + } + unsafe extern "system" fn PointerFlags< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + pointerflags: *mut u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::PointerFlags( + this, + core::mem::transmute_copy(&pointerflags), + ) + .into() + } + } + unsafe extern "system" fn SetPointerFlags< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + pointerflags: u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::SetPointerFlags( + this, + core::mem::transmute_copy(&pointerflags), + ) + .into() + } + } + unsafe extern "system" fn PointerDeviceRect< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + pointerdevicerect: *mut windows::Win32::Foundation::RECT, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::PointerDeviceRect( + this, + core::mem::transmute_copy(&pointerdevicerect), + ) + .into() + } + } + unsafe extern "system" fn SetPointerDeviceRect< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + pointerdevicerect: windows::Win32::Foundation::RECT, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::SetPointerDeviceRect( + this, + core::mem::transmute(&pointerdevicerect), + ) + .into() + } + } + unsafe extern "system" fn DisplayRect< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + displayrect: *mut windows::Win32::Foundation::RECT, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::DisplayRect( + this, + core::mem::transmute_copy(&displayrect), + ) + .into() + } + } + unsafe extern "system" fn SetDisplayRect< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + displayrect: windows::Win32::Foundation::RECT, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::SetDisplayRect( + this, + core::mem::transmute(&displayrect), + ) + .into() + } + } + unsafe extern "system" fn PixelLocation< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + pixellocation: *mut windows::Win32::Foundation::POINT, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::PixelLocation( + this, + core::mem::transmute_copy(&pixellocation), + ) + .into() + } + } + unsafe extern "system" fn SetPixelLocation< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + pixellocation: windows::Win32::Foundation::POINT, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::SetPixelLocation( + this, + core::mem::transmute(&pixellocation), + ) + .into() + } + } + unsafe extern "system" fn HimetricLocation< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + himetriclocation: *mut windows::Win32::Foundation::POINT, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::HimetricLocation( + this, + core::mem::transmute_copy(&himetriclocation), + ) + .into() + } + } + unsafe extern "system" fn SetHimetricLocation< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + himetriclocation: windows::Win32::Foundation::POINT, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::SetHimetricLocation( + this, + core::mem::transmute(&himetriclocation), + ) + .into() + } + } + unsafe extern "system" fn PixelLocationRaw< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + pixellocationraw: *mut windows::Win32::Foundation::POINT, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::PixelLocationRaw( + this, + core::mem::transmute_copy(&pixellocationraw), + ) + .into() + } + } + unsafe extern "system" fn SetPixelLocationRaw< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + pixellocationraw: windows::Win32::Foundation::POINT, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::SetPixelLocationRaw( + this, + core::mem::transmute(&pixellocationraw), + ) + .into() + } + } + unsafe extern "system" fn HimetricLocationRaw< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + himetriclocationraw: *mut windows::Win32::Foundation::POINT, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::HimetricLocationRaw( + this, + core::mem::transmute_copy(&himetriclocationraw), + ) + .into() + } + } + unsafe extern "system" fn SetHimetricLocationRaw< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + himetriclocationraw: windows::Win32::Foundation::POINT, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::SetHimetricLocationRaw( + this, + core::mem::transmute(&himetriclocationraw), + ) + .into() + } + } + unsafe extern "system" fn Time< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + time: *mut u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::Time(this, core::mem::transmute_copy(&time)).into() + } + } + unsafe extern "system" fn SetTime< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + time: u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::SetTime(this, core::mem::transmute_copy(&time)) + .into() + } + } + unsafe extern "system" fn HistoryCount< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + historycount: *mut u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::HistoryCount( + this, + core::mem::transmute_copy(&historycount), + ) + .into() + } + } + unsafe extern "system" fn SetHistoryCount< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + historycount: u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::SetHistoryCount( + this, + core::mem::transmute_copy(&historycount), + ) + .into() + } + } + unsafe extern "system" fn InputData< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + inputdata: *mut i32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::InputData( + this, + core::mem::transmute_copy(&inputdata), + ) + .into() + } + } + unsafe extern "system" fn SetInputData< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + inputdata: i32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::SetInputData( + this, + core::mem::transmute_copy(&inputdata), + ) + .into() + } + } + unsafe extern "system" fn KeyStates< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + keystates: *mut u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::KeyStates( + this, + core::mem::transmute_copy(&keystates), + ) + .into() + } + } + unsafe extern "system" fn SetKeyStates< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + keystates: u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::SetKeyStates( + this, + core::mem::transmute_copy(&keystates), + ) + .into() + } + } + unsafe extern "system" fn PerformanceCount< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + performancecount: *mut u64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::PerformanceCount( + this, + core::mem::transmute_copy(&performancecount), + ) + .into() + } + } + unsafe extern "system" fn SetPerformanceCount< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + performancecount: u64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::SetPerformanceCount( + this, + core::mem::transmute_copy(&performancecount), + ) + .into() + } + } + unsafe extern "system" fn ButtonChangeKind< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + buttonchangekind: *mut i32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::ButtonChangeKind( + this, + core::mem::transmute_copy(&buttonchangekind), + ) + .into() + } + } + unsafe extern "system" fn SetButtonChangeKind< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + buttonchangekind: i32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::SetButtonChangeKind( + this, + core::mem::transmute_copy(&buttonchangekind), + ) + .into() + } + } + unsafe extern "system" fn PenFlags< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + penflags: *mut u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::PenFlags(this, core::mem::transmute_copy(&penflags)) + .into() + } + } + unsafe extern "system" fn SetPenFlags< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + penflags: u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::SetPenFlags( + this, + core::mem::transmute_copy(&penflags), + ) + .into() + } + } + unsafe extern "system" fn PenMask< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + penmask: *mut u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::PenMask(this, core::mem::transmute_copy(&penmask)) + .into() + } + } + unsafe extern "system" fn SetPenMask< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + penmask: u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::SetPenMask(this, core::mem::transmute_copy(&penmask)) + .into() + } + } + unsafe extern "system" fn PenPressure< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + penpressure: *mut u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::PenPressure( + this, + core::mem::transmute_copy(&penpressure), + ) + .into() + } + } + unsafe extern "system" fn SetPenPressure< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + penpressure: u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::SetPenPressure( + this, + core::mem::transmute_copy(&penpressure), + ) + .into() + } + } + unsafe extern "system" fn PenRotation< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + penrotation: *mut u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::PenRotation( + this, + core::mem::transmute_copy(&penrotation), + ) + .into() + } + } + unsafe extern "system" fn SetPenRotation< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + penrotation: u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::SetPenRotation( + this, + core::mem::transmute_copy(&penrotation), + ) + .into() + } + } + unsafe extern "system" fn PenTiltX< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + pentiltx: *mut i32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::PenTiltX(this, core::mem::transmute_copy(&pentiltx)) + .into() + } + } + unsafe extern "system" fn SetPenTiltX< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + pentiltx: i32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::SetPenTiltX( + this, + core::mem::transmute_copy(&pentiltx), + ) + .into() + } + } + unsafe extern "system" fn PenTiltY< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + pentilty: *mut i32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::PenTiltY(this, core::mem::transmute_copy(&pentilty)) + .into() + } + } + unsafe extern "system" fn SetPenTiltY< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + pentilty: i32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::SetPenTiltY( + this, + core::mem::transmute_copy(&pentilty), + ) + .into() + } + } + unsafe extern "system" fn TouchFlags< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + touchflags: *mut u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::TouchFlags( + this, + core::mem::transmute_copy(&touchflags), + ) + .into() + } + } + unsafe extern "system" fn SetTouchFlags< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + touchflags: u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::SetTouchFlags( + this, + core::mem::transmute_copy(&touchflags), + ) + .into() + } + } + unsafe extern "system" fn TouchMask< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + touchmask: *mut u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::TouchMask( + this, + core::mem::transmute_copy(&touchmask), + ) + .into() + } + } + unsafe extern "system" fn SetTouchMask< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + touchmask: u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::SetTouchMask( + this, + core::mem::transmute_copy(&touchmask), + ) + .into() + } + } + unsafe extern "system" fn TouchContact< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + touchcontact: *mut windows::Win32::Foundation::RECT, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::TouchContact( + this, + core::mem::transmute_copy(&touchcontact), + ) + .into() + } + } + unsafe extern "system" fn SetTouchContact< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + touchcontact: windows::Win32::Foundation::RECT, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::SetTouchContact( + this, + core::mem::transmute(&touchcontact), + ) + .into() + } + } + unsafe extern "system" fn TouchContactRaw< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + touchcontactraw: *mut windows::Win32::Foundation::RECT, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::TouchContactRaw( + this, + core::mem::transmute_copy(&touchcontactraw), + ) + .into() + } + } + unsafe extern "system" fn SetTouchContactRaw< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + touchcontactraw: windows::Win32::Foundation::RECT, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::SetTouchContactRaw( + this, + core::mem::transmute(&touchcontactraw), + ) + .into() + } + } + unsafe extern "system" fn TouchOrientation< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + touchorientation: *mut u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::TouchOrientation( + this, + core::mem::transmute_copy(&touchorientation), + ) + .into() + } + } + unsafe extern "system" fn SetTouchOrientation< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + touchorientation: u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::SetTouchOrientation( + this, + core::mem::transmute_copy(&touchorientation), + ) + .into() + } + } + unsafe extern "system" fn TouchPressure< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + touchpressure: *mut u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::TouchPressure( + this, + core::mem::transmute_copy(&touchpressure), + ) + .into() + } + } + unsafe extern "system" fn SetTouchPressure< + Identity: ICoreWebView2PointerInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + touchpressure: u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PointerInfo_Impl::SetTouchPressure( + this, + core::mem::transmute_copy(&touchpressure), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + PointerKind: PointerKind::, + SetPointerKind: SetPointerKind::, + PointerId: PointerId::, + SetPointerId: SetPointerId::, + FrameId: FrameId::, + SetFrameId: SetFrameId::, + PointerFlags: PointerFlags::, + SetPointerFlags: SetPointerFlags::, + PointerDeviceRect: PointerDeviceRect::, + SetPointerDeviceRect: SetPointerDeviceRect::, + DisplayRect: DisplayRect::, + SetDisplayRect: SetDisplayRect::, + PixelLocation: PixelLocation::, + SetPixelLocation: SetPixelLocation::, + HimetricLocation: HimetricLocation::, + SetHimetricLocation: SetHimetricLocation::, + PixelLocationRaw: PixelLocationRaw::, + SetPixelLocationRaw: SetPixelLocationRaw::, + HimetricLocationRaw: HimetricLocationRaw::, + SetHimetricLocationRaw: SetHimetricLocationRaw::, + Time: Time::, + SetTime: SetTime::, + HistoryCount: HistoryCount::, + SetHistoryCount: SetHistoryCount::, + InputData: InputData::, + SetInputData: SetInputData::, + KeyStates: KeyStates::, + SetKeyStates: SetKeyStates::, + PerformanceCount: PerformanceCount::, + SetPerformanceCount: SetPerformanceCount::, + ButtonChangeKind: ButtonChangeKind::, + SetButtonChangeKind: SetButtonChangeKind::, + PenFlags: PenFlags::, + SetPenFlags: SetPenFlags::, + PenMask: PenMask::, + SetPenMask: SetPenMask::, + PenPressure: PenPressure::, + SetPenPressure: SetPenPressure::, + PenRotation: PenRotation::, + SetPenRotation: SetPenRotation::, + PenTiltX: PenTiltX::, + SetPenTiltX: SetPenTiltX::, + PenTiltY: PenTiltY::, + SetPenTiltY: SetPenTiltY::, + TouchFlags: TouchFlags::, + SetTouchFlags: SetTouchFlags::, + TouchMask: TouchMask::, + SetTouchMask: SetTouchMask::, + TouchContact: TouchContact::, + SetTouchContact: SetTouchContact::, + TouchContactRaw: TouchContactRaw::, + SetTouchContactRaw: SetTouchContactRaw::, + TouchOrientation: TouchOrientation::, + SetTouchOrientation: SetTouchOrientation::, + TouchPressure: TouchPressure::, + SetTouchPressure: SetTouchPressure::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2PointerInfo {} +windows_core::imp::define_interface!( + ICoreWebView2PrintCompletedHandler, + ICoreWebView2PrintCompletedHandler_Vtbl, + 0x8fd80075_ed08_42db_8570_f5d14977461e +); +windows_core::imp::interface_hierarchy!(ICoreWebView2PrintCompletedHandler, windows_core::IUnknown); +impl ICoreWebView2PrintCompletedHandler { + pub unsafe fn Invoke( + &self, + errorcode: windows_core::HRESULT, + result: COREWEBVIEW2_PRINT_STATUS, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + errorcode, + result, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2PrintCompletedHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::HRESULT, + COREWEBVIEW2_PRINT_STATUS, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2PrintCompletedHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + errorcode: windows_core::HRESULT, + result: COREWEBVIEW2_PRINT_STATUS, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2PrintCompletedHandler_Vtbl { + pub const fn new( + ) -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2PrintCompletedHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + errorcode: windows_core::HRESULT, + result: COREWEBVIEW2_PRINT_STATUS, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintCompletedHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&errorcode), + core::mem::transmute_copy(&result), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2PrintCompletedHandler {} +windows_core::imp::define_interface!( + ICoreWebView2PrintSettings, + ICoreWebView2PrintSettings_Vtbl, + 0x377f3721_c74e_48ca_8db1_df68e51d60e2 +); +windows_core::imp::interface_hierarchy!(ICoreWebView2PrintSettings, windows_core::IUnknown); +impl ICoreWebView2PrintSettings { + pub unsafe fn Orientation( + &self, + orientation: *mut COREWEBVIEW2_PRINT_ORIENTATION, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Orientation)( + windows_core::Interface::as_raw(self), + orientation as _, + ) + .ok() + } + } + pub unsafe fn SetOrientation( + &self, + orientation: COREWEBVIEW2_PRINT_ORIENTATION, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetOrientation)( + windows_core::Interface::as_raw(self), + orientation, + ) + .ok() + } + } + pub unsafe fn ScaleFactor(&self, scalefactor: *mut f64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ScaleFactor)( + windows_core::Interface::as_raw(self), + scalefactor as _, + ) + .ok() + } + } + pub unsafe fn SetScaleFactor(&self, scalefactor: f64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetScaleFactor)( + windows_core::Interface::as_raw(self), + scalefactor, + ) + .ok() + } + } + pub unsafe fn PageWidth(&self, pagewidth: *mut f64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).PageWidth)( + windows_core::Interface::as_raw(self), + pagewidth as _, + ) + .ok() + } + } + pub unsafe fn SetPageWidth(&self, pagewidth: f64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetPageWidth)( + windows_core::Interface::as_raw(self), + pagewidth, + ) + .ok() + } + } + pub unsafe fn PageHeight(&self, pageheight: *mut f64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).PageHeight)( + windows_core::Interface::as_raw(self), + pageheight as _, + ) + .ok() + } + } + pub unsafe fn SetPageHeight(&self, pageheight: f64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetPageHeight)( + windows_core::Interface::as_raw(self), + pageheight, + ) + .ok() + } + } + pub unsafe fn MarginTop(&self, margintop: *mut f64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).MarginTop)( + windows_core::Interface::as_raw(self), + margintop as _, + ) + .ok() + } + } + pub unsafe fn SetMarginTop(&self, margintop: f64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetMarginTop)( + windows_core::Interface::as_raw(self), + margintop, + ) + .ok() + } + } + pub unsafe fn MarginBottom(&self, marginbottom: *mut f64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).MarginBottom)( + windows_core::Interface::as_raw(self), + marginbottom as _, + ) + .ok() + } + } + pub unsafe fn SetMarginBottom(&self, marginbottom: f64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetMarginBottom)( + windows_core::Interface::as_raw(self), + marginbottom, + ) + .ok() + } + } + pub unsafe fn MarginLeft(&self, marginleft: *mut f64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).MarginLeft)( + windows_core::Interface::as_raw(self), + marginleft as _, + ) + .ok() + } + } + pub unsafe fn SetMarginLeft(&self, marginleft: f64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetMarginLeft)( + windows_core::Interface::as_raw(self), + marginleft, + ) + .ok() + } + } + pub unsafe fn MarginRight(&self, marginright: *mut f64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).MarginRight)( + windows_core::Interface::as_raw(self), + marginright as _, + ) + .ok() + } + } + pub unsafe fn SetMarginRight(&self, marginright: f64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetMarginRight)( + windows_core::Interface::as_raw(self), + marginright, + ) + .ok() + } + } + pub unsafe fn ShouldPrintBackgrounds( + &self, + shouldprintbackgrounds: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ShouldPrintBackgrounds)( + windows_core::Interface::as_raw(self), + shouldprintbackgrounds as _, + ) + .ok() + } + } + pub unsafe fn SetShouldPrintBackgrounds( + &self, + shouldprintbackgrounds: bool, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetShouldPrintBackgrounds)( + windows_core::Interface::as_raw(self), + shouldprintbackgrounds.into(), + ) + .ok() + } + } + pub unsafe fn ShouldPrintSelectionOnly( + &self, + shouldprintselectiononly: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ShouldPrintSelectionOnly)( + windows_core::Interface::as_raw(self), + shouldprintselectiononly as _, + ) + .ok() + } + } + pub unsafe fn SetShouldPrintSelectionOnly( + &self, + shouldprintselectiononly: bool, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetShouldPrintSelectionOnly)( + windows_core::Interface::as_raw(self), + shouldprintselectiononly.into(), + ) + .ok() + } + } + pub unsafe fn ShouldPrintHeaderAndFooter( + &self, + shouldprintheaderandfooter: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ShouldPrintHeaderAndFooter)( + windows_core::Interface::as_raw(self), + shouldprintheaderandfooter as _, + ) + .ok() + } + } + pub unsafe fn SetShouldPrintHeaderAndFooter( + &self, + shouldprintheaderandfooter: bool, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetShouldPrintHeaderAndFooter)( + windows_core::Interface::as_raw(self), + shouldprintheaderandfooter.into(), + ) + .ok() + } + } + pub unsafe fn HeaderTitle( + &self, + headertitle: *mut windows_core::PWSTR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).HeaderTitle)( + windows_core::Interface::as_raw(self), + headertitle as _, + ) + .ok() + } + } + pub unsafe fn SetHeaderTitle(&self, headertitle: P0) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).SetHeaderTitle)( + windows_core::Interface::as_raw(self), + headertitle.param().abi(), + ) + .ok() + } + } + pub unsafe fn FooterUri( + &self, + footeruri: *mut windows_core::PWSTR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).FooterUri)( + windows_core::Interface::as_raw(self), + footeruri as _, + ) + .ok() + } + } + pub unsafe fn SetFooterUri(&self, footeruri: P0) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).SetFooterUri)( + windows_core::Interface::as_raw(self), + footeruri.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2PrintSettings_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Orientation: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_PRINT_ORIENTATION, + ) -> windows_core::HRESULT, + pub SetOrientation: unsafe extern "system" fn( + *mut core::ffi::c_void, + COREWEBVIEW2_PRINT_ORIENTATION, + ) -> windows_core::HRESULT, + pub ScaleFactor: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut f64) -> windows_core::HRESULT, + pub SetScaleFactor: + unsafe extern "system" fn(*mut core::ffi::c_void, f64) -> windows_core::HRESULT, + pub PageWidth: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut f64) -> windows_core::HRESULT, + pub SetPageWidth: + unsafe extern "system" fn(*mut core::ffi::c_void, f64) -> windows_core::HRESULT, + pub PageHeight: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut f64) -> windows_core::HRESULT, + pub SetPageHeight: + unsafe extern "system" fn(*mut core::ffi::c_void, f64) -> windows_core::HRESULT, + pub MarginTop: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut f64) -> windows_core::HRESULT, + pub SetMarginTop: + unsafe extern "system" fn(*mut core::ffi::c_void, f64) -> windows_core::HRESULT, + pub MarginBottom: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut f64) -> windows_core::HRESULT, + pub SetMarginBottom: + unsafe extern "system" fn(*mut core::ffi::c_void, f64) -> windows_core::HRESULT, + pub MarginLeft: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut f64) -> windows_core::HRESULT, + pub SetMarginLeft: + unsafe extern "system" fn(*mut core::ffi::c_void, f64) -> windows_core::HRESULT, + pub MarginRight: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut f64) -> windows_core::HRESULT, + pub SetMarginRight: + unsafe extern "system" fn(*mut core::ffi::c_void, f64) -> windows_core::HRESULT, + pub ShouldPrintBackgrounds: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetShouldPrintBackgrounds: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, + pub ShouldPrintSelectionOnly: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetShouldPrintSelectionOnly: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, + pub ShouldPrintHeaderAndFooter: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetShouldPrintHeaderAndFooter: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, + pub HeaderTitle: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub SetHeaderTitle: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + ) -> windows_core::HRESULT, + pub FooterUri: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub SetFooterUri: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2PrintSettings_Impl: windows_core::IUnknownImpl { + fn Orientation( + &self, + orientation: *mut COREWEBVIEW2_PRINT_ORIENTATION, + ) -> windows_core::Result<()>; + fn SetOrientation( + &self, + orientation: COREWEBVIEW2_PRINT_ORIENTATION, + ) -> windows_core::Result<()>; + fn ScaleFactor(&self, scalefactor: *mut f64) -> windows_core::Result<()>; + fn SetScaleFactor(&self, scalefactor: f64) -> windows_core::Result<()>; + fn PageWidth(&self, pagewidth: *mut f64) -> windows_core::Result<()>; + fn SetPageWidth(&self, pagewidth: f64) -> windows_core::Result<()>; + fn PageHeight(&self, pageheight: *mut f64) -> windows_core::Result<()>; + fn SetPageHeight(&self, pageheight: f64) -> windows_core::Result<()>; + fn MarginTop(&self, margintop: *mut f64) -> windows_core::Result<()>; + fn SetMarginTop(&self, margintop: f64) -> windows_core::Result<()>; + fn MarginBottom(&self, marginbottom: *mut f64) -> windows_core::Result<()>; + fn SetMarginBottom(&self, marginbottom: f64) -> windows_core::Result<()>; + fn MarginLeft(&self, marginleft: *mut f64) -> windows_core::Result<()>; + fn SetMarginLeft(&self, marginleft: f64) -> windows_core::Result<()>; + fn MarginRight(&self, marginright: *mut f64) -> windows_core::Result<()>; + fn SetMarginRight(&self, marginright: f64) -> windows_core::Result<()>; + fn ShouldPrintBackgrounds( + &self, + shouldprintbackgrounds: *mut windows_core::BOOL, + ) -> windows_core::Result<()>; + fn SetShouldPrintBackgrounds( + &self, + shouldprintbackgrounds: windows_core::BOOL, + ) -> windows_core::Result<()>; + fn ShouldPrintSelectionOnly( + &self, + shouldprintselectiononly: *mut windows_core::BOOL, + ) -> windows_core::Result<()>; + fn SetShouldPrintSelectionOnly( + &self, + shouldprintselectiononly: windows_core::BOOL, + ) -> windows_core::Result<()>; + fn ShouldPrintHeaderAndFooter( + &self, + shouldprintheaderandfooter: *mut windows_core::BOOL, + ) -> windows_core::Result<()>; + fn SetShouldPrintHeaderAndFooter( + &self, + shouldprintheaderandfooter: windows_core::BOOL, + ) -> windows_core::Result<()>; + fn HeaderTitle(&self, headertitle: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn SetHeaderTitle(&self, headertitle: &windows_core::PCWSTR) -> windows_core::Result<()>; + fn FooterUri(&self, footeruri: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn SetFooterUri(&self, footeruri: &windows_core::PCWSTR) -> windows_core::Result<()>; +} +impl ICoreWebView2PrintSettings_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn Orientation< + Identity: ICoreWebView2PrintSettings_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + orientation: *mut COREWEBVIEW2_PRINT_ORIENTATION, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintSettings_Impl::Orientation( + this, + core::mem::transmute_copy(&orientation), + ) + .into() + } + } + unsafe extern "system" fn SetOrientation< + Identity: ICoreWebView2PrintSettings_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + orientation: COREWEBVIEW2_PRINT_ORIENTATION, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintSettings_Impl::SetOrientation( + this, + core::mem::transmute_copy(&orientation), + ) + .into() + } + } + unsafe extern "system" fn ScaleFactor< + Identity: ICoreWebView2PrintSettings_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + scalefactor: *mut f64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintSettings_Impl::ScaleFactor( + this, + core::mem::transmute_copy(&scalefactor), + ) + .into() + } + } + unsafe extern "system" fn SetScaleFactor< + Identity: ICoreWebView2PrintSettings_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + scalefactor: f64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintSettings_Impl::SetScaleFactor( + this, + core::mem::transmute_copy(&scalefactor), + ) + .into() + } + } + unsafe extern "system" fn PageWidth< + Identity: ICoreWebView2PrintSettings_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + pagewidth: *mut f64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintSettings_Impl::PageWidth( + this, + core::mem::transmute_copy(&pagewidth), + ) + .into() + } + } + unsafe extern "system" fn SetPageWidth< + Identity: ICoreWebView2PrintSettings_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + pagewidth: f64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintSettings_Impl::SetPageWidth( + this, + core::mem::transmute_copy(&pagewidth), + ) + .into() + } + } + unsafe extern "system" fn PageHeight< + Identity: ICoreWebView2PrintSettings_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + pageheight: *mut f64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintSettings_Impl::PageHeight( + this, + core::mem::transmute_copy(&pageheight), + ) + .into() + } + } + unsafe extern "system" fn SetPageHeight< + Identity: ICoreWebView2PrintSettings_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + pageheight: f64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintSettings_Impl::SetPageHeight( + this, + core::mem::transmute_copy(&pageheight), + ) + .into() + } + } + unsafe extern "system" fn MarginTop< + Identity: ICoreWebView2PrintSettings_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + margintop: *mut f64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintSettings_Impl::MarginTop( + this, + core::mem::transmute_copy(&margintop), + ) + .into() + } + } + unsafe extern "system" fn SetMarginTop< + Identity: ICoreWebView2PrintSettings_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + margintop: f64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintSettings_Impl::SetMarginTop( + this, + core::mem::transmute_copy(&margintop), + ) + .into() + } + } + unsafe extern "system" fn MarginBottom< + Identity: ICoreWebView2PrintSettings_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + marginbottom: *mut f64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintSettings_Impl::MarginBottom( + this, + core::mem::transmute_copy(&marginbottom), + ) + .into() + } + } + unsafe extern "system" fn SetMarginBottom< + Identity: ICoreWebView2PrintSettings_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + marginbottom: f64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintSettings_Impl::SetMarginBottom( + this, + core::mem::transmute_copy(&marginbottom), + ) + .into() + } + } + unsafe extern "system" fn MarginLeft< + Identity: ICoreWebView2PrintSettings_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + marginleft: *mut f64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintSettings_Impl::MarginLeft( + this, + core::mem::transmute_copy(&marginleft), + ) + .into() + } + } + unsafe extern "system" fn SetMarginLeft< + Identity: ICoreWebView2PrintSettings_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + marginleft: f64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintSettings_Impl::SetMarginLeft( + this, + core::mem::transmute_copy(&marginleft), + ) + .into() + } + } + unsafe extern "system" fn MarginRight< + Identity: ICoreWebView2PrintSettings_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + marginright: *mut f64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintSettings_Impl::MarginRight( + this, + core::mem::transmute_copy(&marginright), + ) + .into() + } + } + unsafe extern "system" fn SetMarginRight< + Identity: ICoreWebView2PrintSettings_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + marginright: f64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintSettings_Impl::SetMarginRight( + this, + core::mem::transmute_copy(&marginright), + ) + .into() + } + } + unsafe extern "system" fn ShouldPrintBackgrounds< + Identity: ICoreWebView2PrintSettings_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + shouldprintbackgrounds: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintSettings_Impl::ShouldPrintBackgrounds( + this, + core::mem::transmute_copy(&shouldprintbackgrounds), + ) + .into() + } + } + unsafe extern "system" fn SetShouldPrintBackgrounds< + Identity: ICoreWebView2PrintSettings_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + shouldprintbackgrounds: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintSettings_Impl::SetShouldPrintBackgrounds( + this, + core::mem::transmute_copy(&shouldprintbackgrounds), + ) + .into() + } + } + unsafe extern "system" fn ShouldPrintSelectionOnly< + Identity: ICoreWebView2PrintSettings_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + shouldprintselectiononly: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintSettings_Impl::ShouldPrintSelectionOnly( + this, + core::mem::transmute_copy(&shouldprintselectiononly), + ) + .into() + } + } + unsafe extern "system" fn SetShouldPrintSelectionOnly< + Identity: ICoreWebView2PrintSettings_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + shouldprintselectiononly: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintSettings_Impl::SetShouldPrintSelectionOnly( + this, + core::mem::transmute_copy(&shouldprintselectiononly), + ) + .into() + } + } + unsafe extern "system" fn ShouldPrintHeaderAndFooter< + Identity: ICoreWebView2PrintSettings_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + shouldprintheaderandfooter: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintSettings_Impl::ShouldPrintHeaderAndFooter( + this, + core::mem::transmute_copy(&shouldprintheaderandfooter), + ) + .into() + } + } + unsafe extern "system" fn SetShouldPrintHeaderAndFooter< + Identity: ICoreWebView2PrintSettings_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + shouldprintheaderandfooter: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintSettings_Impl::SetShouldPrintHeaderAndFooter( + this, + core::mem::transmute_copy(&shouldprintheaderandfooter), + ) + .into() + } + } + unsafe extern "system" fn HeaderTitle< + Identity: ICoreWebView2PrintSettings_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + headertitle: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintSettings_Impl::HeaderTitle( + this, + core::mem::transmute_copy(&headertitle), + ) + .into() + } + } + unsafe extern "system" fn SetHeaderTitle< + Identity: ICoreWebView2PrintSettings_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + headertitle: windows_core::PCWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintSettings_Impl::SetHeaderTitle( + this, + core::mem::transmute(&headertitle), + ) + .into() + } + } + unsafe extern "system" fn FooterUri< + Identity: ICoreWebView2PrintSettings_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + footeruri: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintSettings_Impl::FooterUri( + this, + core::mem::transmute_copy(&footeruri), + ) + .into() + } + } + unsafe extern "system" fn SetFooterUri< + Identity: ICoreWebView2PrintSettings_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + footeruri: windows_core::PCWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintSettings_Impl::SetFooterUri( + this, + core::mem::transmute(&footeruri), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Orientation: Orientation::, + SetOrientation: SetOrientation::, + ScaleFactor: ScaleFactor::, + SetScaleFactor: SetScaleFactor::, + PageWidth: PageWidth::, + SetPageWidth: SetPageWidth::, + PageHeight: PageHeight::, + SetPageHeight: SetPageHeight::, + MarginTop: MarginTop::, + SetMarginTop: SetMarginTop::, + MarginBottom: MarginBottom::, + SetMarginBottom: SetMarginBottom::, + MarginLeft: MarginLeft::, + SetMarginLeft: SetMarginLeft::, + MarginRight: MarginRight::, + SetMarginRight: SetMarginRight::, + ShouldPrintBackgrounds: ShouldPrintBackgrounds::, + SetShouldPrintBackgrounds: SetShouldPrintBackgrounds::, + ShouldPrintSelectionOnly: ShouldPrintSelectionOnly::, + SetShouldPrintSelectionOnly: SetShouldPrintSelectionOnly::, + ShouldPrintHeaderAndFooter: ShouldPrintHeaderAndFooter::, + SetShouldPrintHeaderAndFooter: SetShouldPrintHeaderAndFooter::, + HeaderTitle: HeaderTitle::, + SetHeaderTitle: SetHeaderTitle::, + FooterUri: FooterUri::, + SetFooterUri: SetFooterUri::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2PrintSettings {} +windows_core::imp::define_interface!( + ICoreWebView2PrintSettings2, + ICoreWebView2PrintSettings2_Vtbl, + 0xca7f0e1f_3484_41d1_8c1a_65cd44a63f8d +); +impl core::ops::Deref for ICoreWebView2PrintSettings2 { + type Target = ICoreWebView2PrintSettings; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2PrintSettings2, + windows_core::IUnknown, + ICoreWebView2PrintSettings +); +impl ICoreWebView2PrintSettings2 { + pub unsafe fn PageRanges(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).PageRanges)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetPageRanges(&self, value: P0) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).SetPageRanges)( + windows_core::Interface::as_raw(self), + value.param().abi(), + ) + .ok() + } + } + pub unsafe fn PagesPerSide(&self, value: *mut i32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).PagesPerSide)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetPagesPerSide(&self, value: i32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetPagesPerSide)( + windows_core::Interface::as_raw(self), + value, + ) + .ok() + } + } + pub unsafe fn Copies(&self, value: *mut i32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Copies)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetCopies(&self, value: i32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetCopies)( + windows_core::Interface::as_raw(self), + value, + ) + .ok() + } + } + pub unsafe fn Collation( + &self, + value: *mut COREWEBVIEW2_PRINT_COLLATION, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Collation)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetCollation( + &self, + value: COREWEBVIEW2_PRINT_COLLATION, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetCollation)( + windows_core::Interface::as_raw(self), + value, + ) + .ok() + } + } + pub unsafe fn ColorMode( + &self, + value: *mut COREWEBVIEW2_PRINT_COLOR_MODE, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ColorMode)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetColorMode( + &self, + value: COREWEBVIEW2_PRINT_COLOR_MODE, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetColorMode)( + windows_core::Interface::as_raw(self), + value, + ) + .ok() + } + } + pub unsafe fn Duplex(&self, value: *mut COREWEBVIEW2_PRINT_DUPLEX) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Duplex)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetDuplex(&self, value: COREWEBVIEW2_PRINT_DUPLEX) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetDuplex)( + windows_core::Interface::as_raw(self), + value, + ) + .ok() + } + } + pub unsafe fn MediaSize( + &self, + value: *mut COREWEBVIEW2_PRINT_MEDIA_SIZE, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).MediaSize)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetMediaSize( + &self, + value: COREWEBVIEW2_PRINT_MEDIA_SIZE, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetMediaSize)( + windows_core::Interface::as_raw(self), + value, + ) + .ok() + } + } + pub unsafe fn PrinterName(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).PrinterName)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetPrinterName(&self, value: P0) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).SetPrinterName)( + windows_core::Interface::as_raw(self), + value.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2PrintSettings2_Vtbl { + pub base__: ICoreWebView2PrintSettings_Vtbl, + pub PageRanges: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub SetPageRanges: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + ) -> windows_core::HRESULT, + pub PagesPerSide: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut i32) -> windows_core::HRESULT, + pub SetPagesPerSide: + unsafe extern "system" fn(*mut core::ffi::c_void, i32) -> windows_core::HRESULT, + pub Copies: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut i32) -> windows_core::HRESULT, + pub SetCopies: unsafe extern "system" fn(*mut core::ffi::c_void, i32) -> windows_core::HRESULT, + pub Collation: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_PRINT_COLLATION, + ) -> windows_core::HRESULT, + pub SetCollation: unsafe extern "system" fn( + *mut core::ffi::c_void, + COREWEBVIEW2_PRINT_COLLATION, + ) -> windows_core::HRESULT, + pub ColorMode: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_PRINT_COLOR_MODE, + ) -> windows_core::HRESULT, + pub SetColorMode: unsafe extern "system" fn( + *mut core::ffi::c_void, + COREWEBVIEW2_PRINT_COLOR_MODE, + ) -> windows_core::HRESULT, + pub Duplex: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_PRINT_DUPLEX, + ) -> windows_core::HRESULT, + pub SetDuplex: unsafe extern "system" fn( + *mut core::ffi::c_void, + COREWEBVIEW2_PRINT_DUPLEX, + ) -> windows_core::HRESULT, + pub MediaSize: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_PRINT_MEDIA_SIZE, + ) -> windows_core::HRESULT, + pub SetMediaSize: unsafe extern "system" fn( + *mut core::ffi::c_void, + COREWEBVIEW2_PRINT_MEDIA_SIZE, + ) -> windows_core::HRESULT, + pub PrinterName: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub SetPrinterName: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2PrintSettings2_Impl: ICoreWebView2PrintSettings_Impl { + fn PageRanges(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn SetPageRanges(&self, value: &windows_core::PCWSTR) -> windows_core::Result<()>; + fn PagesPerSide(&self, value: *mut i32) -> windows_core::Result<()>; + fn SetPagesPerSide(&self, value: i32) -> windows_core::Result<()>; + fn Copies(&self, value: *mut i32) -> windows_core::Result<()>; + fn SetCopies(&self, value: i32) -> windows_core::Result<()>; + fn Collation(&self, value: *mut COREWEBVIEW2_PRINT_COLLATION) -> windows_core::Result<()>; + fn SetCollation(&self, value: COREWEBVIEW2_PRINT_COLLATION) -> windows_core::Result<()>; + fn ColorMode(&self, value: *mut COREWEBVIEW2_PRINT_COLOR_MODE) -> windows_core::Result<()>; + fn SetColorMode(&self, value: COREWEBVIEW2_PRINT_COLOR_MODE) -> windows_core::Result<()>; + fn Duplex(&self, value: *mut COREWEBVIEW2_PRINT_DUPLEX) -> windows_core::Result<()>; + fn SetDuplex(&self, value: COREWEBVIEW2_PRINT_DUPLEX) -> windows_core::Result<()>; + fn MediaSize(&self, value: *mut COREWEBVIEW2_PRINT_MEDIA_SIZE) -> windows_core::Result<()>; + fn SetMediaSize(&self, value: COREWEBVIEW2_PRINT_MEDIA_SIZE) -> windows_core::Result<()>; + fn PrinterName(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn SetPrinterName(&self, value: &windows_core::PCWSTR) -> windows_core::Result<()>; +} +impl ICoreWebView2PrintSettings2_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn PageRanges< + Identity: ICoreWebView2PrintSettings2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintSettings2_Impl::PageRanges( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetPageRanges< + Identity: ICoreWebView2PrintSettings2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::PCWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintSettings2_Impl::SetPageRanges(this, core::mem::transmute(&value)) + .into() + } + } + unsafe extern "system" fn PagesPerSide< + Identity: ICoreWebView2PrintSettings2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut i32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintSettings2_Impl::PagesPerSide( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetPagesPerSide< + Identity: ICoreWebView2PrintSettings2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: i32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintSettings2_Impl::SetPagesPerSide( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn Copies< + Identity: ICoreWebView2PrintSettings2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut i32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintSettings2_Impl::Copies(this, core::mem::transmute_copy(&value)) + .into() + } + } + unsafe extern "system" fn SetCopies< + Identity: ICoreWebView2PrintSettings2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: i32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintSettings2_Impl::SetCopies(this, core::mem::transmute_copy(&value)) + .into() + } + } + unsafe extern "system" fn Collation< + Identity: ICoreWebView2PrintSettings2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut COREWEBVIEW2_PRINT_COLLATION, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintSettings2_Impl::Collation(this, core::mem::transmute_copy(&value)) + .into() + } + } + unsafe extern "system" fn SetCollation< + Identity: ICoreWebView2PrintSettings2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: COREWEBVIEW2_PRINT_COLLATION, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintSettings2_Impl::SetCollation( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn ColorMode< + Identity: ICoreWebView2PrintSettings2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut COREWEBVIEW2_PRINT_COLOR_MODE, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintSettings2_Impl::ColorMode(this, core::mem::transmute_copy(&value)) + .into() + } + } + unsafe extern "system" fn SetColorMode< + Identity: ICoreWebView2PrintSettings2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: COREWEBVIEW2_PRINT_COLOR_MODE, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintSettings2_Impl::SetColorMode( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn Duplex< + Identity: ICoreWebView2PrintSettings2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut COREWEBVIEW2_PRINT_DUPLEX, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintSettings2_Impl::Duplex(this, core::mem::transmute_copy(&value)) + .into() + } + } + unsafe extern "system" fn SetDuplex< + Identity: ICoreWebView2PrintSettings2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: COREWEBVIEW2_PRINT_DUPLEX, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintSettings2_Impl::SetDuplex(this, core::mem::transmute_copy(&value)) + .into() + } + } + unsafe extern "system" fn MediaSize< + Identity: ICoreWebView2PrintSettings2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut COREWEBVIEW2_PRINT_MEDIA_SIZE, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintSettings2_Impl::MediaSize(this, core::mem::transmute_copy(&value)) + .into() + } + } + unsafe extern "system" fn SetMediaSize< + Identity: ICoreWebView2PrintSettings2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: COREWEBVIEW2_PRINT_MEDIA_SIZE, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintSettings2_Impl::SetMediaSize( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn PrinterName< + Identity: ICoreWebView2PrintSettings2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintSettings2_Impl::PrinterName( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetPrinterName< + Identity: ICoreWebView2PrintSettings2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::PCWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintSettings2_Impl::SetPrinterName(this, core::mem::transmute(&value)) + .into() + } + } + Self { + base__: ICoreWebView2PrintSettings_Vtbl::new::(), + PageRanges: PageRanges::, + SetPageRanges: SetPageRanges::, + PagesPerSide: PagesPerSide::, + SetPagesPerSide: SetPagesPerSide::, + Copies: Copies::, + SetCopies: SetCopies::, + Collation: Collation::, + SetCollation: SetCollation::, + ColorMode: ColorMode::, + SetColorMode: SetColorMode::, + Duplex: Duplex::, + SetDuplex: SetDuplex::, + MediaSize: MediaSize::, + SetMediaSize: SetMediaSize::, + PrinterName: PrinterName::, + SetPrinterName: SetPrinterName::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2PrintSettings2 {} +windows_core::imp::define_interface!( + ICoreWebView2PrintToPdfCompletedHandler, + ICoreWebView2PrintToPdfCompletedHandler_Vtbl, + 0xccf1ef04_fd8e_4d5f_b2de_0983e41b8c36 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2PrintToPdfCompletedHandler, + windows_core::IUnknown +); +impl ICoreWebView2PrintToPdfCompletedHandler { + pub unsafe fn Invoke( + &self, + errorcode: windows_core::HRESULT, + result: bool, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + errorcode, + result.into(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2PrintToPdfCompletedHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::HRESULT, + windows_core::BOOL, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2PrintToPdfCompletedHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + errorcode: windows_core::HRESULT, + result: windows_core::BOOL, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2PrintToPdfCompletedHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2PrintToPdfCompletedHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2PrintToPdfCompletedHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + errorcode: windows_core::HRESULT, + result: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintToPdfCompletedHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&errorcode), + core::mem::transmute_copy(&result), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2PrintToPdfCompletedHandler {} +windows_core::imp::define_interface!( + ICoreWebView2PrintToPdfStreamCompletedHandler, + ICoreWebView2PrintToPdfStreamCompletedHandler_Vtbl, + 0x4c9f8229_8f93_444f_a711_2c0dfd6359d5 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2PrintToPdfStreamCompletedHandler, + windows_core::IUnknown +); +impl ICoreWebView2PrintToPdfStreamCompletedHandler { + pub unsafe fn Invoke( + &self, + errorcode: windows_core::HRESULT, + result: P1, + ) -> windows_core::Result<()> + where + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + errorcode, + result.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2PrintToPdfStreamCompletedHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::HRESULT, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2PrintToPdfStreamCompletedHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + errorcode: windows_core::HRESULT, + result: windows_core::Ref<'_, windows::Win32::System::Com::IStream>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2PrintToPdfStreamCompletedHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2PrintToPdfStreamCompletedHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2PrintToPdfStreamCompletedHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + errorcode: windows_core::HRESULT, + result: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2PrintToPdfStreamCompletedHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&errorcode), + core::mem::transmute_copy(&result), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2PrintToPdfStreamCompletedHandler {} +windows_core::imp::define_interface!( + ICoreWebView2ProcessExtendedInfo, + ICoreWebView2ProcessExtendedInfo_Vtbl, + 0xaf4c4c2e_45db_11ee_be56_0242ac120002 +); +windows_core::imp::interface_hierarchy!(ICoreWebView2ProcessExtendedInfo, windows_core::IUnknown); +impl ICoreWebView2ProcessExtendedInfo { + pub unsafe fn ProcessInfo(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).ProcessInfo)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } + pub unsafe fn AssociatedFrameInfos( + &self, + ) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).AssociatedFrameInfos)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2ProcessExtendedInfo_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub ProcessInfo: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub AssociatedFrameInfos: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2ProcessExtendedInfo_Impl: windows_core::IUnknownImpl { + fn ProcessInfo(&self) -> windows_core::Result; + fn AssociatedFrameInfos(&self) -> windows_core::Result; +} +impl ICoreWebView2ProcessExtendedInfo_Vtbl { + pub const fn new() -> Self + { + unsafe extern "system" fn ProcessInfo< + Identity: ICoreWebView2ProcessExtendedInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + processinfo: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2ProcessExtendedInfo_Impl::ProcessInfo(this) { + Ok(ok__) => { + processinfo.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + unsafe extern "system" fn AssociatedFrameInfos< + Identity: ICoreWebView2ProcessExtendedInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + frames: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2ProcessExtendedInfo_Impl::AssociatedFrameInfos(this) { + Ok(ok__) => { + frames.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + ProcessInfo: ProcessInfo::, + AssociatedFrameInfos: AssociatedFrameInfos::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2ProcessExtendedInfo {} +windows_core::imp::define_interface!( + ICoreWebView2ProcessExtendedInfoCollection, + ICoreWebView2ProcessExtendedInfoCollection_Vtbl, + 0x32efa696_407a_11ee_be56_0242ac120002 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2ProcessExtendedInfoCollection, + windows_core::IUnknown +); +impl ICoreWebView2ProcessExtendedInfoCollection { + pub unsafe fn Count(&self, value: *mut u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Count)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn GetValueAtIndex( + &self, + index: u32, + ) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).GetValueAtIndex)( + windows_core::Interface::as_raw(self), + index, + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2ProcessExtendedInfoCollection_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Count: unsafe extern "system" fn(*mut core::ffi::c_void, *mut u32) -> windows_core::HRESULT, + pub GetValueAtIndex: unsafe extern "system" fn( + *mut core::ffi::c_void, + u32, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2ProcessExtendedInfoCollection_Impl: windows_core::IUnknownImpl { + fn Count(&self, value: *mut u32) -> windows_core::Result<()>; + fn GetValueAtIndex(&self, index: u32) + -> windows_core::Result; +} +impl ICoreWebView2ProcessExtendedInfoCollection_Vtbl { + pub const fn new< + Identity: ICoreWebView2ProcessExtendedInfoCollection_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Count< + Identity: ICoreWebView2ProcessExtendedInfoCollection_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ProcessExtendedInfoCollection_Impl::Count( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn GetValueAtIndex< + Identity: ICoreWebView2ProcessExtendedInfoCollection_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + index: u32, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2ProcessExtendedInfoCollection_Impl::GetValueAtIndex( + this, + core::mem::transmute_copy(&index), + ) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Count: Count::, + GetValueAtIndex: GetValueAtIndex::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2ProcessExtendedInfoCollection {} +windows_core::imp::define_interface!( + ICoreWebView2ProcessFailedEventArgs, + ICoreWebView2ProcessFailedEventArgs_Vtbl, + 0x8155a9a4_1474_4a86_8cae_151b0fa6b8ca +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2ProcessFailedEventArgs, + windows_core::IUnknown +); +impl ICoreWebView2ProcessFailedEventArgs { + pub unsafe fn ProcessFailedKind( + &self, + value: *mut COREWEBVIEW2_PROCESS_FAILED_KIND, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ProcessFailedKind)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2ProcessFailedEventArgs_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub ProcessFailedKind: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_PROCESS_FAILED_KIND, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2ProcessFailedEventArgs_Impl: windows_core::IUnknownImpl { + fn ProcessFailedKind( + &self, + value: *mut COREWEBVIEW2_PROCESS_FAILED_KIND, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2ProcessFailedEventArgs_Vtbl { + pub const fn new( + ) -> Self { + unsafe extern "system" fn ProcessFailedKind< + Identity: ICoreWebView2ProcessFailedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut COREWEBVIEW2_PROCESS_FAILED_KIND, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ProcessFailedEventArgs_Impl::ProcessFailedKind( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + ProcessFailedKind: ProcessFailedKind::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2ProcessFailedEventArgs {} +windows_core::imp::define_interface!( + ICoreWebView2ProcessFailedEventArgs2, + ICoreWebView2ProcessFailedEventArgs2_Vtbl, + 0x4dab9422_46fa_4c3e_a5d2_41d2071d3680 +); +impl core::ops::Deref for ICoreWebView2ProcessFailedEventArgs2 { + type Target = ICoreWebView2ProcessFailedEventArgs; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2ProcessFailedEventArgs2, + windows_core::IUnknown, + ICoreWebView2ProcessFailedEventArgs +); +impl ICoreWebView2ProcessFailedEventArgs2 { + pub unsafe fn Reason( + &self, + reason: *mut COREWEBVIEW2_PROCESS_FAILED_REASON, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Reason)( + windows_core::Interface::as_raw(self), + reason as _, + ) + .ok() + } + } + pub unsafe fn ExitCode(&self, exitcode: *mut i32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ExitCode)( + windows_core::Interface::as_raw(self), + exitcode as _, + ) + .ok() + } + } + pub unsafe fn ProcessDescription( + &self, + processdescription: *mut windows_core::PWSTR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ProcessDescription)( + windows_core::Interface::as_raw(self), + processdescription as _, + ) + .ok() + } + } + pub unsafe fn FrameInfosForFailedProcess( + &self, + ) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).FrameInfosForFailedProcess)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2ProcessFailedEventArgs2_Vtbl { + pub base__: ICoreWebView2ProcessFailedEventArgs_Vtbl, + pub Reason: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_PROCESS_FAILED_REASON, + ) -> windows_core::HRESULT, + pub ExitCode: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut i32) -> windows_core::HRESULT, + pub ProcessDescription: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub FrameInfosForFailedProcess: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2ProcessFailedEventArgs2_Impl: + ICoreWebView2ProcessFailedEventArgs_Impl +{ + fn Reason(&self, reason: *mut COREWEBVIEW2_PROCESS_FAILED_REASON) -> windows_core::Result<()>; + fn ExitCode(&self, exitcode: *mut i32) -> windows_core::Result<()>; + fn ProcessDescription( + &self, + processdescription: *mut windows_core::PWSTR, + ) -> windows_core::Result<()>; + fn FrameInfosForFailedProcess(&self) -> windows_core::Result; +} +impl ICoreWebView2ProcessFailedEventArgs2_Vtbl { + pub const fn new( + ) -> Self { + unsafe extern "system" fn Reason< + Identity: ICoreWebView2ProcessFailedEventArgs2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + reason: *mut COREWEBVIEW2_PROCESS_FAILED_REASON, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ProcessFailedEventArgs2_Impl::Reason( + this, + core::mem::transmute_copy(&reason), + ) + .into() + } + } + unsafe extern "system" fn ExitCode< + Identity: ICoreWebView2ProcessFailedEventArgs2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + exitcode: *mut i32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ProcessFailedEventArgs2_Impl::ExitCode( + this, + core::mem::transmute_copy(&exitcode), + ) + .into() + } + } + unsafe extern "system" fn ProcessDescription< + Identity: ICoreWebView2ProcessFailedEventArgs2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + processdescription: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ProcessFailedEventArgs2_Impl::ProcessDescription( + this, + core::mem::transmute_copy(&processdescription), + ) + .into() + } + } + unsafe extern "system" fn FrameInfosForFailedProcess< + Identity: ICoreWebView2ProcessFailedEventArgs2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + frames: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2ProcessFailedEventArgs2_Impl::FrameInfosForFailedProcess(this) { + Ok(ok__) => { + frames.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: ICoreWebView2ProcessFailedEventArgs_Vtbl::new::(), + Reason: Reason::, + ExitCode: ExitCode::, + ProcessDescription: ProcessDescription::, + FrameInfosForFailedProcess: FrameInfosForFailedProcess::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2ProcessFailedEventArgs2 {} +windows_core::imp::define_interface!( + ICoreWebView2ProcessFailedEventArgs3, + ICoreWebView2ProcessFailedEventArgs3_Vtbl, + 0xab667428_094d_5fd1_b480_8b4c0fdbdf2f +); +impl core::ops::Deref for ICoreWebView2ProcessFailedEventArgs3 { + type Target = ICoreWebView2ProcessFailedEventArgs2; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2ProcessFailedEventArgs3, + windows_core::IUnknown, + ICoreWebView2ProcessFailedEventArgs, + ICoreWebView2ProcessFailedEventArgs2 +); +impl ICoreWebView2ProcessFailedEventArgs3 { + pub unsafe fn FailureSourceModulePath( + &self, + value: *mut windows_core::PWSTR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).FailureSourceModulePath)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2ProcessFailedEventArgs3_Vtbl { + pub base__: ICoreWebView2ProcessFailedEventArgs2_Vtbl, + pub FailureSourceModulePath: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2ProcessFailedEventArgs3_Impl: + ICoreWebView2ProcessFailedEventArgs2_Impl +{ + fn FailureSourceModulePath(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; +} +impl ICoreWebView2ProcessFailedEventArgs3_Vtbl { + pub const fn new( + ) -> Self { + unsafe extern "system" fn FailureSourceModulePath< + Identity: ICoreWebView2ProcessFailedEventArgs3_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ProcessFailedEventArgs3_Impl::FailureSourceModulePath( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: ICoreWebView2ProcessFailedEventArgs2_Vtbl::new::(), + FailureSourceModulePath: FailureSourceModulePath::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2ProcessFailedEventArgs3 {} +windows_core::imp::define_interface!( + ICoreWebView2ProcessFailedEventHandler, + ICoreWebView2ProcessFailedEventHandler_Vtbl, + 0x79e0aea4_990b_42d9_aa1d_0fcc2e5bc7f1 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2ProcessFailedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2ProcessFailedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2ProcessFailedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2ProcessFailedEventHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2>, + args: windows_core::Ref<'_, ICoreWebView2ProcessFailedEventArgs>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2ProcessFailedEventHandler_Vtbl { + pub const fn new( + ) -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2ProcessFailedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ProcessFailedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2ProcessFailedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2ProcessInfo, + ICoreWebView2ProcessInfo_Vtbl, + 0x84fa7612_3f3d_4fbf_889d_fad000492d72 +); +windows_core::imp::interface_hierarchy!(ICoreWebView2ProcessInfo, windows_core::IUnknown); +impl ICoreWebView2ProcessInfo { + pub unsafe fn ProcessId(&self, value: *mut i32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ProcessId)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn Kind(&self, kind: *mut COREWEBVIEW2_PROCESS_KIND) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Kind)( + windows_core::Interface::as_raw(self), + kind as _, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2ProcessInfo_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub ProcessId: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut i32) -> windows_core::HRESULT, + pub Kind: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_PROCESS_KIND, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2ProcessInfo_Impl: windows_core::IUnknownImpl { + fn ProcessId(&self, value: *mut i32) -> windows_core::Result<()>; + fn Kind(&self, kind: *mut COREWEBVIEW2_PROCESS_KIND) -> windows_core::Result<()>; +} +impl ICoreWebView2ProcessInfo_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn ProcessId< + Identity: ICoreWebView2ProcessInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut i32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ProcessInfo_Impl::ProcessId(this, core::mem::transmute_copy(&value)) + .into() + } + } + unsafe extern "system" fn Kind< + Identity: ICoreWebView2ProcessInfo_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + kind: *mut COREWEBVIEW2_PROCESS_KIND, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ProcessInfo_Impl::Kind(this, core::mem::transmute_copy(&kind)).into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + ProcessId: ProcessId::, + Kind: Kind::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2ProcessInfo {} +windows_core::imp::define_interface!( + ICoreWebView2ProcessInfoCollection, + ICoreWebView2ProcessInfoCollection_Vtbl, + 0x402b99cd_a0cc_4fa5_b7a5_51d86a1d2339 +); +windows_core::imp::interface_hierarchy!(ICoreWebView2ProcessInfoCollection, windows_core::IUnknown); +impl ICoreWebView2ProcessInfoCollection { + pub unsafe fn Count(&self, value: *mut u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Count)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn GetValueAtIndex( + &self, + index: u32, + ) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).GetValueAtIndex)( + windows_core::Interface::as_raw(self), + index, + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2ProcessInfoCollection_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Count: unsafe extern "system" fn(*mut core::ffi::c_void, *mut u32) -> windows_core::HRESULT, + pub GetValueAtIndex: unsafe extern "system" fn( + *mut core::ffi::c_void, + u32, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2ProcessInfoCollection_Impl: windows_core::IUnknownImpl { + fn Count(&self, value: *mut u32) -> windows_core::Result<()>; + fn GetValueAtIndex(&self, index: u32) -> windows_core::Result; +} +impl ICoreWebView2ProcessInfoCollection_Vtbl { + pub const fn new( + ) -> Self { + unsafe extern "system" fn Count< + Identity: ICoreWebView2ProcessInfoCollection_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ProcessInfoCollection_Impl::Count( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn GetValueAtIndex< + Identity: ICoreWebView2ProcessInfoCollection_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + index: u32, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2ProcessInfoCollection_Impl::GetValueAtIndex( + this, + core::mem::transmute_copy(&index), + ) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Count: Count::, + GetValueAtIndex: GetValueAtIndex::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2ProcessInfoCollection {} +windows_core::imp::define_interface!( + ICoreWebView2ProcessInfosChangedEventHandler, + ICoreWebView2ProcessInfosChangedEventHandler_Vtbl, + 0xf4af0c39_44b9_40e9_8b11_0484cfb9e0a1 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2ProcessInfosChangedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2ProcessInfosChangedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2ProcessInfosChangedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2ProcessInfosChangedEventHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2Environment>, + args: windows_core::Ref<'_, windows_core::IUnknown>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2ProcessInfosChangedEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2ProcessInfosChangedEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2ProcessInfosChangedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ProcessInfosChangedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2ProcessInfosChangedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2Profile, + ICoreWebView2Profile_Vtbl, + 0x79110ad3_cd5d_4373_8bc3_c60658f17a5f +); +windows_core::imp::interface_hierarchy!(ICoreWebView2Profile, windows_core::IUnknown); +impl ICoreWebView2Profile { + pub unsafe fn ProfileName(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ProfileName)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn IsInPrivateModeEnabled( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).IsInPrivateModeEnabled)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn ProfilePath(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ProfilePath)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn DefaultDownloadFolderPath( + &self, + value: *mut windows_core::PWSTR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).DefaultDownloadFolderPath)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetDefaultDownloadFolderPath(&self, value: P0) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).SetDefaultDownloadFolderPath)( + windows_core::Interface::as_raw(self), + value.param().abi(), + ) + .ok() + } + } + pub unsafe fn PreferredColorScheme( + &self, + value: *mut COREWEBVIEW2_PREFERRED_COLOR_SCHEME, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).PreferredColorScheme)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetPreferredColorScheme( + &self, + value: COREWEBVIEW2_PREFERRED_COLOR_SCHEME, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetPreferredColorScheme)( + windows_core::Interface::as_raw(self), + value, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Profile_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub ProfileName: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub IsInPrivateModeEnabled: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub ProfilePath: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub DefaultDownloadFolderPath: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub SetDefaultDownloadFolderPath: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + ) -> windows_core::HRESULT, + pub PreferredColorScheme: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_PREFERRED_COLOR_SCHEME, + ) -> windows_core::HRESULT, + pub SetPreferredColorScheme: unsafe extern "system" fn( + *mut core::ffi::c_void, + COREWEBVIEW2_PREFERRED_COLOR_SCHEME, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Profile_Impl: windows_core::IUnknownImpl { + fn ProfileName(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn IsInPrivateModeEnabled(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn ProfilePath(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn DefaultDownloadFolderPath( + &self, + value: *mut windows_core::PWSTR, + ) -> windows_core::Result<()>; + fn SetDefaultDownloadFolderPath( + &self, + value: &windows_core::PCWSTR, + ) -> windows_core::Result<()>; + fn PreferredColorScheme( + &self, + value: *mut COREWEBVIEW2_PREFERRED_COLOR_SCHEME, + ) -> windows_core::Result<()>; + fn SetPreferredColorScheme( + &self, + value: COREWEBVIEW2_PREFERRED_COLOR_SCHEME, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2Profile_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn ProfileName< + Identity: ICoreWebView2Profile_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Profile_Impl::ProfileName(this, core::mem::transmute_copy(&value)) + .into() + } + } + unsafe extern "system" fn IsInPrivateModeEnabled< + Identity: ICoreWebView2Profile_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Profile_Impl::IsInPrivateModeEnabled( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn ProfilePath< + Identity: ICoreWebView2Profile_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Profile_Impl::ProfilePath(this, core::mem::transmute_copy(&value)) + .into() + } + } + unsafe extern "system" fn DefaultDownloadFolderPath< + Identity: ICoreWebView2Profile_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Profile_Impl::DefaultDownloadFolderPath( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetDefaultDownloadFolderPath< + Identity: ICoreWebView2Profile_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::PCWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Profile_Impl::SetDefaultDownloadFolderPath( + this, + core::mem::transmute(&value), + ) + .into() + } + } + unsafe extern "system" fn PreferredColorScheme< + Identity: ICoreWebView2Profile_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut COREWEBVIEW2_PREFERRED_COLOR_SCHEME, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Profile_Impl::PreferredColorScheme( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetPreferredColorScheme< + Identity: ICoreWebView2Profile_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: COREWEBVIEW2_PREFERRED_COLOR_SCHEME, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Profile_Impl::SetPreferredColorScheme( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + ProfileName: ProfileName::, + IsInPrivateModeEnabled: IsInPrivateModeEnabled::, + ProfilePath: ProfilePath::, + DefaultDownloadFolderPath: DefaultDownloadFolderPath::, + SetDefaultDownloadFolderPath: SetDefaultDownloadFolderPath::, + PreferredColorScheme: PreferredColorScheme::, + SetPreferredColorScheme: SetPreferredColorScheme::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Profile {} +windows_core::imp::define_interface!( + ICoreWebView2Profile2, + ICoreWebView2Profile2_Vtbl, + 0xfa740d4b_5eae_4344_a8ad_74be31925397 +); +impl core::ops::Deref for ICoreWebView2Profile2 { + type Target = ICoreWebView2Profile; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2Profile2, + windows_core::IUnknown, + ICoreWebView2Profile +); +impl ICoreWebView2Profile2 { + pub unsafe fn ClearBrowsingData( + &self, + datakinds: COREWEBVIEW2_BROWSING_DATA_KINDS, + handler: P1, + ) -> windows_core::Result<()> + where + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).ClearBrowsingData)( + windows_core::Interface::as_raw(self), + datakinds, + handler.param().abi(), + ) + .ok() + } + } + pub unsafe fn ClearBrowsingDataInTimeRange( + &self, + datakinds: COREWEBVIEW2_BROWSING_DATA_KINDS, + starttime: f64, + endtime: f64, + handler: P3, + ) -> windows_core::Result<()> + where + P3: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).ClearBrowsingDataInTimeRange)( + windows_core::Interface::as_raw(self), + datakinds, + starttime, + endtime, + handler.param().abi(), + ) + .ok() + } + } + pub unsafe fn ClearBrowsingDataAll(&self, handler: P0) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).ClearBrowsingDataAll)( + windows_core::Interface::as_raw(self), + handler.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Profile2_Vtbl { + pub base__: ICoreWebView2Profile_Vtbl, + pub ClearBrowsingData: unsafe extern "system" fn( + *mut core::ffi::c_void, + COREWEBVIEW2_BROWSING_DATA_KINDS, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub ClearBrowsingDataInTimeRange: unsafe extern "system" fn( + *mut core::ffi::c_void, + COREWEBVIEW2_BROWSING_DATA_KINDS, + f64, + f64, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub ClearBrowsingDataAll: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Profile2_Impl: ICoreWebView2Profile_Impl { + fn ClearBrowsingData( + &self, + datakinds: COREWEBVIEW2_BROWSING_DATA_KINDS, + handler: windows_core::Ref<'_, ICoreWebView2ClearBrowsingDataCompletedHandler>, + ) -> windows_core::Result<()>; + fn ClearBrowsingDataInTimeRange( + &self, + datakinds: COREWEBVIEW2_BROWSING_DATA_KINDS, + starttime: f64, + endtime: f64, + handler: windows_core::Ref<'_, ICoreWebView2ClearBrowsingDataCompletedHandler>, + ) -> windows_core::Result<()>; + fn ClearBrowsingDataAll( + &self, + handler: windows_core::Ref<'_, ICoreWebView2ClearBrowsingDataCompletedHandler>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2Profile2_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn ClearBrowsingData< + Identity: ICoreWebView2Profile2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + datakinds: COREWEBVIEW2_BROWSING_DATA_KINDS, + handler: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Profile2_Impl::ClearBrowsingData( + this, + core::mem::transmute_copy(&datakinds), + core::mem::transmute_copy(&handler), + ) + .into() + } + } + unsafe extern "system" fn ClearBrowsingDataInTimeRange< + Identity: ICoreWebView2Profile2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + datakinds: COREWEBVIEW2_BROWSING_DATA_KINDS, + starttime: f64, + endtime: f64, + handler: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Profile2_Impl::ClearBrowsingDataInTimeRange( + this, + core::mem::transmute_copy(&datakinds), + core::mem::transmute_copy(&starttime), + core::mem::transmute_copy(&endtime), + core::mem::transmute_copy(&handler), + ) + .into() + } + } + unsafe extern "system" fn ClearBrowsingDataAll< + Identity: ICoreWebView2Profile2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + handler: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Profile2_Impl::ClearBrowsingDataAll( + this, + core::mem::transmute_copy(&handler), + ) + .into() + } + } + Self { + base__: ICoreWebView2Profile_Vtbl::new::(), + ClearBrowsingData: ClearBrowsingData::, + ClearBrowsingDataInTimeRange: ClearBrowsingDataInTimeRange::, + ClearBrowsingDataAll: ClearBrowsingDataAll::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Profile2 {} +windows_core::imp::define_interface!( + ICoreWebView2Profile3, + ICoreWebView2Profile3_Vtbl, + 0xb188e659_5685_4e05_bdba_fc640e0f1992 +); +impl core::ops::Deref for ICoreWebView2Profile3 { + type Target = ICoreWebView2Profile2; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2Profile3, + windows_core::IUnknown, + ICoreWebView2Profile, + ICoreWebView2Profile2 +); +impl ICoreWebView2Profile3 { + pub unsafe fn PreferredTrackingPreventionLevel( + &self, + value: *mut COREWEBVIEW2_TRACKING_PREVENTION_LEVEL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).PreferredTrackingPreventionLevel)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetPreferredTrackingPreventionLevel( + &self, + value: COREWEBVIEW2_TRACKING_PREVENTION_LEVEL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetPreferredTrackingPreventionLevel)( + windows_core::Interface::as_raw(self), + value, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Profile3_Vtbl { + pub base__: ICoreWebView2Profile2_Vtbl, + pub PreferredTrackingPreventionLevel: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_TRACKING_PREVENTION_LEVEL, + ) -> windows_core::HRESULT, + pub SetPreferredTrackingPreventionLevel: unsafe extern "system" fn( + *mut core::ffi::c_void, + COREWEBVIEW2_TRACKING_PREVENTION_LEVEL, + ) + -> windows_core::HRESULT, +} +pub trait ICoreWebView2Profile3_Impl: ICoreWebView2Profile2_Impl { + fn PreferredTrackingPreventionLevel( + &self, + value: *mut COREWEBVIEW2_TRACKING_PREVENTION_LEVEL, + ) -> windows_core::Result<()>; + fn SetPreferredTrackingPreventionLevel( + &self, + value: COREWEBVIEW2_TRACKING_PREVENTION_LEVEL, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2Profile3_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn PreferredTrackingPreventionLevel< + Identity: ICoreWebView2Profile3_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut COREWEBVIEW2_TRACKING_PREVENTION_LEVEL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Profile3_Impl::PreferredTrackingPreventionLevel( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetPreferredTrackingPreventionLevel< + Identity: ICoreWebView2Profile3_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: COREWEBVIEW2_TRACKING_PREVENTION_LEVEL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Profile3_Impl::SetPreferredTrackingPreventionLevel( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: ICoreWebView2Profile2_Vtbl::new::(), + PreferredTrackingPreventionLevel: PreferredTrackingPreventionLevel::, + SetPreferredTrackingPreventionLevel: SetPreferredTrackingPreventionLevel::< + Identity, + OFFSET, + >, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Profile3 {} +windows_core::imp::define_interface!( + ICoreWebView2Profile4, + ICoreWebView2Profile4_Vtbl, + 0x8f4ae680_192e_4ec8_833a_21cfadaef628 +); +impl core::ops::Deref for ICoreWebView2Profile4 { + type Target = ICoreWebView2Profile3; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2Profile4, + windows_core::IUnknown, + ICoreWebView2Profile, + ICoreWebView2Profile2, + ICoreWebView2Profile3 +); +impl ICoreWebView2Profile4 { + pub unsafe fn SetPermissionState( + &self, + permissionkind: COREWEBVIEW2_PERMISSION_KIND, + origin: P1, + state: COREWEBVIEW2_PERMISSION_STATE, + handler: P3, + ) -> windows_core::Result<()> + where + P1: windows_core::Param, + P3: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).SetPermissionState)( + windows_core::Interface::as_raw(self), + permissionkind, + origin.param().abi(), + state, + handler.param().abi(), + ) + .ok() + } + } + pub unsafe fn GetNonDefaultPermissionSettings( + &self, + handler: P0, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).GetNonDefaultPermissionSettings)( + windows_core::Interface::as_raw(self), + handler.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Profile4_Vtbl { + pub base__: ICoreWebView2Profile3_Vtbl, + pub SetPermissionState: unsafe extern "system" fn( + *mut core::ffi::c_void, + COREWEBVIEW2_PERMISSION_KIND, + windows_core::PCWSTR, + COREWEBVIEW2_PERMISSION_STATE, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub GetNonDefaultPermissionSettings: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Profile4_Impl: ICoreWebView2Profile3_Impl { + fn SetPermissionState( + &self, + permissionkind: COREWEBVIEW2_PERMISSION_KIND, + origin: &windows_core::PCWSTR, + state: COREWEBVIEW2_PERMISSION_STATE, + handler: windows_core::Ref<'_, ICoreWebView2SetPermissionStateCompletedHandler>, + ) -> windows_core::Result<()>; + fn GetNonDefaultPermissionSettings( + &self, + handler: windows_core::Ref< + '_, + ICoreWebView2GetNonDefaultPermissionSettingsCompletedHandler, + >, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2Profile4_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn SetPermissionState< + Identity: ICoreWebView2Profile4_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + permissionkind: COREWEBVIEW2_PERMISSION_KIND, + origin: windows_core::PCWSTR, + state: COREWEBVIEW2_PERMISSION_STATE, + handler: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Profile4_Impl::SetPermissionState( + this, + core::mem::transmute_copy(&permissionkind), + core::mem::transmute(&origin), + core::mem::transmute_copy(&state), + core::mem::transmute_copy(&handler), + ) + .into() + } + } + unsafe extern "system" fn GetNonDefaultPermissionSettings< + Identity: ICoreWebView2Profile4_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + handler: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Profile4_Impl::GetNonDefaultPermissionSettings( + this, + core::mem::transmute_copy(&handler), + ) + .into() + } + } + Self { + base__: ICoreWebView2Profile3_Vtbl::new::(), + SetPermissionState: SetPermissionState::, + GetNonDefaultPermissionSettings: GetNonDefaultPermissionSettings::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Profile4 {} +windows_core::imp::define_interface!( + ICoreWebView2Profile5, + ICoreWebView2Profile5_Vtbl, + 0x2ee5b76e_6e80_4df2_bcd3_d4ec3340a01b +); +impl core::ops::Deref for ICoreWebView2Profile5 { + type Target = ICoreWebView2Profile4; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2Profile5, + windows_core::IUnknown, + ICoreWebView2Profile, + ICoreWebView2Profile2, + ICoreWebView2Profile3, + ICoreWebView2Profile4 +); +impl ICoreWebView2Profile5 { + pub unsafe fn CookieManager(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).CookieManager)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Profile5_Vtbl { + pub base__: ICoreWebView2Profile4_Vtbl, + pub CookieManager: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Profile5_Impl: ICoreWebView2Profile4_Impl { + fn CookieManager(&self) -> windows_core::Result; +} +impl ICoreWebView2Profile5_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn CookieManager< + Identity: ICoreWebView2Profile5_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2Profile5_Impl::CookieManager(this) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: ICoreWebView2Profile4_Vtbl::new::(), + CookieManager: CookieManager::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Profile5 {} +windows_core::imp::define_interface!( + ICoreWebView2Profile6, + ICoreWebView2Profile6_Vtbl, + 0xbd82fa6a_1d65_4c33_b2b4_0393020cc61b +); +impl core::ops::Deref for ICoreWebView2Profile6 { + type Target = ICoreWebView2Profile5; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2Profile6, + windows_core::IUnknown, + ICoreWebView2Profile, + ICoreWebView2Profile2, + ICoreWebView2Profile3, + ICoreWebView2Profile4, + ICoreWebView2Profile5 +); +impl ICoreWebView2Profile6 { + pub unsafe fn IsPasswordAutosaveEnabled( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).IsPasswordAutosaveEnabled)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetIsPasswordAutosaveEnabled(&self, value: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetIsPasswordAutosaveEnabled)( + windows_core::Interface::as_raw(self), + value.into(), + ) + .ok() + } + } + pub unsafe fn IsGeneralAutofillEnabled( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).IsGeneralAutofillEnabled)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetIsGeneralAutofillEnabled(&self, value: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetIsGeneralAutofillEnabled)( + windows_core::Interface::as_raw(self), + value.into(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Profile6_Vtbl { + pub base__: ICoreWebView2Profile5_Vtbl, + pub IsPasswordAutosaveEnabled: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetIsPasswordAutosaveEnabled: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, + pub IsGeneralAutofillEnabled: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetIsGeneralAutofillEnabled: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Profile6_Impl: ICoreWebView2Profile5_Impl { + fn IsPasswordAutosaveEnabled(&self, value: *mut windows_core::BOOL) + -> windows_core::Result<()>; + fn SetIsPasswordAutosaveEnabled(&self, value: windows_core::BOOL) -> windows_core::Result<()>; + fn IsGeneralAutofillEnabled(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn SetIsGeneralAutofillEnabled(&self, value: windows_core::BOOL) -> windows_core::Result<()>; +} +impl ICoreWebView2Profile6_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn IsPasswordAutosaveEnabled< + Identity: ICoreWebView2Profile6_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Profile6_Impl::IsPasswordAutosaveEnabled( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetIsPasswordAutosaveEnabled< + Identity: ICoreWebView2Profile6_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Profile6_Impl::SetIsPasswordAutosaveEnabled( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn IsGeneralAutofillEnabled< + Identity: ICoreWebView2Profile6_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Profile6_Impl::IsGeneralAutofillEnabled( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetIsGeneralAutofillEnabled< + Identity: ICoreWebView2Profile6_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Profile6_Impl::SetIsGeneralAutofillEnabled( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: ICoreWebView2Profile5_Vtbl::new::(), + IsPasswordAutosaveEnabled: IsPasswordAutosaveEnabled::, + SetIsPasswordAutosaveEnabled: SetIsPasswordAutosaveEnabled::, + IsGeneralAutofillEnabled: IsGeneralAutofillEnabled::, + SetIsGeneralAutofillEnabled: SetIsGeneralAutofillEnabled::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Profile6 {} +windows_core::imp::define_interface!( + ICoreWebView2Profile7, + ICoreWebView2Profile7_Vtbl, + 0x7b4c7906_a1aa_4cb4_b723_db09f813d541 +); +impl core::ops::Deref for ICoreWebView2Profile7 { + type Target = ICoreWebView2Profile6; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2Profile7, + windows_core::IUnknown, + ICoreWebView2Profile, + ICoreWebView2Profile2, + ICoreWebView2Profile3, + ICoreWebView2Profile4, + ICoreWebView2Profile5, + ICoreWebView2Profile6 +); +impl ICoreWebView2Profile7 { + pub unsafe fn AddBrowserExtension( + &self, + extensionfolderpath: P0, + handler: P1, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).AddBrowserExtension)( + windows_core::Interface::as_raw(self), + extensionfolderpath.param().abi(), + handler.param().abi(), + ) + .ok() + } + } + pub unsafe fn GetBrowserExtensions(&self, handler: P0) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).GetBrowserExtensions)( + windows_core::Interface::as_raw(self), + handler.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Profile7_Vtbl { + pub base__: ICoreWebView2Profile6_Vtbl, + pub AddBrowserExtension: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub GetBrowserExtensions: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Profile7_Impl: ICoreWebView2Profile6_Impl { + fn AddBrowserExtension( + &self, + extensionfolderpath: &windows_core::PCWSTR, + handler: windows_core::Ref<'_, ICoreWebView2ProfileAddBrowserExtensionCompletedHandler>, + ) -> windows_core::Result<()>; + fn GetBrowserExtensions( + &self, + handler: windows_core::Ref<'_, ICoreWebView2ProfileGetBrowserExtensionsCompletedHandler>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2Profile7_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn AddBrowserExtension< + Identity: ICoreWebView2Profile7_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + extensionfolderpath: windows_core::PCWSTR, + handler: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Profile7_Impl::AddBrowserExtension( + this, + core::mem::transmute(&extensionfolderpath), + core::mem::transmute_copy(&handler), + ) + .into() + } + } + unsafe extern "system" fn GetBrowserExtensions< + Identity: ICoreWebView2Profile7_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + handler: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Profile7_Impl::GetBrowserExtensions( + this, + core::mem::transmute_copy(&handler), + ) + .into() + } + } + Self { + base__: ICoreWebView2Profile6_Vtbl::new::(), + AddBrowserExtension: AddBrowserExtension::, + GetBrowserExtensions: GetBrowserExtensions::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Profile7 {} +windows_core::imp::define_interface!( + ICoreWebView2Profile8, + ICoreWebView2Profile8_Vtbl, + 0xfbf70c2f_eb1f_4383_85a0_163e92044011 +); +impl core::ops::Deref for ICoreWebView2Profile8 { + type Target = ICoreWebView2Profile7; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2Profile8, + windows_core::IUnknown, + ICoreWebView2Profile, + ICoreWebView2Profile2, + ICoreWebView2Profile3, + ICoreWebView2Profile4, + ICoreWebView2Profile5, + ICoreWebView2Profile6, + ICoreWebView2Profile7 +); +impl ICoreWebView2Profile8 { + pub unsafe fn Delete(&self) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Delete)(windows_core::Interface::as_raw(self)) + .ok() + } + } + pub unsafe fn add_Deleted( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_Deleted)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_Deleted(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_Deleted)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Profile8_Vtbl { + pub base__: ICoreWebView2Profile7_Vtbl, + pub Delete: unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT, + pub add_Deleted: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_Deleted: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Profile8_Impl: ICoreWebView2Profile7_Impl { + fn Delete(&self) -> windows_core::Result<()>; + fn add_Deleted( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2ProfileDeletedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_Deleted(&self, token: i64) -> windows_core::Result<()>; +} +impl ICoreWebView2Profile8_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn Delete< + Identity: ICoreWebView2Profile8_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Profile8_Impl::Delete(this).into() + } + } + unsafe extern "system" fn add_Deleted< + Identity: ICoreWebView2Profile8_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Profile8_Impl::add_Deleted( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_Deleted< + Identity: ICoreWebView2Profile8_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Profile8_Impl::remove_Deleted(this, core::mem::transmute_copy(&token)) + .into() + } + } + Self { + base__: ICoreWebView2Profile7_Vtbl::new::(), + Delete: Delete::, + add_Deleted: add_Deleted::, + remove_Deleted: remove_Deleted::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Profile8 {} +windows_core::imp::define_interface!( + ICoreWebView2ProfileAddBrowserExtensionCompletedHandler, + ICoreWebView2ProfileAddBrowserExtensionCompletedHandler_Vtbl, + 0xdf1aab27_82b9_4ab6_aae8_017a49398c14 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2ProfileAddBrowserExtensionCompletedHandler, + windows_core::IUnknown +); +impl ICoreWebView2ProfileAddBrowserExtensionCompletedHandler { + pub unsafe fn Invoke( + &self, + errorcode: windows_core::HRESULT, + result: P1, + ) -> windows_core::Result<()> + where + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + errorcode, + result.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2ProfileAddBrowserExtensionCompletedHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::HRESULT, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2ProfileAddBrowserExtensionCompletedHandler_Impl: + windows_core::IUnknownImpl +{ + fn Invoke( + &self, + errorcode: windows_core::HRESULT, + result: windows_core::Ref<'_, ICoreWebView2BrowserExtension>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2ProfileAddBrowserExtensionCompletedHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2ProfileAddBrowserExtensionCompletedHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2ProfileAddBrowserExtensionCompletedHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + errorcode: windows_core::HRESULT, + result: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ProfileAddBrowserExtensionCompletedHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&errorcode), + core::mem::transmute_copy(&result), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == & < ICoreWebView2ProfileAddBrowserExtensionCompletedHandler as windows_core::Interface >::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2ProfileAddBrowserExtensionCompletedHandler {} +windows_core::imp::define_interface!( + ICoreWebView2ProfileDeletedEventHandler, + ICoreWebView2ProfileDeletedEventHandler_Vtbl, + 0xdf35055d_772e_4dbe_b743_5fbf74a2b258 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2ProfileDeletedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2ProfileDeletedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2ProfileDeletedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2ProfileDeletedEventHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2Profile>, + args: windows_core::Ref<'_, windows_core::IUnknown>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2ProfileDeletedEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2ProfileDeletedEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2ProfileDeletedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ProfileDeletedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2ProfileDeletedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2ProfileGetBrowserExtensionsCompletedHandler, + ICoreWebView2ProfileGetBrowserExtensionsCompletedHandler_Vtbl, + 0xfce16a1c_f107_4601_8b75_fc4940ae25d0 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2ProfileGetBrowserExtensionsCompletedHandler, + windows_core::IUnknown +); +impl ICoreWebView2ProfileGetBrowserExtensionsCompletedHandler { + pub unsafe fn Invoke( + &self, + errorcode: windows_core::HRESULT, + result: P1, + ) -> windows_core::Result<()> + where + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + errorcode, + result.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2ProfileGetBrowserExtensionsCompletedHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::HRESULT, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2ProfileGetBrowserExtensionsCompletedHandler_Impl: + windows_core::IUnknownImpl +{ + fn Invoke( + &self, + errorcode: windows_core::HRESULT, + result: windows_core::Ref<'_, ICoreWebView2BrowserExtensionList>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2ProfileGetBrowserExtensionsCompletedHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2ProfileGetBrowserExtensionsCompletedHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2ProfileGetBrowserExtensionsCompletedHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + errorcode: windows_core::HRESULT, + result: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ProfileGetBrowserExtensionsCompletedHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&errorcode), + core::mem::transmute_copy(&result), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == & < ICoreWebView2ProfileGetBrowserExtensionsCompletedHandler as windows_core::Interface >::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2ProfileGetBrowserExtensionsCompletedHandler {} +windows_core::imp::define_interface!( + ICoreWebView2RasterizationScaleChangedEventHandler, + ICoreWebView2RasterizationScaleChangedEventHandler_Vtbl, + 0x9c98c8b1_ac53_427e_a345_3049b5524bbe +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2RasterizationScaleChangedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2RasterizationScaleChangedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2RasterizationScaleChangedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2RasterizationScaleChangedEventHandler_Impl: + windows_core::IUnknownImpl +{ + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2Controller>, + args: windows_core::Ref<'_, windows_core::IUnknown>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2RasterizationScaleChangedEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2RasterizationScaleChangedEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2RasterizationScaleChangedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2RasterizationScaleChangedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2RasterizationScaleChangedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2RegionRectCollectionView, + ICoreWebView2RegionRectCollectionView_Vtbl, + 0x333353b8_48bf_4449_8fcc_22697faf5753 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2RegionRectCollectionView, + windows_core::IUnknown +); +impl ICoreWebView2RegionRectCollectionView { + pub unsafe fn Count(&self, value: *mut u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Count)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn GetValueAtIndex( + &self, + index: u32, + value: *mut windows::Win32::Foundation::RECT, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).GetValueAtIndex)( + windows_core::Interface::as_raw(self), + index, + value as _, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2RegionRectCollectionView_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Count: unsafe extern "system" fn(*mut core::ffi::c_void, *mut u32) -> windows_core::HRESULT, + pub GetValueAtIndex: unsafe extern "system" fn( + *mut core::ffi::c_void, + u32, + *mut windows::Win32::Foundation::RECT, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2RegionRectCollectionView_Impl: windows_core::IUnknownImpl { + fn Count(&self, value: *mut u32) -> windows_core::Result<()>; + fn GetValueAtIndex( + &self, + index: u32, + value: *mut windows::Win32::Foundation::RECT, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2RegionRectCollectionView_Vtbl { + pub const fn new( + ) -> Self { + unsafe extern "system" fn Count< + Identity: ICoreWebView2RegionRectCollectionView_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2RegionRectCollectionView_Impl::Count( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn GetValueAtIndex< + Identity: ICoreWebView2RegionRectCollectionView_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + index: u32, + value: *mut windows::Win32::Foundation::RECT, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2RegionRectCollectionView_Impl::GetValueAtIndex( + this, + core::mem::transmute_copy(&index), + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Count: Count::, + GetValueAtIndex: GetValueAtIndex::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2RegionRectCollectionView {} +windows_core::imp::define_interface!( + ICoreWebView2SaveAsUIShowingEventArgs, + ICoreWebView2SaveAsUIShowingEventArgs_Vtbl, + 0x55902952_0e0d_5aaa_a7d0_e833cdb34f62 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2SaveAsUIShowingEventArgs, + windows_core::IUnknown +); +impl ICoreWebView2SaveAsUIShowingEventArgs { + pub unsafe fn ContentMimeType( + &self, + value: *mut windows_core::PWSTR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ContentMimeType)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetCancel(&self, value: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetCancel)( + windows_core::Interface::as_raw(self), + value.into(), + ) + .ok() + } + } + pub unsafe fn Cancel(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Cancel)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetSuppressDefaultDialog(&self, value: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetSuppressDefaultDialog)( + windows_core::Interface::as_raw(self), + value.into(), + ) + .ok() + } + } + pub unsafe fn SuppressDefaultDialog( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SuppressDefaultDialog)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn GetDeferral(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).GetDeferral)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } + pub unsafe fn SetSaveAsFilePath(&self, value: P0) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).SetSaveAsFilePath)( + windows_core::Interface::as_raw(self), + value.param().abi(), + ) + .ok() + } + } + pub unsafe fn SaveAsFilePath( + &self, + value: *mut windows_core::PWSTR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SaveAsFilePath)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetAllowReplace(&self, value: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetAllowReplace)( + windows_core::Interface::as_raw(self), + value.into(), + ) + .ok() + } + } + pub unsafe fn AllowReplace(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).AllowReplace)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetKind(&self, value: COREWEBVIEW2_SAVE_AS_KIND) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetKind)( + windows_core::Interface::as_raw(self), + value, + ) + .ok() + } + } + pub unsafe fn Kind(&self, value: *mut COREWEBVIEW2_SAVE_AS_KIND) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Kind)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2SaveAsUIShowingEventArgs_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub ContentMimeType: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub SetCancel: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, + pub Cancel: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetSuppressDefaultDialog: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SuppressDefaultDialog: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub GetDeferral: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub SetSaveAsFilePath: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + ) -> windows_core::HRESULT, + pub SaveAsFilePath: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub SetAllowReplace: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, + pub AllowReplace: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetKind: unsafe extern "system" fn( + *mut core::ffi::c_void, + COREWEBVIEW2_SAVE_AS_KIND, + ) -> windows_core::HRESULT, + pub Kind: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_SAVE_AS_KIND, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2SaveAsUIShowingEventArgs_Impl: windows_core::IUnknownImpl { + fn ContentMimeType(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn SetCancel(&self, value: windows_core::BOOL) -> windows_core::Result<()>; + fn Cancel(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn SetSuppressDefaultDialog(&self, value: windows_core::BOOL) -> windows_core::Result<()>; + fn SuppressDefaultDialog(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn GetDeferral(&self) -> windows_core::Result; + fn SetSaveAsFilePath(&self, value: &windows_core::PCWSTR) -> windows_core::Result<()>; + fn SaveAsFilePath(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn SetAllowReplace(&self, value: windows_core::BOOL) -> windows_core::Result<()>; + fn AllowReplace(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn SetKind(&self, value: COREWEBVIEW2_SAVE_AS_KIND) -> windows_core::Result<()>; + fn Kind(&self, value: *mut COREWEBVIEW2_SAVE_AS_KIND) -> windows_core::Result<()>; +} +impl ICoreWebView2SaveAsUIShowingEventArgs_Vtbl { + pub const fn new( + ) -> Self { + unsafe extern "system" fn ContentMimeType< + Identity: ICoreWebView2SaveAsUIShowingEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2SaveAsUIShowingEventArgs_Impl::ContentMimeType( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetCancel< + Identity: ICoreWebView2SaveAsUIShowingEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2SaveAsUIShowingEventArgs_Impl::SetCancel( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn Cancel< + Identity: ICoreWebView2SaveAsUIShowingEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2SaveAsUIShowingEventArgs_Impl::Cancel( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetSuppressDefaultDialog< + Identity: ICoreWebView2SaveAsUIShowingEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2SaveAsUIShowingEventArgs_Impl::SetSuppressDefaultDialog( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SuppressDefaultDialog< + Identity: ICoreWebView2SaveAsUIShowingEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2SaveAsUIShowingEventArgs_Impl::SuppressDefaultDialog( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn GetDeferral< + Identity: ICoreWebView2SaveAsUIShowingEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2SaveAsUIShowingEventArgs_Impl::GetDeferral(this) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + unsafe extern "system" fn SetSaveAsFilePath< + Identity: ICoreWebView2SaveAsUIShowingEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::PCWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2SaveAsUIShowingEventArgs_Impl::SetSaveAsFilePath( + this, + core::mem::transmute(&value), + ) + .into() + } + } + unsafe extern "system" fn SaveAsFilePath< + Identity: ICoreWebView2SaveAsUIShowingEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2SaveAsUIShowingEventArgs_Impl::SaveAsFilePath( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetAllowReplace< + Identity: ICoreWebView2SaveAsUIShowingEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2SaveAsUIShowingEventArgs_Impl::SetAllowReplace( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn AllowReplace< + Identity: ICoreWebView2SaveAsUIShowingEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2SaveAsUIShowingEventArgs_Impl::AllowReplace( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetKind< + Identity: ICoreWebView2SaveAsUIShowingEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: COREWEBVIEW2_SAVE_AS_KIND, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2SaveAsUIShowingEventArgs_Impl::SetKind( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn Kind< + Identity: ICoreWebView2SaveAsUIShowingEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut COREWEBVIEW2_SAVE_AS_KIND, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2SaveAsUIShowingEventArgs_Impl::Kind( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + ContentMimeType: ContentMimeType::, + SetCancel: SetCancel::, + Cancel: Cancel::, + SetSuppressDefaultDialog: SetSuppressDefaultDialog::, + SuppressDefaultDialog: SuppressDefaultDialog::, + GetDeferral: GetDeferral::, + SetSaveAsFilePath: SetSaveAsFilePath::, + SaveAsFilePath: SaveAsFilePath::, + SetAllowReplace: SetAllowReplace::, + AllowReplace: AllowReplace::, + SetKind: SetKind::, + Kind: Kind::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2SaveAsUIShowingEventArgs {} +windows_core::imp::define_interface!( + ICoreWebView2SaveAsUIShowingEventHandler, + ICoreWebView2SaveAsUIShowingEventHandler_Vtbl, + 0x6baa177e_3a2e_5ccf_9a13_fad676cd0522 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2SaveAsUIShowingEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2SaveAsUIShowingEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2SaveAsUIShowingEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2SaveAsUIShowingEventHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2>, + args: windows_core::Ref<'_, ICoreWebView2SaveAsUIShowingEventArgs>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2SaveAsUIShowingEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2SaveAsUIShowingEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2SaveAsUIShowingEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2SaveAsUIShowingEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2SaveAsUIShowingEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2SaveFileSecurityCheckStartingEventArgs, + ICoreWebView2SaveFileSecurityCheckStartingEventArgs_Vtbl, + 0xcf4ff1d1_5a67_5660_8d63_ef699881ea65 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2SaveFileSecurityCheckStartingEventArgs, + windows_core::IUnknown +); +impl ICoreWebView2SaveFileSecurityCheckStartingEventArgs { + pub unsafe fn CancelSave(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).CancelSave)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetCancelSave(&self, value: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetCancelSave)( + windows_core::Interface::as_raw(self), + value.into(), + ) + .ok() + } + } + pub unsafe fn DocumentOriginUri( + &self, + value: *mut windows_core::PWSTR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).DocumentOriginUri)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn FileExtension( + &self, + value: *mut windows_core::PWSTR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).FileExtension)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn FilePath(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).FilePath)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SuppressDefaultPolicy( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SuppressDefaultPolicy)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetSuppressDefaultPolicy(&self, value: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetSuppressDefaultPolicy)( + windows_core::Interface::as_raw(self), + value.into(), + ) + .ok() + } + } + pub unsafe fn GetDeferral(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).GetDeferral)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2SaveFileSecurityCheckStartingEventArgs_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub CancelSave: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetCancelSave: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, + pub DocumentOriginUri: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub FileExtension: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub FilePath: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub SuppressDefaultPolicy: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetSuppressDefaultPolicy: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, + pub GetDeferral: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2SaveFileSecurityCheckStartingEventArgs_Impl: + windows_core::IUnknownImpl +{ + fn CancelSave(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn SetCancelSave(&self, value: windows_core::BOOL) -> windows_core::Result<()>; + fn DocumentOriginUri(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn FileExtension(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn FilePath(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn SuppressDefaultPolicy(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn SetSuppressDefaultPolicy(&self, value: windows_core::BOOL) -> windows_core::Result<()>; + fn GetDeferral(&self) -> windows_core::Result; +} +impl ICoreWebView2SaveFileSecurityCheckStartingEventArgs_Vtbl { + pub const fn new< + Identity: ICoreWebView2SaveFileSecurityCheckStartingEventArgs_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn CancelSave< + Identity: ICoreWebView2SaveFileSecurityCheckStartingEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2SaveFileSecurityCheckStartingEventArgs_Impl::CancelSave( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetCancelSave< + Identity: ICoreWebView2SaveFileSecurityCheckStartingEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2SaveFileSecurityCheckStartingEventArgs_Impl::SetCancelSave( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn DocumentOriginUri< + Identity: ICoreWebView2SaveFileSecurityCheckStartingEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2SaveFileSecurityCheckStartingEventArgs_Impl::DocumentOriginUri( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn FileExtension< + Identity: ICoreWebView2SaveFileSecurityCheckStartingEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2SaveFileSecurityCheckStartingEventArgs_Impl::FileExtension( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn FilePath< + Identity: ICoreWebView2SaveFileSecurityCheckStartingEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2SaveFileSecurityCheckStartingEventArgs_Impl::FilePath( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SuppressDefaultPolicy< + Identity: ICoreWebView2SaveFileSecurityCheckStartingEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2SaveFileSecurityCheckStartingEventArgs_Impl::SuppressDefaultPolicy( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetSuppressDefaultPolicy< + Identity: ICoreWebView2SaveFileSecurityCheckStartingEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2SaveFileSecurityCheckStartingEventArgs_Impl::SetSuppressDefaultPolicy( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn GetDeferral< + Identity: ICoreWebView2SaveFileSecurityCheckStartingEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2SaveFileSecurityCheckStartingEventArgs_Impl::GetDeferral(this) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + CancelSave: CancelSave::, + SetCancelSave: SetCancelSave::, + DocumentOriginUri: DocumentOriginUri::, + FileExtension: FileExtension::, + FilePath: FilePath::, + SuppressDefaultPolicy: SuppressDefaultPolicy::, + SetSuppressDefaultPolicy: SetSuppressDefaultPolicy::, + GetDeferral: GetDeferral::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == & < ICoreWebView2SaveFileSecurityCheckStartingEventArgs as windows_core::Interface >::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2SaveFileSecurityCheckStartingEventArgs {} +windows_core::imp::define_interface!( + ICoreWebView2SaveFileSecurityCheckStartingEventHandler, + ICoreWebView2SaveFileSecurityCheckStartingEventHandler_Vtbl, + 0x7899576c_19e3_57c8_b7d1_55808292de57 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2SaveFileSecurityCheckStartingEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2SaveFileSecurityCheckStartingEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2SaveFileSecurityCheckStartingEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2SaveFileSecurityCheckStartingEventHandler_Impl: + windows_core::IUnknownImpl +{ + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2>, + args: windows_core::Ref<'_, ICoreWebView2SaveFileSecurityCheckStartingEventArgs>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2SaveFileSecurityCheckStartingEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2SaveFileSecurityCheckStartingEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2SaveFileSecurityCheckStartingEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2SaveFileSecurityCheckStartingEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == & < ICoreWebView2SaveFileSecurityCheckStartingEventHandler as windows_core::Interface >::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2SaveFileSecurityCheckStartingEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2ScreenCaptureStartingEventArgs, + ICoreWebView2ScreenCaptureStartingEventArgs_Vtbl, + 0x892c03fd_aee3_5eba_a1fa_6fd2f6484b2b +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2ScreenCaptureStartingEventArgs, + windows_core::IUnknown +); +impl ICoreWebView2ScreenCaptureStartingEventArgs { + pub unsafe fn Cancel(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Cancel)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetCancel(&self, value: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetCancel)( + windows_core::Interface::as_raw(self), + value.into(), + ) + .ok() + } + } + pub unsafe fn Handled(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Handled)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetHandled(&self, value: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetHandled)( + windows_core::Interface::as_raw(self), + value.into(), + ) + .ok() + } + } + pub unsafe fn OriginalSourceFrameInfo(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).OriginalSourceFrameInfo)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } + pub unsafe fn GetDeferral(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).GetDeferral)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2ScreenCaptureStartingEventArgs_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Cancel: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetCancel: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, + pub Handled: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetHandled: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, + pub OriginalSourceFrameInfo: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub GetDeferral: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2ScreenCaptureStartingEventArgs_Impl: windows_core::IUnknownImpl { + fn Cancel(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn SetCancel(&self, value: windows_core::BOOL) -> windows_core::Result<()>; + fn Handled(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn SetHandled(&self, value: windows_core::BOOL) -> windows_core::Result<()>; + fn OriginalSourceFrameInfo(&self) -> windows_core::Result; + fn GetDeferral(&self) -> windows_core::Result; +} +impl ICoreWebView2ScreenCaptureStartingEventArgs_Vtbl { + pub const fn new< + Identity: ICoreWebView2ScreenCaptureStartingEventArgs_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Cancel< + Identity: ICoreWebView2ScreenCaptureStartingEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ScreenCaptureStartingEventArgs_Impl::Cancel( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetCancel< + Identity: ICoreWebView2ScreenCaptureStartingEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ScreenCaptureStartingEventArgs_Impl::SetCancel( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn Handled< + Identity: ICoreWebView2ScreenCaptureStartingEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ScreenCaptureStartingEventArgs_Impl::Handled( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetHandled< + Identity: ICoreWebView2ScreenCaptureStartingEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ScreenCaptureStartingEventArgs_Impl::SetHandled( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn OriginalSourceFrameInfo< + Identity: ICoreWebView2ScreenCaptureStartingEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2ScreenCaptureStartingEventArgs_Impl::OriginalSourceFrameInfo( + this, + ) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + unsafe extern "system" fn GetDeferral< + Identity: ICoreWebView2ScreenCaptureStartingEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2ScreenCaptureStartingEventArgs_Impl::GetDeferral(this) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Cancel: Cancel::, + SetCancel: SetCancel::, + Handled: Handled::, + SetHandled: SetHandled::, + OriginalSourceFrameInfo: OriginalSourceFrameInfo::, + GetDeferral: GetDeferral::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2ScreenCaptureStartingEventArgs {} +windows_core::imp::define_interface!( + ICoreWebView2ScreenCaptureStartingEventHandler, + ICoreWebView2ScreenCaptureStartingEventHandler_Vtbl, + 0xe24ff05a_1db5_59d9_89f3_3c864268db4a +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2ScreenCaptureStartingEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2ScreenCaptureStartingEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2ScreenCaptureStartingEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2ScreenCaptureStartingEventHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2>, + args: windows_core::Ref<'_, ICoreWebView2ScreenCaptureStartingEventArgs>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2ScreenCaptureStartingEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2ScreenCaptureStartingEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2ScreenCaptureStartingEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ScreenCaptureStartingEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2ScreenCaptureStartingEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2ScriptDialogOpeningEventArgs, + ICoreWebView2ScriptDialogOpeningEventArgs_Vtbl, + 0x7390bb70_abe0_4843_9529_f143b31b03d6 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2ScriptDialogOpeningEventArgs, + windows_core::IUnknown +); +impl ICoreWebView2ScriptDialogOpeningEventArgs { + pub unsafe fn Uri(&self, uri: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Uri)( + windows_core::Interface::as_raw(self), + uri as _, + ) + .ok() + } + } + pub unsafe fn Kind( + &self, + kind: *mut COREWEBVIEW2_SCRIPT_DIALOG_KIND, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Kind)( + windows_core::Interface::as_raw(self), + kind as _, + ) + .ok() + } + } + pub unsafe fn Message(&self, message: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Message)( + windows_core::Interface::as_raw(self), + message as _, + ) + .ok() + } + } + pub unsafe fn Accept(&self) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Accept)(windows_core::Interface::as_raw(self)) + .ok() + } + } + pub unsafe fn DefaultText( + &self, + defaulttext: *mut windows_core::PWSTR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).DefaultText)( + windows_core::Interface::as_raw(self), + defaulttext as _, + ) + .ok() + } + } + pub unsafe fn ResultText( + &self, + resulttext: *mut windows_core::PWSTR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ResultText)( + windows_core::Interface::as_raw(self), + resulttext as _, + ) + .ok() + } + } + pub unsafe fn SetResultText(&self, resulttext: P0) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).SetResultText)( + windows_core::Interface::as_raw(self), + resulttext.param().abi(), + ) + .ok() + } + } + pub unsafe fn GetDeferral(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).GetDeferral)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2ScriptDialogOpeningEventArgs_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Uri: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub Kind: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_SCRIPT_DIALOG_KIND, + ) -> windows_core::HRESULT, + pub Message: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub Accept: unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT, + pub DefaultText: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub ResultText: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub SetResultText: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + ) -> windows_core::HRESULT, + pub GetDeferral: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2ScriptDialogOpeningEventArgs_Impl: windows_core::IUnknownImpl { + fn Uri(&self, uri: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn Kind(&self, kind: *mut COREWEBVIEW2_SCRIPT_DIALOG_KIND) -> windows_core::Result<()>; + fn Message(&self, message: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn Accept(&self) -> windows_core::Result<()>; + fn DefaultText(&self, defaulttext: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn ResultText(&self, resulttext: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn SetResultText(&self, resulttext: &windows_core::PCWSTR) -> windows_core::Result<()>; + fn GetDeferral(&self) -> windows_core::Result; +} +impl ICoreWebView2ScriptDialogOpeningEventArgs_Vtbl { + pub const fn new< + Identity: ICoreWebView2ScriptDialogOpeningEventArgs_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Uri< + Identity: ICoreWebView2ScriptDialogOpeningEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + uri: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ScriptDialogOpeningEventArgs_Impl::Uri( + this, + core::mem::transmute_copy(&uri), + ) + .into() + } + } + unsafe extern "system" fn Kind< + Identity: ICoreWebView2ScriptDialogOpeningEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + kind: *mut COREWEBVIEW2_SCRIPT_DIALOG_KIND, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ScriptDialogOpeningEventArgs_Impl::Kind( + this, + core::mem::transmute_copy(&kind), + ) + .into() + } + } + unsafe extern "system" fn Message< + Identity: ICoreWebView2ScriptDialogOpeningEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + message: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ScriptDialogOpeningEventArgs_Impl::Message( + this, + core::mem::transmute_copy(&message), + ) + .into() + } + } + unsafe extern "system" fn Accept< + Identity: ICoreWebView2ScriptDialogOpeningEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ScriptDialogOpeningEventArgs_Impl::Accept(this).into() + } + } + unsafe extern "system" fn DefaultText< + Identity: ICoreWebView2ScriptDialogOpeningEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + defaulttext: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ScriptDialogOpeningEventArgs_Impl::DefaultText( + this, + core::mem::transmute_copy(&defaulttext), + ) + .into() + } + } + unsafe extern "system" fn ResultText< + Identity: ICoreWebView2ScriptDialogOpeningEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + resulttext: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ScriptDialogOpeningEventArgs_Impl::ResultText( + this, + core::mem::transmute_copy(&resulttext), + ) + .into() + } + } + unsafe extern "system" fn SetResultText< + Identity: ICoreWebView2ScriptDialogOpeningEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + resulttext: windows_core::PCWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ScriptDialogOpeningEventArgs_Impl::SetResultText( + this, + core::mem::transmute(&resulttext), + ) + .into() + } + } + unsafe extern "system" fn GetDeferral< + Identity: ICoreWebView2ScriptDialogOpeningEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + deferral: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2ScriptDialogOpeningEventArgs_Impl::GetDeferral(this) { + Ok(ok__) => { + deferral.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Uri: Uri::, + Kind: Kind::, + Message: Message::, + Accept: Accept::, + DefaultText: DefaultText::, + ResultText: ResultText::, + SetResultText: SetResultText::, + GetDeferral: GetDeferral::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2ScriptDialogOpeningEventArgs {} +windows_core::imp::define_interface!( + ICoreWebView2ScriptDialogOpeningEventHandler, + ICoreWebView2ScriptDialogOpeningEventHandler_Vtbl, + 0xef381bf9_afa8_4e37_91c4_8ac48524bdfb +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2ScriptDialogOpeningEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2ScriptDialogOpeningEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2ScriptDialogOpeningEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2ScriptDialogOpeningEventHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2>, + args: windows_core::Ref<'_, ICoreWebView2ScriptDialogOpeningEventArgs>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2ScriptDialogOpeningEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2ScriptDialogOpeningEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2ScriptDialogOpeningEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ScriptDialogOpeningEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2ScriptDialogOpeningEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2ScriptException, + ICoreWebView2ScriptException_Vtbl, + 0x054dae00_84a3_49ff_bc17_4012a90bc9fd +); +windows_core::imp::interface_hierarchy!(ICoreWebView2ScriptException, windows_core::IUnknown); +impl ICoreWebView2ScriptException { + pub unsafe fn LineNumber(&self, value: *mut u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).LineNumber)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn ColumnNumber(&self, value: *mut u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ColumnNumber)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn Name(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Name)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn Message(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Message)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn ToJson(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ToJson)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2ScriptException_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub LineNumber: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut u32) -> windows_core::HRESULT, + pub ColumnNumber: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut u32) -> windows_core::HRESULT, + pub Name: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub Message: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub ToJson: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2ScriptException_Impl: windows_core::IUnknownImpl { + fn LineNumber(&self, value: *mut u32) -> windows_core::Result<()>; + fn ColumnNumber(&self, value: *mut u32) -> windows_core::Result<()>; + fn Name(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn Message(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn ToJson(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; +} +impl ICoreWebView2ScriptException_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn LineNumber< + Identity: ICoreWebView2ScriptException_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ScriptException_Impl::LineNumber( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn ColumnNumber< + Identity: ICoreWebView2ScriptException_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ScriptException_Impl::ColumnNumber( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn Name< + Identity: ICoreWebView2ScriptException_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ScriptException_Impl::Name(this, core::mem::transmute_copy(&value)) + .into() + } + } + unsafe extern "system" fn Message< + Identity: ICoreWebView2ScriptException_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ScriptException_Impl::Message(this, core::mem::transmute_copy(&value)) + .into() + } + } + unsafe extern "system" fn ToJson< + Identity: ICoreWebView2ScriptException_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ScriptException_Impl::ToJson(this, core::mem::transmute_copy(&value)) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + LineNumber: LineNumber::, + ColumnNumber: ColumnNumber::, + Name: Name::, + Message: Message::, + ToJson: ToJson::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2ScriptException {} +windows_core::imp::define_interface!( + ICoreWebView2ServerCertificateErrorDetectedEventArgs, + ICoreWebView2ServerCertificateErrorDetectedEventArgs_Vtbl, + 0x012193ed_7c13_48ff_969d_a84c1f432a14 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2ServerCertificateErrorDetectedEventArgs, + windows_core::IUnknown +); +impl ICoreWebView2ServerCertificateErrorDetectedEventArgs { + pub unsafe fn ErrorStatus( + &self, + value: *mut COREWEBVIEW2_WEB_ERROR_STATUS, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ErrorStatus)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn RequestUri(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).RequestUri)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn ServerCertificate(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).ServerCertificate)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } + pub unsafe fn Action( + &self, + value: *mut COREWEBVIEW2_SERVER_CERTIFICATE_ERROR_ACTION, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Action)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetAction( + &self, + value: COREWEBVIEW2_SERVER_CERTIFICATE_ERROR_ACTION, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetAction)( + windows_core::Interface::as_raw(self), + value, + ) + .ok() + } + } + pub unsafe fn GetDeferral(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).GetDeferral)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2ServerCertificateErrorDetectedEventArgs_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub ErrorStatus: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_WEB_ERROR_STATUS, + ) -> windows_core::HRESULT, + pub RequestUri: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub ServerCertificate: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub Action: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_SERVER_CERTIFICATE_ERROR_ACTION, + ) -> windows_core::HRESULT, + pub SetAction: unsafe extern "system" fn( + *mut core::ffi::c_void, + COREWEBVIEW2_SERVER_CERTIFICATE_ERROR_ACTION, + ) -> windows_core::HRESULT, + pub GetDeferral: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2ServerCertificateErrorDetectedEventArgs_Impl: + windows_core::IUnknownImpl +{ + fn ErrorStatus(&self, value: *mut COREWEBVIEW2_WEB_ERROR_STATUS) -> windows_core::Result<()>; + fn RequestUri(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn ServerCertificate(&self) -> windows_core::Result; + fn Action( + &self, + value: *mut COREWEBVIEW2_SERVER_CERTIFICATE_ERROR_ACTION, + ) -> windows_core::Result<()>; + fn SetAction( + &self, + value: COREWEBVIEW2_SERVER_CERTIFICATE_ERROR_ACTION, + ) -> windows_core::Result<()>; + fn GetDeferral(&self) -> windows_core::Result; +} +impl ICoreWebView2ServerCertificateErrorDetectedEventArgs_Vtbl { + pub const fn new< + Identity: ICoreWebView2ServerCertificateErrorDetectedEventArgs_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn ErrorStatus< + Identity: ICoreWebView2ServerCertificateErrorDetectedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut COREWEBVIEW2_WEB_ERROR_STATUS, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ServerCertificateErrorDetectedEventArgs_Impl::ErrorStatus( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn RequestUri< + Identity: ICoreWebView2ServerCertificateErrorDetectedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ServerCertificateErrorDetectedEventArgs_Impl::RequestUri( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn ServerCertificate< + Identity: ICoreWebView2ServerCertificateErrorDetectedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2ServerCertificateErrorDetectedEventArgs_Impl::ServerCertificate( + this, + ) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + unsafe extern "system" fn Action< + Identity: ICoreWebView2ServerCertificateErrorDetectedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut COREWEBVIEW2_SERVER_CERTIFICATE_ERROR_ACTION, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ServerCertificateErrorDetectedEventArgs_Impl::Action( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetAction< + Identity: ICoreWebView2ServerCertificateErrorDetectedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: COREWEBVIEW2_SERVER_CERTIFICATE_ERROR_ACTION, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ServerCertificateErrorDetectedEventArgs_Impl::SetAction( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn GetDeferral< + Identity: ICoreWebView2ServerCertificateErrorDetectedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + deferral: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2ServerCertificateErrorDetectedEventArgs_Impl::GetDeferral(this) { + Ok(ok__) => { + deferral.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + ErrorStatus: ErrorStatus::, + RequestUri: RequestUri::, + ServerCertificate: ServerCertificate::, + Action: Action::, + SetAction: SetAction::, + GetDeferral: GetDeferral::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == & < ICoreWebView2ServerCertificateErrorDetectedEventArgs as windows_core::Interface >::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2ServerCertificateErrorDetectedEventArgs {} +windows_core::imp::define_interface!( + ICoreWebView2ServerCertificateErrorDetectedEventHandler, + ICoreWebView2ServerCertificateErrorDetectedEventHandler_Vtbl, + 0x969b3a26_d85e_4795_8199_fef57344da22 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2ServerCertificateErrorDetectedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2ServerCertificateErrorDetectedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2ServerCertificateErrorDetectedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2ServerCertificateErrorDetectedEventHandler_Impl: + windows_core::IUnknownImpl +{ + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2>, + args: windows_core::Ref<'_, ICoreWebView2ServerCertificateErrorDetectedEventArgs>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2ServerCertificateErrorDetectedEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2ServerCertificateErrorDetectedEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2ServerCertificateErrorDetectedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ServerCertificateErrorDetectedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == & < ICoreWebView2ServerCertificateErrorDetectedEventHandler as windows_core::Interface >::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2ServerCertificateErrorDetectedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2SetPermissionStateCompletedHandler, + ICoreWebView2SetPermissionStateCompletedHandler_Vtbl, + 0xfc77fb30_9c9e_4076_b8c7_7644a703ca1b +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2SetPermissionStateCompletedHandler, + windows_core::IUnknown +); +impl ICoreWebView2SetPermissionStateCompletedHandler { + pub unsafe fn Invoke(&self, errorcode: windows_core::HRESULT) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + errorcode, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2SetPermissionStateCompletedHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::HRESULT, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2SetPermissionStateCompletedHandler_Impl: windows_core::IUnknownImpl { + fn Invoke(&self, errorcode: windows_core::HRESULT) -> windows_core::Result<()>; +} +impl ICoreWebView2SetPermissionStateCompletedHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2SetPermissionStateCompletedHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2SetPermissionStateCompletedHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + errorcode: windows_core::HRESULT, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2SetPermissionStateCompletedHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&errorcode), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2SetPermissionStateCompletedHandler {} +windows_core::imp::define_interface!( + ICoreWebView2Settings, + ICoreWebView2Settings_Vtbl, + 0xe562e4f0_d7fa_43ac_8d71_c05150499f00 +); +windows_core::imp::interface_hierarchy!(ICoreWebView2Settings, windows_core::IUnknown); +impl ICoreWebView2Settings { + pub unsafe fn IsScriptEnabled( + &self, + isscriptenabled: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).IsScriptEnabled)( + windows_core::Interface::as_raw(self), + isscriptenabled as _, + ) + .ok() + } + } + pub unsafe fn SetIsScriptEnabled(&self, isscriptenabled: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetIsScriptEnabled)( + windows_core::Interface::as_raw(self), + isscriptenabled.into(), + ) + .ok() + } + } + pub unsafe fn IsWebMessageEnabled( + &self, + iswebmessageenabled: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).IsWebMessageEnabled)( + windows_core::Interface::as_raw(self), + iswebmessageenabled as _, + ) + .ok() + } + } + pub unsafe fn SetIsWebMessageEnabled( + &self, + iswebmessageenabled: bool, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetIsWebMessageEnabled)( + windows_core::Interface::as_raw(self), + iswebmessageenabled.into(), + ) + .ok() + } + } + pub unsafe fn AreDefaultScriptDialogsEnabled( + &self, + aredefaultscriptdialogsenabled: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).AreDefaultScriptDialogsEnabled)( + windows_core::Interface::as_raw(self), + aredefaultscriptdialogsenabled as _, + ) + .ok() + } + } + pub unsafe fn SetAreDefaultScriptDialogsEnabled( + &self, + aredefaultscriptdialogsenabled: bool, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetAreDefaultScriptDialogsEnabled)( + windows_core::Interface::as_raw(self), + aredefaultscriptdialogsenabled.into(), + ) + .ok() + } + } + pub unsafe fn IsStatusBarEnabled( + &self, + isstatusbarenabled: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).IsStatusBarEnabled)( + windows_core::Interface::as_raw(self), + isstatusbarenabled as _, + ) + .ok() + } + } + pub unsafe fn SetIsStatusBarEnabled( + &self, + isstatusbarenabled: bool, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetIsStatusBarEnabled)( + windows_core::Interface::as_raw(self), + isstatusbarenabled.into(), + ) + .ok() + } + } + pub unsafe fn AreDevToolsEnabled( + &self, + aredevtoolsenabled: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).AreDevToolsEnabled)( + windows_core::Interface::as_raw(self), + aredevtoolsenabled as _, + ) + .ok() + } + } + pub unsafe fn SetAreDevToolsEnabled( + &self, + aredevtoolsenabled: bool, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetAreDevToolsEnabled)( + windows_core::Interface::as_raw(self), + aredevtoolsenabled.into(), + ) + .ok() + } + } + pub unsafe fn AreDefaultContextMenusEnabled( + &self, + enabled: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).AreDefaultContextMenusEnabled)( + windows_core::Interface::as_raw(self), + enabled as _, + ) + .ok() + } + } + pub unsafe fn SetAreDefaultContextMenusEnabled( + &self, + enabled: bool, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetAreDefaultContextMenusEnabled)( + windows_core::Interface::as_raw(self), + enabled.into(), + ) + .ok() + } + } + pub unsafe fn AreHostObjectsAllowed( + &self, + allowed: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).AreHostObjectsAllowed)( + windows_core::Interface::as_raw(self), + allowed as _, + ) + .ok() + } + } + pub unsafe fn SetAreHostObjectsAllowed(&self, allowed: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetAreHostObjectsAllowed)( + windows_core::Interface::as_raw(self), + allowed.into(), + ) + .ok() + } + } + pub unsafe fn IsZoomControlEnabled( + &self, + enabled: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).IsZoomControlEnabled)( + windows_core::Interface::as_raw(self), + enabled as _, + ) + .ok() + } + } + pub unsafe fn SetIsZoomControlEnabled(&self, enabled: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetIsZoomControlEnabled)( + windows_core::Interface::as_raw(self), + enabled.into(), + ) + .ok() + } + } + pub unsafe fn IsBuiltInErrorPageEnabled( + &self, + enabled: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).IsBuiltInErrorPageEnabled)( + windows_core::Interface::as_raw(self), + enabled as _, + ) + .ok() + } + } + pub unsafe fn SetIsBuiltInErrorPageEnabled(&self, enabled: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetIsBuiltInErrorPageEnabled)( + windows_core::Interface::as_raw(self), + enabled.into(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Settings_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub IsScriptEnabled: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetIsScriptEnabled: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, + pub IsWebMessageEnabled: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetIsWebMessageEnabled: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, + pub AreDefaultScriptDialogsEnabled: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetAreDefaultScriptDialogsEnabled: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, + pub IsStatusBarEnabled: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetIsStatusBarEnabled: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, + pub AreDevToolsEnabled: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetAreDevToolsEnabled: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, + pub AreDefaultContextMenusEnabled: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetAreDefaultContextMenusEnabled: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, + pub AreHostObjectsAllowed: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetAreHostObjectsAllowed: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, + pub IsZoomControlEnabled: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetIsZoomControlEnabled: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, + pub IsBuiltInErrorPageEnabled: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetIsBuiltInErrorPageEnabled: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Settings_Impl: windows_core::IUnknownImpl { + fn IsScriptEnabled(&self, isscriptenabled: *mut windows_core::BOOL) + -> windows_core::Result<()>; + fn SetIsScriptEnabled(&self, isscriptenabled: windows_core::BOOL) -> windows_core::Result<()>; + fn IsWebMessageEnabled( + &self, + iswebmessageenabled: *mut windows_core::BOOL, + ) -> windows_core::Result<()>; + fn SetIsWebMessageEnabled( + &self, + iswebmessageenabled: windows_core::BOOL, + ) -> windows_core::Result<()>; + fn AreDefaultScriptDialogsEnabled( + &self, + aredefaultscriptdialogsenabled: *mut windows_core::BOOL, + ) -> windows_core::Result<()>; + fn SetAreDefaultScriptDialogsEnabled( + &self, + aredefaultscriptdialogsenabled: windows_core::BOOL, + ) -> windows_core::Result<()>; + fn IsStatusBarEnabled( + &self, + isstatusbarenabled: *mut windows_core::BOOL, + ) -> windows_core::Result<()>; + fn SetIsStatusBarEnabled( + &self, + isstatusbarenabled: windows_core::BOOL, + ) -> windows_core::Result<()>; + fn AreDevToolsEnabled( + &self, + aredevtoolsenabled: *mut windows_core::BOOL, + ) -> windows_core::Result<()>; + fn SetAreDevToolsEnabled( + &self, + aredevtoolsenabled: windows_core::BOOL, + ) -> windows_core::Result<()>; + fn AreDefaultContextMenusEnabled( + &self, + enabled: *mut windows_core::BOOL, + ) -> windows_core::Result<()>; + fn SetAreDefaultContextMenusEnabled( + &self, + enabled: windows_core::BOOL, + ) -> windows_core::Result<()>; + fn AreHostObjectsAllowed(&self, allowed: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn SetAreHostObjectsAllowed(&self, allowed: windows_core::BOOL) -> windows_core::Result<()>; + fn IsZoomControlEnabled(&self, enabled: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn SetIsZoomControlEnabled(&self, enabled: windows_core::BOOL) -> windows_core::Result<()>; + fn IsBuiltInErrorPageEnabled( + &self, + enabled: *mut windows_core::BOOL, + ) -> windows_core::Result<()>; + fn SetIsBuiltInErrorPageEnabled(&self, enabled: windows_core::BOOL) + -> windows_core::Result<()>; +} +impl ICoreWebView2Settings_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn IsScriptEnabled< + Identity: ICoreWebView2Settings_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + isscriptenabled: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Settings_Impl::IsScriptEnabled( + this, + core::mem::transmute_copy(&isscriptenabled), + ) + .into() + } + } + unsafe extern "system" fn SetIsScriptEnabled< + Identity: ICoreWebView2Settings_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + isscriptenabled: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Settings_Impl::SetIsScriptEnabled( + this, + core::mem::transmute_copy(&isscriptenabled), + ) + .into() + } + } + unsafe extern "system" fn IsWebMessageEnabled< + Identity: ICoreWebView2Settings_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + iswebmessageenabled: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Settings_Impl::IsWebMessageEnabled( + this, + core::mem::transmute_copy(&iswebmessageenabled), + ) + .into() + } + } + unsafe extern "system" fn SetIsWebMessageEnabled< + Identity: ICoreWebView2Settings_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + iswebmessageenabled: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Settings_Impl::SetIsWebMessageEnabled( + this, + core::mem::transmute_copy(&iswebmessageenabled), + ) + .into() + } + } + unsafe extern "system" fn AreDefaultScriptDialogsEnabled< + Identity: ICoreWebView2Settings_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + aredefaultscriptdialogsenabled: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Settings_Impl::AreDefaultScriptDialogsEnabled( + this, + core::mem::transmute_copy(&aredefaultscriptdialogsenabled), + ) + .into() + } + } + unsafe extern "system" fn SetAreDefaultScriptDialogsEnabled< + Identity: ICoreWebView2Settings_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + aredefaultscriptdialogsenabled: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Settings_Impl::SetAreDefaultScriptDialogsEnabled( + this, + core::mem::transmute_copy(&aredefaultscriptdialogsenabled), + ) + .into() + } + } + unsafe extern "system" fn IsStatusBarEnabled< + Identity: ICoreWebView2Settings_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + isstatusbarenabled: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Settings_Impl::IsStatusBarEnabled( + this, + core::mem::transmute_copy(&isstatusbarenabled), + ) + .into() + } + } + unsafe extern "system" fn SetIsStatusBarEnabled< + Identity: ICoreWebView2Settings_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + isstatusbarenabled: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Settings_Impl::SetIsStatusBarEnabled( + this, + core::mem::transmute_copy(&isstatusbarenabled), + ) + .into() + } + } + unsafe extern "system" fn AreDevToolsEnabled< + Identity: ICoreWebView2Settings_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + aredevtoolsenabled: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Settings_Impl::AreDevToolsEnabled( + this, + core::mem::transmute_copy(&aredevtoolsenabled), + ) + .into() + } + } + unsafe extern "system" fn SetAreDevToolsEnabled< + Identity: ICoreWebView2Settings_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + aredevtoolsenabled: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Settings_Impl::SetAreDevToolsEnabled( + this, + core::mem::transmute_copy(&aredevtoolsenabled), + ) + .into() + } + } + unsafe extern "system" fn AreDefaultContextMenusEnabled< + Identity: ICoreWebView2Settings_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + enabled: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Settings_Impl::AreDefaultContextMenusEnabled( + this, + core::mem::transmute_copy(&enabled), + ) + .into() + } + } + unsafe extern "system" fn SetAreDefaultContextMenusEnabled< + Identity: ICoreWebView2Settings_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + enabled: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Settings_Impl::SetAreDefaultContextMenusEnabled( + this, + core::mem::transmute_copy(&enabled), + ) + .into() + } + } + unsafe extern "system" fn AreHostObjectsAllowed< + Identity: ICoreWebView2Settings_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + allowed: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Settings_Impl::AreHostObjectsAllowed( + this, + core::mem::transmute_copy(&allowed), + ) + .into() + } + } + unsafe extern "system" fn SetAreHostObjectsAllowed< + Identity: ICoreWebView2Settings_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + allowed: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Settings_Impl::SetAreHostObjectsAllowed( + this, + core::mem::transmute_copy(&allowed), + ) + .into() + } + } + unsafe extern "system" fn IsZoomControlEnabled< + Identity: ICoreWebView2Settings_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + enabled: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Settings_Impl::IsZoomControlEnabled( + this, + core::mem::transmute_copy(&enabled), + ) + .into() + } + } + unsafe extern "system" fn SetIsZoomControlEnabled< + Identity: ICoreWebView2Settings_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + enabled: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Settings_Impl::SetIsZoomControlEnabled( + this, + core::mem::transmute_copy(&enabled), + ) + .into() + } + } + unsafe extern "system" fn IsBuiltInErrorPageEnabled< + Identity: ICoreWebView2Settings_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + enabled: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Settings_Impl::IsBuiltInErrorPageEnabled( + this, + core::mem::transmute_copy(&enabled), + ) + .into() + } + } + unsafe extern "system" fn SetIsBuiltInErrorPageEnabled< + Identity: ICoreWebView2Settings_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + enabled: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Settings_Impl::SetIsBuiltInErrorPageEnabled( + this, + core::mem::transmute_copy(&enabled), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + IsScriptEnabled: IsScriptEnabled::, + SetIsScriptEnabled: SetIsScriptEnabled::, + IsWebMessageEnabled: IsWebMessageEnabled::, + SetIsWebMessageEnabled: SetIsWebMessageEnabled::, + AreDefaultScriptDialogsEnabled: AreDefaultScriptDialogsEnabled::, + SetAreDefaultScriptDialogsEnabled: SetAreDefaultScriptDialogsEnabled::, + IsStatusBarEnabled: IsStatusBarEnabled::, + SetIsStatusBarEnabled: SetIsStatusBarEnabled::, + AreDevToolsEnabled: AreDevToolsEnabled::, + SetAreDevToolsEnabled: SetAreDevToolsEnabled::, + AreDefaultContextMenusEnabled: AreDefaultContextMenusEnabled::, + SetAreDefaultContextMenusEnabled: SetAreDefaultContextMenusEnabled::, + AreHostObjectsAllowed: AreHostObjectsAllowed::, + SetAreHostObjectsAllowed: SetAreHostObjectsAllowed::, + IsZoomControlEnabled: IsZoomControlEnabled::, + SetIsZoomControlEnabled: SetIsZoomControlEnabled::, + IsBuiltInErrorPageEnabled: IsBuiltInErrorPageEnabled::, + SetIsBuiltInErrorPageEnabled: SetIsBuiltInErrorPageEnabled::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Settings {} +windows_core::imp::define_interface!( + ICoreWebView2Settings2, + ICoreWebView2Settings2_Vtbl, + 0xee9a0f68_f46c_4e32_ac23_ef8cac224d2a +); +impl core::ops::Deref for ICoreWebView2Settings2 { + type Target = ICoreWebView2Settings; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2Settings2, + windows_core::IUnknown, + ICoreWebView2Settings +); +impl ICoreWebView2Settings2 { + pub unsafe fn UserAgent(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).UserAgent)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetUserAgent(&self, value: P0) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).SetUserAgent)( + windows_core::Interface::as_raw(self), + value.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Settings2_Vtbl { + pub base__: ICoreWebView2Settings_Vtbl, + pub UserAgent: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub SetUserAgent: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Settings2_Impl: ICoreWebView2Settings_Impl { + fn UserAgent(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn SetUserAgent(&self, value: &windows_core::PCWSTR) -> windows_core::Result<()>; +} +impl ICoreWebView2Settings2_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn UserAgent< + Identity: ICoreWebView2Settings2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Settings2_Impl::UserAgent(this, core::mem::transmute_copy(&value)) + .into() + } + } + unsafe extern "system" fn SetUserAgent< + Identity: ICoreWebView2Settings2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::PCWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Settings2_Impl::SetUserAgent(this, core::mem::transmute(&value)).into() + } + } + Self { + base__: ICoreWebView2Settings_Vtbl::new::(), + UserAgent: UserAgent::, + SetUserAgent: SetUserAgent::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Settings2 {} +windows_core::imp::define_interface!( + ICoreWebView2Settings3, + ICoreWebView2Settings3_Vtbl, + 0xfdb5ab74_af33_4854_84f0_0a631deb5eba +); +impl core::ops::Deref for ICoreWebView2Settings3 { + type Target = ICoreWebView2Settings2; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2Settings3, + windows_core::IUnknown, + ICoreWebView2Settings, + ICoreWebView2Settings2 +); +impl ICoreWebView2Settings3 { + pub unsafe fn AreBrowserAcceleratorKeysEnabled( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).AreBrowserAcceleratorKeysEnabled)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetAreBrowserAcceleratorKeysEnabled( + &self, + value: bool, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetAreBrowserAcceleratorKeysEnabled)( + windows_core::Interface::as_raw(self), + value.into(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Settings3_Vtbl { + pub base__: ICoreWebView2Settings2_Vtbl, + pub AreBrowserAcceleratorKeysEnabled: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetAreBrowserAcceleratorKeysEnabled: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) + -> windows_core::HRESULT, +} +pub trait ICoreWebView2Settings3_Impl: ICoreWebView2Settings2_Impl { + fn AreBrowserAcceleratorKeysEnabled( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()>; + fn SetAreBrowserAcceleratorKeysEnabled( + &self, + value: windows_core::BOOL, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2Settings3_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn AreBrowserAcceleratorKeysEnabled< + Identity: ICoreWebView2Settings3_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Settings3_Impl::AreBrowserAcceleratorKeysEnabled( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetAreBrowserAcceleratorKeysEnabled< + Identity: ICoreWebView2Settings3_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Settings3_Impl::SetAreBrowserAcceleratorKeysEnabled( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: ICoreWebView2Settings2_Vtbl::new::(), + AreBrowserAcceleratorKeysEnabled: AreBrowserAcceleratorKeysEnabled::, + SetAreBrowserAcceleratorKeysEnabled: SetAreBrowserAcceleratorKeysEnabled::< + Identity, + OFFSET, + >, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Settings3 {} +windows_core::imp::define_interface!( + ICoreWebView2Settings4, + ICoreWebView2Settings4_Vtbl, + 0xcb56846c_4168_4d53_b04f_03b6d6796ff2 +); +impl core::ops::Deref for ICoreWebView2Settings4 { + type Target = ICoreWebView2Settings3; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2Settings4, + windows_core::IUnknown, + ICoreWebView2Settings, + ICoreWebView2Settings2, + ICoreWebView2Settings3 +); +impl ICoreWebView2Settings4 { + pub unsafe fn IsPasswordAutosaveEnabled( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).IsPasswordAutosaveEnabled)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetIsPasswordAutosaveEnabled(&self, value: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetIsPasswordAutosaveEnabled)( + windows_core::Interface::as_raw(self), + value.into(), + ) + .ok() + } + } + pub unsafe fn IsGeneralAutofillEnabled( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).IsGeneralAutofillEnabled)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetIsGeneralAutofillEnabled(&self, value: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetIsGeneralAutofillEnabled)( + windows_core::Interface::as_raw(self), + value.into(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Settings4_Vtbl { + pub base__: ICoreWebView2Settings3_Vtbl, + pub IsPasswordAutosaveEnabled: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetIsPasswordAutosaveEnabled: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, + pub IsGeneralAutofillEnabled: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetIsGeneralAutofillEnabled: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Settings4_Impl: ICoreWebView2Settings3_Impl { + fn IsPasswordAutosaveEnabled(&self, value: *mut windows_core::BOOL) + -> windows_core::Result<()>; + fn SetIsPasswordAutosaveEnabled(&self, value: windows_core::BOOL) -> windows_core::Result<()>; + fn IsGeneralAutofillEnabled(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn SetIsGeneralAutofillEnabled(&self, value: windows_core::BOOL) -> windows_core::Result<()>; +} +impl ICoreWebView2Settings4_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn IsPasswordAutosaveEnabled< + Identity: ICoreWebView2Settings4_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Settings4_Impl::IsPasswordAutosaveEnabled( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetIsPasswordAutosaveEnabled< + Identity: ICoreWebView2Settings4_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Settings4_Impl::SetIsPasswordAutosaveEnabled( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn IsGeneralAutofillEnabled< + Identity: ICoreWebView2Settings4_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Settings4_Impl::IsGeneralAutofillEnabled( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetIsGeneralAutofillEnabled< + Identity: ICoreWebView2Settings4_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Settings4_Impl::SetIsGeneralAutofillEnabled( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: ICoreWebView2Settings3_Vtbl::new::(), + IsPasswordAutosaveEnabled: IsPasswordAutosaveEnabled::, + SetIsPasswordAutosaveEnabled: SetIsPasswordAutosaveEnabled::, + IsGeneralAutofillEnabled: IsGeneralAutofillEnabled::, + SetIsGeneralAutofillEnabled: SetIsGeneralAutofillEnabled::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Settings4 {} +windows_core::imp::define_interface!( + ICoreWebView2Settings5, + ICoreWebView2Settings5_Vtbl, + 0x183e7052_1d03_43a0_ab99_98e043b66b39 +); +impl core::ops::Deref for ICoreWebView2Settings5 { + type Target = ICoreWebView2Settings4; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2Settings5, + windows_core::IUnknown, + ICoreWebView2Settings, + ICoreWebView2Settings2, + ICoreWebView2Settings3, + ICoreWebView2Settings4 +); +impl ICoreWebView2Settings5 { + pub unsafe fn IsPinchZoomEnabled( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).IsPinchZoomEnabled)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetIsPinchZoomEnabled(&self, value: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetIsPinchZoomEnabled)( + windows_core::Interface::as_raw(self), + value.into(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Settings5_Vtbl { + pub base__: ICoreWebView2Settings4_Vtbl, + pub IsPinchZoomEnabled: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetIsPinchZoomEnabled: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Settings5_Impl: ICoreWebView2Settings4_Impl { + fn IsPinchZoomEnabled(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn SetIsPinchZoomEnabled(&self, value: windows_core::BOOL) -> windows_core::Result<()>; +} +impl ICoreWebView2Settings5_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn IsPinchZoomEnabled< + Identity: ICoreWebView2Settings5_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Settings5_Impl::IsPinchZoomEnabled( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetIsPinchZoomEnabled< + Identity: ICoreWebView2Settings5_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Settings5_Impl::SetIsPinchZoomEnabled( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: ICoreWebView2Settings4_Vtbl::new::(), + IsPinchZoomEnabled: IsPinchZoomEnabled::, + SetIsPinchZoomEnabled: SetIsPinchZoomEnabled::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Settings5 {} +windows_core::imp::define_interface!( + ICoreWebView2Settings6, + ICoreWebView2Settings6_Vtbl, + 0x11cb3acd_9bc8_43b8_83bf_f40753714f87 +); +impl core::ops::Deref for ICoreWebView2Settings6 { + type Target = ICoreWebView2Settings5; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2Settings6, + windows_core::IUnknown, + ICoreWebView2Settings, + ICoreWebView2Settings2, + ICoreWebView2Settings3, + ICoreWebView2Settings4, + ICoreWebView2Settings5 +); +impl ICoreWebView2Settings6 { + pub unsafe fn IsSwipeNavigationEnabled( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).IsSwipeNavigationEnabled)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetIsSwipeNavigationEnabled(&self, value: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetIsSwipeNavigationEnabled)( + windows_core::Interface::as_raw(self), + value.into(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Settings6_Vtbl { + pub base__: ICoreWebView2Settings5_Vtbl, + pub IsSwipeNavigationEnabled: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetIsSwipeNavigationEnabled: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Settings6_Impl: ICoreWebView2Settings5_Impl { + fn IsSwipeNavigationEnabled(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn SetIsSwipeNavigationEnabled(&self, value: windows_core::BOOL) -> windows_core::Result<()>; +} +impl ICoreWebView2Settings6_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn IsSwipeNavigationEnabled< + Identity: ICoreWebView2Settings6_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Settings6_Impl::IsSwipeNavigationEnabled( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetIsSwipeNavigationEnabled< + Identity: ICoreWebView2Settings6_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Settings6_Impl::SetIsSwipeNavigationEnabled( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: ICoreWebView2Settings5_Vtbl::new::(), + IsSwipeNavigationEnabled: IsSwipeNavigationEnabled::, + SetIsSwipeNavigationEnabled: SetIsSwipeNavigationEnabled::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Settings6 {} +windows_core::imp::define_interface!( + ICoreWebView2Settings7, + ICoreWebView2Settings7_Vtbl, + 0x488dc902_35ef_42d2_bc7d_94b65c4bc49c +); +impl core::ops::Deref for ICoreWebView2Settings7 { + type Target = ICoreWebView2Settings6; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2Settings7, + windows_core::IUnknown, + ICoreWebView2Settings, + ICoreWebView2Settings2, + ICoreWebView2Settings3, + ICoreWebView2Settings4, + ICoreWebView2Settings5, + ICoreWebView2Settings6 +); +impl ICoreWebView2Settings7 { + pub unsafe fn HiddenPdfToolbarItems( + &self, + value: *mut COREWEBVIEW2_PDF_TOOLBAR_ITEMS, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).HiddenPdfToolbarItems)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetHiddenPdfToolbarItems( + &self, + value: COREWEBVIEW2_PDF_TOOLBAR_ITEMS, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetHiddenPdfToolbarItems)( + windows_core::Interface::as_raw(self), + value, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Settings7_Vtbl { + pub base__: ICoreWebView2Settings6_Vtbl, + pub HiddenPdfToolbarItems: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_PDF_TOOLBAR_ITEMS, + ) -> windows_core::HRESULT, + pub SetHiddenPdfToolbarItems: unsafe extern "system" fn( + *mut core::ffi::c_void, + COREWEBVIEW2_PDF_TOOLBAR_ITEMS, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Settings7_Impl: ICoreWebView2Settings6_Impl { + fn HiddenPdfToolbarItems( + &self, + value: *mut COREWEBVIEW2_PDF_TOOLBAR_ITEMS, + ) -> windows_core::Result<()>; + fn SetHiddenPdfToolbarItems( + &self, + value: COREWEBVIEW2_PDF_TOOLBAR_ITEMS, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2Settings7_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn HiddenPdfToolbarItems< + Identity: ICoreWebView2Settings7_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut COREWEBVIEW2_PDF_TOOLBAR_ITEMS, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Settings7_Impl::HiddenPdfToolbarItems( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetHiddenPdfToolbarItems< + Identity: ICoreWebView2Settings7_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: COREWEBVIEW2_PDF_TOOLBAR_ITEMS, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Settings7_Impl::SetHiddenPdfToolbarItems( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: ICoreWebView2Settings6_Vtbl::new::(), + HiddenPdfToolbarItems: HiddenPdfToolbarItems::, + SetHiddenPdfToolbarItems: SetHiddenPdfToolbarItems::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Settings7 {} +windows_core::imp::define_interface!( + ICoreWebView2Settings8, + ICoreWebView2Settings8_Vtbl, + 0x9e6b0e8f_86ad_4e81_8147_a9b5edb68650 +); +impl core::ops::Deref for ICoreWebView2Settings8 { + type Target = ICoreWebView2Settings7; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2Settings8, + windows_core::IUnknown, + ICoreWebView2Settings, + ICoreWebView2Settings2, + ICoreWebView2Settings3, + ICoreWebView2Settings4, + ICoreWebView2Settings5, + ICoreWebView2Settings6, + ICoreWebView2Settings7 +); +impl ICoreWebView2Settings8 { + pub unsafe fn IsReputationCheckingRequired( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).IsReputationCheckingRequired)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetIsReputationCheckingRequired(&self, value: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetIsReputationCheckingRequired)( + windows_core::Interface::as_raw(self), + value.into(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Settings8_Vtbl { + pub base__: ICoreWebView2Settings7_Vtbl, + pub IsReputationCheckingRequired: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetIsReputationCheckingRequired: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Settings8_Impl: ICoreWebView2Settings7_Impl { + fn IsReputationCheckingRequired( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()>; + fn SetIsReputationCheckingRequired( + &self, + value: windows_core::BOOL, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2Settings8_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn IsReputationCheckingRequired< + Identity: ICoreWebView2Settings8_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Settings8_Impl::IsReputationCheckingRequired( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetIsReputationCheckingRequired< + Identity: ICoreWebView2Settings8_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Settings8_Impl::SetIsReputationCheckingRequired( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: ICoreWebView2Settings7_Vtbl::new::(), + IsReputationCheckingRequired: IsReputationCheckingRequired::, + SetIsReputationCheckingRequired: SetIsReputationCheckingRequired::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Settings8 {} +windows_core::imp::define_interface!( + ICoreWebView2Settings9, + ICoreWebView2Settings9_Vtbl, + 0x0528a73b_e92d_49f4_927a_e547dddaa37d +); +impl core::ops::Deref for ICoreWebView2Settings9 { + type Target = ICoreWebView2Settings8; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2Settings9, + windows_core::IUnknown, + ICoreWebView2Settings, + ICoreWebView2Settings2, + ICoreWebView2Settings3, + ICoreWebView2Settings4, + ICoreWebView2Settings5, + ICoreWebView2Settings6, + ICoreWebView2Settings7, + ICoreWebView2Settings8 +); +impl ICoreWebView2Settings9 { + pub unsafe fn IsNonClientRegionSupportEnabled( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).IsNonClientRegionSupportEnabled)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetIsNonClientRegionSupportEnabled( + &self, + value: bool, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetIsNonClientRegionSupportEnabled)( + windows_core::Interface::as_raw(self), + value.into(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2Settings9_Vtbl { + pub base__: ICoreWebView2Settings8_Vtbl, + pub IsNonClientRegionSupportEnabled: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetIsNonClientRegionSupportEnabled: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2Settings9_Impl: ICoreWebView2Settings8_Impl { + fn IsNonClientRegionSupportEnabled( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()>; + fn SetIsNonClientRegionSupportEnabled( + &self, + value: windows_core::BOOL, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2Settings9_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn IsNonClientRegionSupportEnabled< + Identity: ICoreWebView2Settings9_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Settings9_Impl::IsNonClientRegionSupportEnabled( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetIsNonClientRegionSupportEnabled< + Identity: ICoreWebView2Settings9_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2Settings9_Impl::SetIsNonClientRegionSupportEnabled( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: ICoreWebView2Settings8_Vtbl::new::(), + IsNonClientRegionSupportEnabled: IsNonClientRegionSupportEnabled::, + SetIsNonClientRegionSupportEnabled: SetIsNonClientRegionSupportEnabled::< + Identity, + OFFSET, + >, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2Settings9 {} +windows_core::imp::define_interface!( + ICoreWebView2SharedBuffer, + ICoreWebView2SharedBuffer_Vtbl, + 0xb747a495_0c6f_449e_97b8_2f81e9d6ab43 +); +windows_core::imp::interface_hierarchy!(ICoreWebView2SharedBuffer, windows_core::IUnknown); +impl ICoreWebView2SharedBuffer { + pub unsafe fn Size(&self, value: *mut u64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Size)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn Buffer(&self, value: *mut *mut u8) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Buffer)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn OpenStream(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).OpenStream)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } + pub unsafe fn FileMappingHandle( + &self, + value: *mut windows::Win32::Foundation::HANDLE, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).FileMappingHandle)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn Close(&self) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Close)(windows_core::Interface::as_raw(self)) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2SharedBuffer_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Size: unsafe extern "system" fn(*mut core::ffi::c_void, *mut u64) -> windows_core::HRESULT, + pub Buffer: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut *mut u8) -> windows_core::HRESULT, + pub OpenStream: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub FileMappingHandle: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows::Win32::Foundation::HANDLE, + ) -> windows_core::HRESULT, + pub Close: unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT, +} +pub trait ICoreWebView2SharedBuffer_Impl: windows_core::IUnknownImpl { + fn Size(&self, value: *mut u64) -> windows_core::Result<()>; + fn Buffer(&self, value: *mut *mut u8) -> windows_core::Result<()>; + fn OpenStream(&self) -> windows_core::Result; + fn FileMappingHandle( + &self, + value: *mut windows::Win32::Foundation::HANDLE, + ) -> windows_core::Result<()>; + fn Close(&self) -> windows_core::Result<()>; +} +impl ICoreWebView2SharedBuffer_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn Size< + Identity: ICoreWebView2SharedBuffer_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut u64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2SharedBuffer_Impl::Size(this, core::mem::transmute_copy(&value)).into() + } + } + unsafe extern "system" fn Buffer< + Identity: ICoreWebView2SharedBuffer_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut *mut u8, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2SharedBuffer_Impl::Buffer(this, core::mem::transmute_copy(&value)) + .into() + } + } + unsafe extern "system" fn OpenStream< + Identity: ICoreWebView2SharedBuffer_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2SharedBuffer_Impl::OpenStream(this) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + unsafe extern "system" fn FileMappingHandle< + Identity: ICoreWebView2SharedBuffer_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows::Win32::Foundation::HANDLE, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2SharedBuffer_Impl::FileMappingHandle( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn Close< + Identity: ICoreWebView2SharedBuffer_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2SharedBuffer_Impl::Close(this).into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Size: Size::, + Buffer: Buffer::, + OpenStream: OpenStream::, + FileMappingHandle: FileMappingHandle::, + Close: Close::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2SharedBuffer {} +windows_core::imp::define_interface!( + ICoreWebView2ShowSaveAsUICompletedHandler, + ICoreWebView2ShowSaveAsUICompletedHandler_Vtbl, + 0xe24b07e3_8169_5c34_994a_7f6478946a3c +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2ShowSaveAsUICompletedHandler, + windows_core::IUnknown +); +impl ICoreWebView2ShowSaveAsUICompletedHandler { + pub unsafe fn Invoke( + &self, + errorcode: windows_core::HRESULT, + result: COREWEBVIEW2_SAVE_AS_UI_RESULT, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + errorcode, + result, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2ShowSaveAsUICompletedHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::HRESULT, + COREWEBVIEW2_SAVE_AS_UI_RESULT, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2ShowSaveAsUICompletedHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + errorcode: windows_core::HRESULT, + result: COREWEBVIEW2_SAVE_AS_UI_RESULT, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2ShowSaveAsUICompletedHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2ShowSaveAsUICompletedHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2ShowSaveAsUICompletedHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + errorcode: windows_core::HRESULT, + result: COREWEBVIEW2_SAVE_AS_UI_RESULT, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ShowSaveAsUICompletedHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&errorcode), + core::mem::transmute_copy(&result), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2ShowSaveAsUICompletedHandler {} +windows_core::imp::define_interface!( + ICoreWebView2SourceChangedEventArgs, + ICoreWebView2SourceChangedEventArgs_Vtbl, + 0x31e0e545_1dba_4266_8914_f63848a1f7d7 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2SourceChangedEventArgs, + windows_core::IUnknown +); +impl ICoreWebView2SourceChangedEventArgs { + pub unsafe fn IsNewDocument(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).IsNewDocument)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2SourceChangedEventArgs_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub IsNewDocument: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2SourceChangedEventArgs_Impl: windows_core::IUnknownImpl { + fn IsNewDocument(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; +} +impl ICoreWebView2SourceChangedEventArgs_Vtbl { + pub const fn new( + ) -> Self { + unsafe extern "system" fn IsNewDocument< + Identity: ICoreWebView2SourceChangedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2SourceChangedEventArgs_Impl::IsNewDocument( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + IsNewDocument: IsNewDocument::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2SourceChangedEventArgs {} +windows_core::imp::define_interface!( + ICoreWebView2SourceChangedEventHandler, + ICoreWebView2SourceChangedEventHandler_Vtbl, + 0x3c067f9f_5388_4772_8b48_79f7ef1ab37c +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2SourceChangedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2SourceChangedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2SourceChangedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2SourceChangedEventHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2>, + args: windows_core::Ref<'_, ICoreWebView2SourceChangedEventArgs>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2SourceChangedEventHandler_Vtbl { + pub const fn new( + ) -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2SourceChangedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2SourceChangedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2SourceChangedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2StateChangedEventHandler, + ICoreWebView2StateChangedEventHandler_Vtbl, + 0x81336594_7ede_4ba9_bf71_acf0a95b58dd +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2StateChangedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2StateChangedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2StateChangedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2StateChangedEventHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2DownloadOperation>, + args: windows_core::Ref<'_, windows_core::IUnknown>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2StateChangedEventHandler_Vtbl { + pub const fn new( + ) -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2StateChangedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2StateChangedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2StateChangedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2StatusBarTextChangedEventHandler, + ICoreWebView2StatusBarTextChangedEventHandler_Vtbl, + 0xa5e3b0d0_10df_4156_bfad_3b43867acac6 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2StatusBarTextChangedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2StatusBarTextChangedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2StatusBarTextChangedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2StatusBarTextChangedEventHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2>, + args: windows_core::Ref<'_, windows_core::IUnknown>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2StatusBarTextChangedEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2StatusBarTextChangedEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2StatusBarTextChangedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2StatusBarTextChangedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2StatusBarTextChangedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2StringCollection, + ICoreWebView2StringCollection_Vtbl, + 0xf41f3f8a_bcc3_11eb_8529_0242ac130003 +); +windows_core::imp::interface_hierarchy!(ICoreWebView2StringCollection, windows_core::IUnknown); +impl ICoreWebView2StringCollection { + pub unsafe fn Count(&self, value: *mut u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Count)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn GetValueAtIndex( + &self, + index: u32, + value: *mut windows_core::PWSTR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).GetValueAtIndex)( + windows_core::Interface::as_raw(self), + index, + value as _, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2StringCollection_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Count: unsafe extern "system" fn(*mut core::ffi::c_void, *mut u32) -> windows_core::HRESULT, + pub GetValueAtIndex: unsafe extern "system" fn( + *mut core::ffi::c_void, + u32, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2StringCollection_Impl: windows_core::IUnknownImpl { + fn Count(&self, value: *mut u32) -> windows_core::Result<()>; + fn GetValueAtIndex( + &self, + index: u32, + value: *mut windows_core::PWSTR, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2StringCollection_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn Count< + Identity: ICoreWebView2StringCollection_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2StringCollection_Impl::Count(this, core::mem::transmute_copy(&value)) + .into() + } + } + unsafe extern "system" fn GetValueAtIndex< + Identity: ICoreWebView2StringCollection_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + index: u32, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2StringCollection_Impl::GetValueAtIndex( + this, + core::mem::transmute_copy(&index), + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Count: Count::, + GetValueAtIndex: GetValueAtIndex::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2StringCollection {} +windows_core::imp::define_interface!( + ICoreWebView2TrySuspendCompletedHandler, + ICoreWebView2TrySuspendCompletedHandler_Vtbl, + 0x00f206a7_9d17_4605_91f6_4e8e4de192e3 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2TrySuspendCompletedHandler, + windows_core::IUnknown +); +impl ICoreWebView2TrySuspendCompletedHandler { + pub unsafe fn Invoke( + &self, + errorcode: windows_core::HRESULT, + result: bool, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + errorcode, + result.into(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2TrySuspendCompletedHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::HRESULT, + windows_core::BOOL, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2TrySuspendCompletedHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + errorcode: windows_core::HRESULT, + result: windows_core::BOOL, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2TrySuspendCompletedHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2TrySuspendCompletedHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2TrySuspendCompletedHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + errorcode: windows_core::HRESULT, + result: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2TrySuspendCompletedHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&errorcode), + core::mem::transmute_copy(&result), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2TrySuspendCompletedHandler {} +windows_core::imp::define_interface!( + ICoreWebView2WebMessageReceivedEventArgs, + ICoreWebView2WebMessageReceivedEventArgs_Vtbl, + 0x0f99a40c_e962_4207_9e92_e3d542eff849 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2WebMessageReceivedEventArgs, + windows_core::IUnknown +); +impl ICoreWebView2WebMessageReceivedEventArgs { + pub unsafe fn Source(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Source)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn WebMessageAsJson( + &self, + value: *mut windows_core::PWSTR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).WebMessageAsJson)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn TryGetWebMessageAsString( + &self, + value: *mut windows_core::PWSTR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).TryGetWebMessageAsString)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2WebMessageReceivedEventArgs_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Source: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub WebMessageAsJson: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub TryGetWebMessageAsString: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2WebMessageReceivedEventArgs_Impl: windows_core::IUnknownImpl { + fn Source(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn WebMessageAsJson(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn TryGetWebMessageAsString(&self, value: *mut windows_core::PWSTR) + -> windows_core::Result<()>; +} +impl ICoreWebView2WebMessageReceivedEventArgs_Vtbl { + pub const fn new< + Identity: ICoreWebView2WebMessageReceivedEventArgs_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Source< + Identity: ICoreWebView2WebMessageReceivedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2WebMessageReceivedEventArgs_Impl::Source( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn WebMessageAsJson< + Identity: ICoreWebView2WebMessageReceivedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2WebMessageReceivedEventArgs_Impl::WebMessageAsJson( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn TryGetWebMessageAsString< + Identity: ICoreWebView2WebMessageReceivedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2WebMessageReceivedEventArgs_Impl::TryGetWebMessageAsString( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Source: Source::, + WebMessageAsJson: WebMessageAsJson::, + TryGetWebMessageAsString: TryGetWebMessageAsString::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2WebMessageReceivedEventArgs {} +windows_core::imp::define_interface!( + ICoreWebView2WebMessageReceivedEventArgs2, + ICoreWebView2WebMessageReceivedEventArgs2_Vtbl, + 0x06fc7ab7_c90c_4297_9389_33ca01cf6d5e +); +impl core::ops::Deref for ICoreWebView2WebMessageReceivedEventArgs2 { + type Target = ICoreWebView2WebMessageReceivedEventArgs; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2WebMessageReceivedEventArgs2, + windows_core::IUnknown, + ICoreWebView2WebMessageReceivedEventArgs +); +impl ICoreWebView2WebMessageReceivedEventArgs2 { + pub unsafe fn AdditionalObjects( + &self, + ) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).AdditionalObjects)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2WebMessageReceivedEventArgs2_Vtbl { + pub base__: ICoreWebView2WebMessageReceivedEventArgs_Vtbl, + pub AdditionalObjects: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2WebMessageReceivedEventArgs2_Impl: + ICoreWebView2WebMessageReceivedEventArgs_Impl +{ + fn AdditionalObjects(&self) -> windows_core::Result; +} +impl ICoreWebView2WebMessageReceivedEventArgs2_Vtbl { + pub const fn new< + Identity: ICoreWebView2WebMessageReceivedEventArgs2_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn AdditionalObjects< + Identity: ICoreWebView2WebMessageReceivedEventArgs2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2WebMessageReceivedEventArgs2_Impl::AdditionalObjects(this) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: ICoreWebView2WebMessageReceivedEventArgs_Vtbl::new::(), + AdditionalObjects: AdditionalObjects::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2WebMessageReceivedEventArgs2 {} +windows_core::imp::define_interface!( + ICoreWebView2WebMessageReceivedEventHandler, + ICoreWebView2WebMessageReceivedEventHandler_Vtbl, + 0x57213f19_00e6_49fa_8e07_898ea01ecbd2 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2WebMessageReceivedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2WebMessageReceivedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2WebMessageReceivedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2WebMessageReceivedEventHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2>, + args: windows_core::Ref<'_, ICoreWebView2WebMessageReceivedEventArgs>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2WebMessageReceivedEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2WebMessageReceivedEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2WebMessageReceivedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2WebMessageReceivedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2WebMessageReceivedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2WebResourceRequest, + ICoreWebView2WebResourceRequest_Vtbl, + 0x97055cd4_512c_4264_8b5f_e3f446cea6a5 +); +windows_core::imp::interface_hierarchy!(ICoreWebView2WebResourceRequest, windows_core::IUnknown); +impl ICoreWebView2WebResourceRequest { + pub unsafe fn Uri(&self, uri: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Uri)( + windows_core::Interface::as_raw(self), + uri as _, + ) + .ok() + } + } + pub unsafe fn SetUri(&self, uri: P0) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).SetUri)( + windows_core::Interface::as_raw(self), + uri.param().abi(), + ) + .ok() + } + } + pub unsafe fn Method(&self, method: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Method)( + windows_core::Interface::as_raw(self), + method as _, + ) + .ok() + } + } + pub unsafe fn SetMethod(&self, method: P0) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).SetMethod)( + windows_core::Interface::as_raw(self), + method.param().abi(), + ) + .ok() + } + } + pub unsafe fn Content(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).Content)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } + pub unsafe fn SetContent(&self, content: P0) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).SetContent)( + windows_core::Interface::as_raw(self), + content.param().abi(), + ) + .ok() + } + } + pub unsafe fn Headers(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).Headers)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2WebResourceRequest_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Uri: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub SetUri: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + ) -> windows_core::HRESULT, + pub Method: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub SetMethod: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + ) -> windows_core::HRESULT, + pub Content: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub SetContent: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub Headers: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2WebResourceRequest_Impl: windows_core::IUnknownImpl { + fn Uri(&self, uri: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn SetUri(&self, uri: &windows_core::PCWSTR) -> windows_core::Result<()>; + fn Method(&self, method: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn SetMethod(&self, method: &windows_core::PCWSTR) -> windows_core::Result<()>; + fn Content(&self) -> windows_core::Result; + fn SetContent( + &self, + content: windows_core::Ref<'_, windows::Win32::System::Com::IStream>, + ) -> windows_core::Result<()>; + fn Headers(&self) -> windows_core::Result; +} +impl ICoreWebView2WebResourceRequest_Vtbl { + pub const fn new() -> Self + { + unsafe extern "system" fn Uri< + Identity: ICoreWebView2WebResourceRequest_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + uri: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2WebResourceRequest_Impl::Uri(this, core::mem::transmute_copy(&uri)) + .into() + } + } + unsafe extern "system" fn SetUri< + Identity: ICoreWebView2WebResourceRequest_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + uri: windows_core::PCWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2WebResourceRequest_Impl::SetUri(this, core::mem::transmute(&uri)) + .into() + } + } + unsafe extern "system" fn Method< + Identity: ICoreWebView2WebResourceRequest_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + method: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2WebResourceRequest_Impl::Method( + this, + core::mem::transmute_copy(&method), + ) + .into() + } + } + unsafe extern "system" fn SetMethod< + Identity: ICoreWebView2WebResourceRequest_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + method: windows_core::PCWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2WebResourceRequest_Impl::SetMethod(this, core::mem::transmute(&method)) + .into() + } + } + unsafe extern "system" fn Content< + Identity: ICoreWebView2WebResourceRequest_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + content: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2WebResourceRequest_Impl::Content(this) { + Ok(ok__) => { + content.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + unsafe extern "system" fn SetContent< + Identity: ICoreWebView2WebResourceRequest_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + content: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2WebResourceRequest_Impl::SetContent( + this, + core::mem::transmute_copy(&content), + ) + .into() + } + } + unsafe extern "system" fn Headers< + Identity: ICoreWebView2WebResourceRequest_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + headers: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2WebResourceRequest_Impl::Headers(this) { + Ok(ok__) => { + headers.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Uri: Uri::, + SetUri: SetUri::, + Method: Method::, + SetMethod: SetMethod::, + Content: Content::, + SetContent: SetContent::, + Headers: Headers::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2WebResourceRequest {} +windows_core::imp::define_interface!( + ICoreWebView2WebResourceRequestedEventArgs, + ICoreWebView2WebResourceRequestedEventArgs_Vtbl, + 0x453e667f_12c7_49d4_be6d_ddbe7956f57a +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2WebResourceRequestedEventArgs, + windows_core::IUnknown +); +impl ICoreWebView2WebResourceRequestedEventArgs { + pub unsafe fn Request(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).Request)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } + pub unsafe fn Response(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).Response)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } + pub unsafe fn SetResponse(&self, response: P0) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).SetResponse)( + windows_core::Interface::as_raw(self), + response.param().abi(), + ) + .ok() + } + } + pub unsafe fn GetDeferral(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).GetDeferral)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } + pub unsafe fn ResourceContext( + &self, + context: *mut COREWEBVIEW2_WEB_RESOURCE_CONTEXT, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ResourceContext)( + windows_core::Interface::as_raw(self), + context as _, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2WebResourceRequestedEventArgs_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Request: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub Response: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub SetResponse: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub GetDeferral: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub ResourceContext: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_WEB_RESOURCE_CONTEXT, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2WebResourceRequestedEventArgs_Impl: windows_core::IUnknownImpl { + fn Request(&self) -> windows_core::Result; + fn Response(&self) -> windows_core::Result; + fn SetResponse( + &self, + response: windows_core::Ref<'_, ICoreWebView2WebResourceResponse>, + ) -> windows_core::Result<()>; + fn GetDeferral(&self) -> windows_core::Result; + fn ResourceContext( + &self, + context: *mut COREWEBVIEW2_WEB_RESOURCE_CONTEXT, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2WebResourceRequestedEventArgs_Vtbl { + pub const fn new< + Identity: ICoreWebView2WebResourceRequestedEventArgs_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Request< + Identity: ICoreWebView2WebResourceRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + request: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2WebResourceRequestedEventArgs_Impl::Request(this) { + Ok(ok__) => { + request.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + unsafe extern "system" fn Response< + Identity: ICoreWebView2WebResourceRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + response: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2WebResourceRequestedEventArgs_Impl::Response(this) { + Ok(ok__) => { + response.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + unsafe extern "system" fn SetResponse< + Identity: ICoreWebView2WebResourceRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + response: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2WebResourceRequestedEventArgs_Impl::SetResponse( + this, + core::mem::transmute_copy(&response), + ) + .into() + } + } + unsafe extern "system" fn GetDeferral< + Identity: ICoreWebView2WebResourceRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + deferral: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2WebResourceRequestedEventArgs_Impl::GetDeferral(this) { + Ok(ok__) => { + deferral.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + unsafe extern "system" fn ResourceContext< + Identity: ICoreWebView2WebResourceRequestedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + context: *mut COREWEBVIEW2_WEB_RESOURCE_CONTEXT, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2WebResourceRequestedEventArgs_Impl::ResourceContext( + this, + core::mem::transmute_copy(&context), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Request: Request::, + Response: Response::, + SetResponse: SetResponse::, + GetDeferral: GetDeferral::, + ResourceContext: ResourceContext::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2WebResourceRequestedEventArgs {} +windows_core::imp::define_interface!( + ICoreWebView2WebResourceRequestedEventArgs2, + ICoreWebView2WebResourceRequestedEventArgs2_Vtbl, + 0x9c562c24_b219_4d7f_92f6_b187fbbadd56 +); +impl core::ops::Deref for ICoreWebView2WebResourceRequestedEventArgs2 { + type Target = ICoreWebView2WebResourceRequestedEventArgs; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2WebResourceRequestedEventArgs2, + windows_core::IUnknown, + ICoreWebView2WebResourceRequestedEventArgs +); +impl ICoreWebView2WebResourceRequestedEventArgs2 { + pub unsafe fn RequestedSourceKind( + &self, + value: *mut COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).RequestedSourceKind)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2WebResourceRequestedEventArgs2_Vtbl { + pub base__: ICoreWebView2WebResourceRequestedEventArgs_Vtbl, + pub RequestedSourceKind: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2WebResourceRequestedEventArgs2_Impl: + ICoreWebView2WebResourceRequestedEventArgs_Impl +{ + fn RequestedSourceKind( + &self, + value: *mut COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2WebResourceRequestedEventArgs2_Vtbl { + pub const fn new< + Identity: ICoreWebView2WebResourceRequestedEventArgs2_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn RequestedSourceKind< + Identity: ICoreWebView2WebResourceRequestedEventArgs2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2WebResourceRequestedEventArgs2_Impl::RequestedSourceKind( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: ICoreWebView2WebResourceRequestedEventArgs_Vtbl::new::(), + RequestedSourceKind: RequestedSourceKind::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2WebResourceRequestedEventArgs2 {} +windows_core::imp::define_interface!( + ICoreWebView2WebResourceRequestedEventHandler, + ICoreWebView2WebResourceRequestedEventHandler_Vtbl, + 0xab00b74c_15f1_4646_80e8_e76341d25d71 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2WebResourceRequestedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2WebResourceRequestedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2WebResourceRequestedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2WebResourceRequestedEventHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2>, + args: windows_core::Ref<'_, ICoreWebView2WebResourceRequestedEventArgs>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2WebResourceRequestedEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2WebResourceRequestedEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2WebResourceRequestedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2WebResourceRequestedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2WebResourceRequestedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2WebResourceResponse, + ICoreWebView2WebResourceResponse_Vtbl, + 0xaafcc94f_fa27_48fd_97df_830ef75aaec9 +); +windows_core::imp::interface_hierarchy!(ICoreWebView2WebResourceResponse, windows_core::IUnknown); +impl ICoreWebView2WebResourceResponse { + pub unsafe fn Content(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).Content)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } + pub unsafe fn SetContent(&self, content: P0) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).SetContent)( + windows_core::Interface::as_raw(self), + content.param().abi(), + ) + .ok() + } + } + pub unsafe fn Headers(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).Headers)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } + pub unsafe fn StatusCode(&self, statuscode: *mut i32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).StatusCode)( + windows_core::Interface::as_raw(self), + statuscode as _, + ) + .ok() + } + } + pub unsafe fn SetStatusCode(&self, statuscode: i32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetStatusCode)( + windows_core::Interface::as_raw(self), + statuscode, + ) + .ok() + } + } + pub unsafe fn ReasonPhrase( + &self, + reasonphrase: *mut windows_core::PWSTR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ReasonPhrase)( + windows_core::Interface::as_raw(self), + reasonphrase as _, + ) + .ok() + } + } + pub unsafe fn SetReasonPhrase(&self, reasonphrase: P0) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).SetReasonPhrase)( + windows_core::Interface::as_raw(self), + reasonphrase.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2WebResourceResponse_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Content: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub SetContent: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub Headers: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub StatusCode: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut i32) -> windows_core::HRESULT, + pub SetStatusCode: + unsafe extern "system" fn(*mut core::ffi::c_void, i32) -> windows_core::HRESULT, + pub ReasonPhrase: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub SetReasonPhrase: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2WebResourceResponse_Impl: windows_core::IUnknownImpl { + fn Content(&self) -> windows_core::Result; + fn SetContent( + &self, + content: windows_core::Ref<'_, windows::Win32::System::Com::IStream>, + ) -> windows_core::Result<()>; + fn Headers(&self) -> windows_core::Result; + fn StatusCode(&self, statuscode: *mut i32) -> windows_core::Result<()>; + fn SetStatusCode(&self, statuscode: i32) -> windows_core::Result<()>; + fn ReasonPhrase(&self, reasonphrase: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn SetReasonPhrase(&self, reasonphrase: &windows_core::PCWSTR) -> windows_core::Result<()>; +} +impl ICoreWebView2WebResourceResponse_Vtbl { + pub const fn new() -> Self + { + unsafe extern "system" fn Content< + Identity: ICoreWebView2WebResourceResponse_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + content: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2WebResourceResponse_Impl::Content(this) { + Ok(ok__) => { + content.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + unsafe extern "system" fn SetContent< + Identity: ICoreWebView2WebResourceResponse_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + content: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2WebResourceResponse_Impl::SetContent( + this, + core::mem::transmute_copy(&content), + ) + .into() + } + } + unsafe extern "system" fn Headers< + Identity: ICoreWebView2WebResourceResponse_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + headers: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2WebResourceResponse_Impl::Headers(this) { + Ok(ok__) => { + headers.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + unsafe extern "system" fn StatusCode< + Identity: ICoreWebView2WebResourceResponse_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + statuscode: *mut i32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2WebResourceResponse_Impl::StatusCode( + this, + core::mem::transmute_copy(&statuscode), + ) + .into() + } + } + unsafe extern "system" fn SetStatusCode< + Identity: ICoreWebView2WebResourceResponse_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + statuscode: i32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2WebResourceResponse_Impl::SetStatusCode( + this, + core::mem::transmute_copy(&statuscode), + ) + .into() + } + } + unsafe extern "system" fn ReasonPhrase< + Identity: ICoreWebView2WebResourceResponse_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + reasonphrase: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2WebResourceResponse_Impl::ReasonPhrase( + this, + core::mem::transmute_copy(&reasonphrase), + ) + .into() + } + } + unsafe extern "system" fn SetReasonPhrase< + Identity: ICoreWebView2WebResourceResponse_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + reasonphrase: windows_core::PCWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2WebResourceResponse_Impl::SetReasonPhrase( + this, + core::mem::transmute(&reasonphrase), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Content: Content::, + SetContent: SetContent::, + Headers: Headers::, + StatusCode: StatusCode::, + SetStatusCode: SetStatusCode::, + ReasonPhrase: ReasonPhrase::, + SetReasonPhrase: SetReasonPhrase::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2WebResourceResponse {} +windows_core::imp::define_interface!( + ICoreWebView2WebResourceResponseReceivedEventArgs, + ICoreWebView2WebResourceResponseReceivedEventArgs_Vtbl, + 0xd1db483d_6796_4b8b_80fc_13712bb716f4 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2WebResourceResponseReceivedEventArgs, + windows_core::IUnknown +); +impl ICoreWebView2WebResourceResponseReceivedEventArgs { + pub unsafe fn Request(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).Request)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } + pub unsafe fn Response(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).Response)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2WebResourceResponseReceivedEventArgs_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Request: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub Response: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2WebResourceResponseReceivedEventArgs_Impl: + windows_core::IUnknownImpl +{ + fn Request(&self) -> windows_core::Result; + fn Response(&self) -> windows_core::Result; +} +impl ICoreWebView2WebResourceResponseReceivedEventArgs_Vtbl { + pub const fn new< + Identity: ICoreWebView2WebResourceResponseReceivedEventArgs_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Request< + Identity: ICoreWebView2WebResourceResponseReceivedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2WebResourceResponseReceivedEventArgs_Impl::Request(this) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + unsafe extern "system" fn Response< + Identity: ICoreWebView2WebResourceResponseReceivedEventArgs_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2WebResourceResponseReceivedEventArgs_Impl::Response(this) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Request: Request::, + Response: Response::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2WebResourceResponseReceivedEventArgs {} +windows_core::imp::define_interface!( + ICoreWebView2WebResourceResponseReceivedEventHandler, + ICoreWebView2WebResourceResponseReceivedEventHandler_Vtbl, + 0x7de9898a_24f5_40c3_a2de_d4f458e69828 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2WebResourceResponseReceivedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2WebResourceResponseReceivedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2WebResourceResponseReceivedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2WebResourceResponseReceivedEventHandler_Impl: + windows_core::IUnknownImpl +{ + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2>, + args: windows_core::Ref<'_, ICoreWebView2WebResourceResponseReceivedEventArgs>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2WebResourceResponseReceivedEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2WebResourceResponseReceivedEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2WebResourceResponseReceivedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2WebResourceResponseReceivedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == & < ICoreWebView2WebResourceResponseReceivedEventHandler as windows_core::Interface >::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2WebResourceResponseReceivedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2WebResourceResponseView, + ICoreWebView2WebResourceResponseView_Vtbl, + 0x79701053_7759_4162_8f7d_f1b3f084928d +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2WebResourceResponseView, + windows_core::IUnknown +); +impl ICoreWebView2WebResourceResponseView { + pub unsafe fn Headers(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).Headers)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } + pub unsafe fn StatusCode(&self, statuscode: *mut i32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).StatusCode)( + windows_core::Interface::as_raw(self), + statuscode as _, + ) + .ok() + } + } + pub unsafe fn ReasonPhrase( + &self, + reasonphrase: *mut windows_core::PWSTR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ReasonPhrase)( + windows_core::Interface::as_raw(self), + reasonphrase as _, + ) + .ok() + } + } + pub unsafe fn GetContent(&self, handler: P0) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).GetContent)( + windows_core::Interface::as_raw(self), + handler.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2WebResourceResponseView_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Headers: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub StatusCode: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut i32) -> windows_core::HRESULT, + pub ReasonPhrase: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub GetContent: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2WebResourceResponseView_Impl: windows_core::IUnknownImpl { + fn Headers(&self) -> windows_core::Result; + fn StatusCode(&self, statuscode: *mut i32) -> windows_core::Result<()>; + fn ReasonPhrase(&self, reasonphrase: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn GetContent( + &self, + handler: windows_core::Ref< + '_, + ICoreWebView2WebResourceResponseViewGetContentCompletedHandler, + >, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2WebResourceResponseView_Vtbl { + pub const fn new( + ) -> Self { + unsafe extern "system" fn Headers< + Identity: ICoreWebView2WebResourceResponseView_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + headers: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2WebResourceResponseView_Impl::Headers(this) { + Ok(ok__) => { + headers.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + unsafe extern "system" fn StatusCode< + Identity: ICoreWebView2WebResourceResponseView_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + statuscode: *mut i32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2WebResourceResponseView_Impl::StatusCode( + this, + core::mem::transmute_copy(&statuscode), + ) + .into() + } + } + unsafe extern "system" fn ReasonPhrase< + Identity: ICoreWebView2WebResourceResponseView_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + reasonphrase: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2WebResourceResponseView_Impl::ReasonPhrase( + this, + core::mem::transmute_copy(&reasonphrase), + ) + .into() + } + } + unsafe extern "system" fn GetContent< + Identity: ICoreWebView2WebResourceResponseView_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + handler: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2WebResourceResponseView_Impl::GetContent( + this, + core::mem::transmute_copy(&handler), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Headers: Headers::, + StatusCode: StatusCode::, + ReasonPhrase: ReasonPhrase::, + GetContent: GetContent::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2WebResourceResponseView {} +windows_core::imp::define_interface!( + ICoreWebView2WebResourceResponseViewGetContentCompletedHandler, + ICoreWebView2WebResourceResponseViewGetContentCompletedHandler_Vtbl, + 0x875738e1_9fa2_40e3_8b74_2e8972dd6fe7 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2WebResourceResponseViewGetContentCompletedHandler, + windows_core::IUnknown +); +impl ICoreWebView2WebResourceResponseViewGetContentCompletedHandler { + pub unsafe fn Invoke( + &self, + errorcode: windows_core::HRESULT, + result: P1, + ) -> windows_core::Result<()> + where + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + errorcode, + result.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2WebResourceResponseViewGetContentCompletedHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::HRESULT, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2WebResourceResponseViewGetContentCompletedHandler_Impl: + windows_core::IUnknownImpl +{ + fn Invoke( + &self, + errorcode: windows_core::HRESULT, + result: windows_core::Ref<'_, windows::Win32::System::Com::IStream>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2WebResourceResponseViewGetContentCompletedHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2WebResourceResponseViewGetContentCompletedHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2WebResourceResponseViewGetContentCompletedHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + errorcode: windows_core::HRESULT, + result: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2WebResourceResponseViewGetContentCompletedHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&errorcode), + core::mem::transmute_copy(&result), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == & < ICoreWebView2WebResourceResponseViewGetContentCompletedHandler as windows_core::Interface >::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2WebResourceResponseViewGetContentCompletedHandler {} +windows_core::imp::define_interface!( + ICoreWebView2WindowCloseRequestedEventHandler, + ICoreWebView2WindowCloseRequestedEventHandler_Vtbl, + 0x5c19e9e0_092f_486b_affa_ca8231913039 +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2WindowCloseRequestedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2WindowCloseRequestedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2WindowCloseRequestedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2WindowCloseRequestedEventHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2>, + args: windows_core::Ref<'_, windows_core::IUnknown>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2WindowCloseRequestedEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2WindowCloseRequestedEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2WindowCloseRequestedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2WindowCloseRequestedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2WindowCloseRequestedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2WindowFeatures, + ICoreWebView2WindowFeatures_Vtbl, + 0x5eaf559f_b46e_4397_8860_e422f287ff1e +); +windows_core::imp::interface_hierarchy!(ICoreWebView2WindowFeatures, windows_core::IUnknown); +impl ICoreWebView2WindowFeatures { + pub unsafe fn HasPosition(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).HasPosition)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn HasSize(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).HasSize)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn Left(&self, value: *mut u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Left)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn Top(&self, value: *mut u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Top)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn Height(&self, value: *mut u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Height)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn Width(&self, value: *mut u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Width)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn ShouldDisplayMenuBar( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ShouldDisplayMenuBar)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn ShouldDisplayStatus( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ShouldDisplayStatus)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn ShouldDisplayToolbar( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ShouldDisplayToolbar)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn ShouldDisplayScrollBars( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ShouldDisplayScrollBars)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2WindowFeatures_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub HasPosition: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub HasSize: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub Left: unsafe extern "system" fn(*mut core::ffi::c_void, *mut u32) -> windows_core::HRESULT, + pub Top: unsafe extern "system" fn(*mut core::ffi::c_void, *mut u32) -> windows_core::HRESULT, + pub Height: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut u32) -> windows_core::HRESULT, + pub Width: unsafe extern "system" fn(*mut core::ffi::c_void, *mut u32) -> windows_core::HRESULT, + pub ShouldDisplayMenuBar: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub ShouldDisplayStatus: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub ShouldDisplayToolbar: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub ShouldDisplayScrollBars: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2WindowFeatures_Impl: windows_core::IUnknownImpl { + fn HasPosition(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn HasSize(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn Left(&self, value: *mut u32) -> windows_core::Result<()>; + fn Top(&self, value: *mut u32) -> windows_core::Result<()>; + fn Height(&self, value: *mut u32) -> windows_core::Result<()>; + fn Width(&self, value: *mut u32) -> windows_core::Result<()>; + fn ShouldDisplayMenuBar(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn ShouldDisplayStatus(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn ShouldDisplayToolbar(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn ShouldDisplayScrollBars(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; +} +impl ICoreWebView2WindowFeatures_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn HasPosition< + Identity: ICoreWebView2WindowFeatures_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2WindowFeatures_Impl::HasPosition( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn HasSize< + Identity: ICoreWebView2WindowFeatures_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2WindowFeatures_Impl::HasSize(this, core::mem::transmute_copy(&value)) + .into() + } + } + unsafe extern "system" fn Left< + Identity: ICoreWebView2WindowFeatures_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2WindowFeatures_Impl::Left(this, core::mem::transmute_copy(&value)) + .into() + } + } + unsafe extern "system" fn Top< + Identity: ICoreWebView2WindowFeatures_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2WindowFeatures_Impl::Top(this, core::mem::transmute_copy(&value)) + .into() + } + } + unsafe extern "system" fn Height< + Identity: ICoreWebView2WindowFeatures_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2WindowFeatures_Impl::Height(this, core::mem::transmute_copy(&value)) + .into() + } + } + unsafe extern "system" fn Width< + Identity: ICoreWebView2WindowFeatures_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2WindowFeatures_Impl::Width(this, core::mem::transmute_copy(&value)) + .into() + } + } + unsafe extern "system" fn ShouldDisplayMenuBar< + Identity: ICoreWebView2WindowFeatures_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2WindowFeatures_Impl::ShouldDisplayMenuBar( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn ShouldDisplayStatus< + Identity: ICoreWebView2WindowFeatures_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2WindowFeatures_Impl::ShouldDisplayStatus( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn ShouldDisplayToolbar< + Identity: ICoreWebView2WindowFeatures_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2WindowFeatures_Impl::ShouldDisplayToolbar( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn ShouldDisplayScrollBars< + Identity: ICoreWebView2WindowFeatures_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2WindowFeatures_Impl::ShouldDisplayScrollBars( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + HasPosition: HasPosition::, + HasSize: HasSize::, + Left: Left::, + Top: Top::, + Height: Height::, + Width: Width::, + ShouldDisplayMenuBar: ShouldDisplayMenuBar::, + ShouldDisplayStatus: ShouldDisplayStatus::, + ShouldDisplayToolbar: ShouldDisplayToolbar::, + ShouldDisplayScrollBars: ShouldDisplayScrollBars::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2WindowFeatures {} +windows_core::imp::define_interface!( + ICoreWebView2ZoomFactorChangedEventHandler, + ICoreWebView2ZoomFactorChangedEventHandler_Vtbl, + 0xb52d71d6_c4df_4543_a90c_64a3e60f38cb +); +windows_core::imp::interface_hierarchy!( + ICoreWebView2ZoomFactorChangedEventHandler, + windows_core::IUnknown +); +impl ICoreWebView2ZoomFactorChangedEventHandler { + pub unsafe fn Invoke(&self, sender: P0, args: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Invoke)( + windows_core::Interface::as_raw(self), + sender.param().abi(), + args.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2ZoomFactorChangedEventHandler_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Invoke: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2ZoomFactorChangedEventHandler_Impl: windows_core::IUnknownImpl { + fn Invoke( + &self, + sender: windows_core::Ref<'_, ICoreWebView2Controller>, + args: windows_core::Ref<'_, windows_core::IUnknown>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2ZoomFactorChangedEventHandler_Vtbl { + pub const fn new< + Identity: ICoreWebView2ZoomFactorChangedEventHandler_Impl, + const OFFSET: isize, + >() -> Self { + unsafe extern "system" fn Invoke< + Identity: ICoreWebView2ZoomFactorChangedEventHandler_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sender: *mut core::ffi::c_void, + args: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2ZoomFactorChangedEventHandler_Impl::Invoke( + this, + core::mem::transmute_copy(&sender), + core::mem::transmute_copy(&args), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Invoke: Invoke::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2ZoomFactorChangedEventHandler {} +windows_core::imp::define_interface!( + ICoreWebView2_10, + ICoreWebView2_10_Vtbl, + 0xb1690564_6f5a_4983_8e48_31d1143fecdb +); +impl core::ops::Deref for ICoreWebView2_10 { + type Target = ICoreWebView2_9; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2_10, + windows_core::IUnknown, + ICoreWebView2, + ICoreWebView2_2, + ICoreWebView2_3, + ICoreWebView2_4, + ICoreWebView2_5, + ICoreWebView2_6, + ICoreWebView2_7, + ICoreWebView2_8, + ICoreWebView2_9 +); +impl ICoreWebView2_10 { + pub unsafe fn add_BasicAuthenticationRequested( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_BasicAuthenticationRequested)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_BasicAuthenticationRequested( + &self, + token: i64, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_BasicAuthenticationRequested)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2_10_Vtbl { + pub base__: ICoreWebView2_9_Vtbl, + pub add_BasicAuthenticationRequested: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_BasicAuthenticationRequested: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, +} +pub trait ICoreWebView2_10_Impl: ICoreWebView2_9_Impl { + fn add_BasicAuthenticationRequested( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2BasicAuthenticationRequestedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_BasicAuthenticationRequested(&self, token: i64) -> windows_core::Result<()>; +} +impl ICoreWebView2_10_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn add_BasicAuthenticationRequested< + Identity: ICoreWebView2_10_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_10_Impl::add_BasicAuthenticationRequested( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_BasicAuthenticationRequested< + Identity: ICoreWebView2_10_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_10_Impl::remove_BasicAuthenticationRequested( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + Self { + base__: ICoreWebView2_9_Vtbl::new::(), + add_BasicAuthenticationRequested: add_BasicAuthenticationRequested::, + remove_BasicAuthenticationRequested: remove_BasicAuthenticationRequested::< + Identity, + OFFSET, + >, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2_10 {} +windows_core::imp::define_interface!( + ICoreWebView2_11, + ICoreWebView2_11_Vtbl, + 0x0be78e56_c193_4051_b943_23b460c08bdb +); +impl core::ops::Deref for ICoreWebView2_11 { + type Target = ICoreWebView2_10; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2_11, + windows_core::IUnknown, + ICoreWebView2, + ICoreWebView2_2, + ICoreWebView2_3, + ICoreWebView2_4, + ICoreWebView2_5, + ICoreWebView2_6, + ICoreWebView2_7, + ICoreWebView2_8, + ICoreWebView2_9, + ICoreWebView2_10 +); +impl ICoreWebView2_11 { + pub unsafe fn CallDevToolsProtocolMethodForSession( + &self, + sessionid: P0, + methodname: P1, + parametersasjson: P2, + handler: P3, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + P2: windows_core::Param, + P3: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).CallDevToolsProtocolMethodForSession)( + windows_core::Interface::as_raw(self), + sessionid.param().abi(), + methodname.param().abi(), + parametersasjson.param().abi(), + handler.param().abi(), + ) + .ok() + } + } + pub unsafe fn add_ContextMenuRequested( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_ContextMenuRequested)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_ContextMenuRequested(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_ContextMenuRequested)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2_11_Vtbl { + pub base__: ICoreWebView2_10_Vtbl, + pub CallDevToolsProtocolMethodForSession: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + windows_core::PCWSTR, + windows_core::PCWSTR, + *mut core::ffi::c_void, + ) + -> windows_core::HRESULT, + pub add_ContextMenuRequested: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_ContextMenuRequested: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, +} +pub trait ICoreWebView2_11_Impl: ICoreWebView2_10_Impl { + fn CallDevToolsProtocolMethodForSession( + &self, + sessionid: &windows_core::PCWSTR, + methodname: &windows_core::PCWSTR, + parametersasjson: &windows_core::PCWSTR, + handler: windows_core::Ref<'_, ICoreWebView2CallDevToolsProtocolMethodCompletedHandler>, + ) -> windows_core::Result<()>; + fn add_ContextMenuRequested( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2ContextMenuRequestedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_ContextMenuRequested(&self, token: i64) -> windows_core::Result<()>; +} +impl ICoreWebView2_11_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn CallDevToolsProtocolMethodForSession< + Identity: ICoreWebView2_11_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sessionid: windows_core::PCWSTR, + methodname: windows_core::PCWSTR, + parametersasjson: windows_core::PCWSTR, + handler: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_11_Impl::CallDevToolsProtocolMethodForSession( + this, + core::mem::transmute(&sessionid), + core::mem::transmute(&methodname), + core::mem::transmute(¶metersasjson), + core::mem::transmute_copy(&handler), + ) + .into() + } + } + unsafe extern "system" fn add_ContextMenuRequested< + Identity: ICoreWebView2_11_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_11_Impl::add_ContextMenuRequested( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_ContextMenuRequested< + Identity: ICoreWebView2_11_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_11_Impl::remove_ContextMenuRequested( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + Self { + base__: ICoreWebView2_10_Vtbl::new::(), + CallDevToolsProtocolMethodForSession: CallDevToolsProtocolMethodForSession::< + Identity, + OFFSET, + >, + add_ContextMenuRequested: add_ContextMenuRequested::, + remove_ContextMenuRequested: remove_ContextMenuRequested::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2_11 {} +windows_core::imp::define_interface!( + ICoreWebView2_12, + ICoreWebView2_12_Vtbl, + 0x35d69927_bcfa_4566_9349_6b3e0d154cac +); +impl core::ops::Deref for ICoreWebView2_12 { + type Target = ICoreWebView2_11; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2_12, + windows_core::IUnknown, + ICoreWebView2, + ICoreWebView2_2, + ICoreWebView2_3, + ICoreWebView2_4, + ICoreWebView2_5, + ICoreWebView2_6, + ICoreWebView2_7, + ICoreWebView2_8, + ICoreWebView2_9, + ICoreWebView2_10, + ICoreWebView2_11 +); +impl ICoreWebView2_12 { + pub unsafe fn add_StatusBarTextChanged( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_StatusBarTextChanged)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_StatusBarTextChanged(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_StatusBarTextChanged)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } + pub unsafe fn StatusBarText( + &self, + value: *mut windows_core::PWSTR, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).StatusBarText)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2_12_Vtbl { + pub base__: ICoreWebView2_11_Vtbl, + pub add_StatusBarTextChanged: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_StatusBarTextChanged: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, + pub StatusBarText: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2_12_Impl: ICoreWebView2_11_Impl { + fn add_StatusBarTextChanged( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2StatusBarTextChangedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_StatusBarTextChanged(&self, token: i64) -> windows_core::Result<()>; + fn StatusBarText(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; +} +impl ICoreWebView2_12_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn add_StatusBarTextChanged< + Identity: ICoreWebView2_12_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_12_Impl::add_StatusBarTextChanged( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_StatusBarTextChanged< + Identity: ICoreWebView2_12_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_12_Impl::remove_StatusBarTextChanged( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn StatusBarText< + Identity: ICoreWebView2_12_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_12_Impl::StatusBarText(this, core::mem::transmute_copy(&value)).into() + } + } + Self { + base__: ICoreWebView2_11_Vtbl::new::(), + add_StatusBarTextChanged: add_StatusBarTextChanged::, + remove_StatusBarTextChanged: remove_StatusBarTextChanged::, + StatusBarText: StatusBarText::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2_12 {} +windows_core::imp::define_interface!( + ICoreWebView2_13, + ICoreWebView2_13_Vtbl, + 0xf75f09a8_667e_4983_88d6_c8773f315e84 +); +impl core::ops::Deref for ICoreWebView2_13 { + type Target = ICoreWebView2_12; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2_13, + windows_core::IUnknown, + ICoreWebView2, + ICoreWebView2_2, + ICoreWebView2_3, + ICoreWebView2_4, + ICoreWebView2_5, + ICoreWebView2_6, + ICoreWebView2_7, + ICoreWebView2_8, + ICoreWebView2_9, + ICoreWebView2_10, + ICoreWebView2_11, + ICoreWebView2_12 +); +impl ICoreWebView2_13 { + pub unsafe fn Profile(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).Profile)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2_13_Vtbl { + pub base__: ICoreWebView2_12_Vtbl, + pub Profile: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2_13_Impl: ICoreWebView2_12_Impl { + fn Profile(&self) -> windows_core::Result; +} +impl ICoreWebView2_13_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn Profile( + this: *mut core::ffi::c_void, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2_13_Impl::Profile(this) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: ICoreWebView2_12_Vtbl::new::(), + Profile: Profile::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2_13 {} +windows_core::imp::define_interface!( + ICoreWebView2_14, + ICoreWebView2_14_Vtbl, + 0x6daa4f10_4a90_4753_8898_77c5df534165 +); +impl core::ops::Deref for ICoreWebView2_14 { + type Target = ICoreWebView2_13; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2_14, + windows_core::IUnknown, + ICoreWebView2, + ICoreWebView2_2, + ICoreWebView2_3, + ICoreWebView2_4, + ICoreWebView2_5, + ICoreWebView2_6, + ICoreWebView2_7, + ICoreWebView2_8, + ICoreWebView2_9, + ICoreWebView2_10, + ICoreWebView2_11, + ICoreWebView2_12, + ICoreWebView2_13 +); +impl ICoreWebView2_14 { + pub unsafe fn add_ServerCertificateErrorDetected( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_ServerCertificateErrorDetected)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_ServerCertificateErrorDetected( + &self, + token: i64, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_ServerCertificateErrorDetected)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } + pub unsafe fn ClearServerCertificateErrorActions( + &self, + handler: P0, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).ClearServerCertificateErrorActions)( + windows_core::Interface::as_raw(self), + handler.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2_14_Vtbl { + pub base__: ICoreWebView2_13_Vtbl, + pub add_ServerCertificateErrorDetected: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_ServerCertificateErrorDetected: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, + pub ClearServerCertificateErrorActions: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2_14_Impl: ICoreWebView2_13_Impl { + fn add_ServerCertificateErrorDetected( + &self, + eventhandler: windows_core::Ref< + '_, + ICoreWebView2ServerCertificateErrorDetectedEventHandler, + >, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_ServerCertificateErrorDetected(&self, token: i64) -> windows_core::Result<()>; + fn ClearServerCertificateErrorActions( + &self, + handler: windows_core::Ref< + '_, + ICoreWebView2ClearServerCertificateErrorActionsCompletedHandler, + >, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2_14_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn add_ServerCertificateErrorDetected< + Identity: ICoreWebView2_14_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_14_Impl::add_ServerCertificateErrorDetected( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_ServerCertificateErrorDetected< + Identity: ICoreWebView2_14_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_14_Impl::remove_ServerCertificateErrorDetected( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn ClearServerCertificateErrorActions< + Identity: ICoreWebView2_14_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + handler: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_14_Impl::ClearServerCertificateErrorActions( + this, + core::mem::transmute_copy(&handler), + ) + .into() + } + } + Self { + base__: ICoreWebView2_13_Vtbl::new::(), + add_ServerCertificateErrorDetected: add_ServerCertificateErrorDetected::< + Identity, + OFFSET, + >, + remove_ServerCertificateErrorDetected: remove_ServerCertificateErrorDetected::< + Identity, + OFFSET, + >, + ClearServerCertificateErrorActions: ClearServerCertificateErrorActions::< + Identity, + OFFSET, + >, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2_14 {} +windows_core::imp::define_interface!( + ICoreWebView2_15, + ICoreWebView2_15_Vtbl, + 0x517b2d1d_7dae_4a66_a4f4_10352ffb9518 +); +impl core::ops::Deref for ICoreWebView2_15 { + type Target = ICoreWebView2_14; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2_15, + windows_core::IUnknown, + ICoreWebView2, + ICoreWebView2_2, + ICoreWebView2_3, + ICoreWebView2_4, + ICoreWebView2_5, + ICoreWebView2_6, + ICoreWebView2_7, + ICoreWebView2_8, + ICoreWebView2_9, + ICoreWebView2_10, + ICoreWebView2_11, + ICoreWebView2_12, + ICoreWebView2_13, + ICoreWebView2_14 +); +impl ICoreWebView2_15 { + pub unsafe fn add_FaviconChanged( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_FaviconChanged)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_FaviconChanged(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_FaviconChanged)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } + pub unsafe fn FaviconUri(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).FaviconUri)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn GetFavicon( + &self, + format: COREWEBVIEW2_FAVICON_IMAGE_FORMAT, + completedhandler: P1, + ) -> windows_core::Result<()> + where + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).GetFavicon)( + windows_core::Interface::as_raw(self), + format, + completedhandler.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2_15_Vtbl { + pub base__: ICoreWebView2_14_Vtbl, + pub add_FaviconChanged: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_FaviconChanged: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, + pub FaviconUri: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::PWSTR, + ) -> windows_core::HRESULT, + pub GetFavicon: unsafe extern "system" fn( + *mut core::ffi::c_void, + COREWEBVIEW2_FAVICON_IMAGE_FORMAT, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2_15_Impl: ICoreWebView2_14_Impl { + fn add_FaviconChanged( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2FaviconChangedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_FaviconChanged(&self, token: i64) -> windows_core::Result<()>; + fn FaviconUri(&self, value: *mut windows_core::PWSTR) -> windows_core::Result<()>; + fn GetFavicon( + &self, + format: COREWEBVIEW2_FAVICON_IMAGE_FORMAT, + completedhandler: windows_core::Ref<'_, ICoreWebView2GetFaviconCompletedHandler>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2_15_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn add_FaviconChanged< + Identity: ICoreWebView2_15_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_15_Impl::add_FaviconChanged( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_FaviconChanged< + Identity: ICoreWebView2_15_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_15_Impl::remove_FaviconChanged( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn FaviconUri< + Identity: ICoreWebView2_15_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::PWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_15_Impl::FaviconUri(this, core::mem::transmute_copy(&value)).into() + } + } + unsafe extern "system" fn GetFavicon< + Identity: ICoreWebView2_15_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + format: COREWEBVIEW2_FAVICON_IMAGE_FORMAT, + completedhandler: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_15_Impl::GetFavicon( + this, + core::mem::transmute_copy(&format), + core::mem::transmute_copy(&completedhandler), + ) + .into() + } + } + Self { + base__: ICoreWebView2_14_Vtbl::new::(), + add_FaviconChanged: add_FaviconChanged::, + remove_FaviconChanged: remove_FaviconChanged::, + FaviconUri: FaviconUri::, + GetFavicon: GetFavicon::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2_15 {} +windows_core::imp::define_interface!( + ICoreWebView2_16, + ICoreWebView2_16_Vtbl, + 0x0eb34dc9_9f91_41e1_8639_95cd5943906b +); +impl core::ops::Deref for ICoreWebView2_16 { + type Target = ICoreWebView2_15; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2_16, + windows_core::IUnknown, + ICoreWebView2, + ICoreWebView2_2, + ICoreWebView2_3, + ICoreWebView2_4, + ICoreWebView2_5, + ICoreWebView2_6, + ICoreWebView2_7, + ICoreWebView2_8, + ICoreWebView2_9, + ICoreWebView2_10, + ICoreWebView2_11, + ICoreWebView2_12, + ICoreWebView2_13, + ICoreWebView2_14, + ICoreWebView2_15 +); +impl ICoreWebView2_16 { + pub unsafe fn Print(&self, printsettings: P0, handler: P1) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).Print)( + windows_core::Interface::as_raw(self), + printsettings.param().abi(), + handler.param().abi(), + ) + .ok() + } + } + pub unsafe fn ShowPrintUI( + &self, + printdialogkind: COREWEBVIEW2_PRINT_DIALOG_KIND, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).ShowPrintUI)( + windows_core::Interface::as_raw(self), + printdialogkind, + ) + .ok() + } + } + pub unsafe fn PrintToPdfStream( + &self, + printsettings: P0, + handler: P1, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).PrintToPdfStream)( + windows_core::Interface::as_raw(self), + printsettings.param().abi(), + handler.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2_16_Vtbl { + pub base__: ICoreWebView2_15_Vtbl, + pub Print: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub ShowPrintUI: unsafe extern "system" fn( + *mut core::ffi::c_void, + COREWEBVIEW2_PRINT_DIALOG_KIND, + ) -> windows_core::HRESULT, + pub PrintToPdfStream: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2_16_Impl: ICoreWebView2_15_Impl { + fn Print( + &self, + printsettings: windows_core::Ref<'_, ICoreWebView2PrintSettings>, + handler: windows_core::Ref<'_, ICoreWebView2PrintCompletedHandler>, + ) -> windows_core::Result<()>; + fn ShowPrintUI( + &self, + printdialogkind: COREWEBVIEW2_PRINT_DIALOG_KIND, + ) -> windows_core::Result<()>; + fn PrintToPdfStream( + &self, + printsettings: windows_core::Ref<'_, ICoreWebView2PrintSettings>, + handler: windows_core::Ref<'_, ICoreWebView2PrintToPdfStreamCompletedHandler>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2_16_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn Print( + this: *mut core::ffi::c_void, + printsettings: *mut core::ffi::c_void, + handler: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_16_Impl::Print( + this, + core::mem::transmute_copy(&printsettings), + core::mem::transmute_copy(&handler), + ) + .into() + } + } + unsafe extern "system" fn ShowPrintUI< + Identity: ICoreWebView2_16_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + printdialogkind: COREWEBVIEW2_PRINT_DIALOG_KIND, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_16_Impl::ShowPrintUI( + this, + core::mem::transmute_copy(&printdialogkind), + ) + .into() + } + } + unsafe extern "system" fn PrintToPdfStream< + Identity: ICoreWebView2_16_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + printsettings: *mut core::ffi::c_void, + handler: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_16_Impl::PrintToPdfStream( + this, + core::mem::transmute_copy(&printsettings), + core::mem::transmute_copy(&handler), + ) + .into() + } + } + Self { + base__: ICoreWebView2_15_Vtbl::new::(), + Print: Print::, + ShowPrintUI: ShowPrintUI::, + PrintToPdfStream: PrintToPdfStream::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2_16 {} +windows_core::imp::define_interface!( + ICoreWebView2_17, + ICoreWebView2_17_Vtbl, + 0x702e75d4_fd44_434d_9d70_1a68a6b1192a +); +impl core::ops::Deref for ICoreWebView2_17 { + type Target = ICoreWebView2_16; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2_17, + windows_core::IUnknown, + ICoreWebView2, + ICoreWebView2_2, + ICoreWebView2_3, + ICoreWebView2_4, + ICoreWebView2_5, + ICoreWebView2_6, + ICoreWebView2_7, + ICoreWebView2_8, + ICoreWebView2_9, + ICoreWebView2_10, + ICoreWebView2_11, + ICoreWebView2_12, + ICoreWebView2_13, + ICoreWebView2_14, + ICoreWebView2_15, + ICoreWebView2_16 +); +impl ICoreWebView2_17 { + pub unsafe fn PostSharedBufferToScript( + &self, + sharedbuffer: P0, + access: COREWEBVIEW2_SHARED_BUFFER_ACCESS, + additionaldataasjson: P2, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + P2: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).PostSharedBufferToScript)( + windows_core::Interface::as_raw(self), + sharedbuffer.param().abi(), + access, + additionaldataasjson.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2_17_Vtbl { + pub base__: ICoreWebView2_16_Vtbl, + pub PostSharedBufferToScript: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + COREWEBVIEW2_SHARED_BUFFER_ACCESS, + windows_core::PCWSTR, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2_17_Impl: ICoreWebView2_16_Impl { + fn PostSharedBufferToScript( + &self, + sharedbuffer: windows_core::Ref<'_, ICoreWebView2SharedBuffer>, + access: COREWEBVIEW2_SHARED_BUFFER_ACCESS, + additionaldataasjson: &windows_core::PCWSTR, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2_17_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn PostSharedBufferToScript< + Identity: ICoreWebView2_17_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + sharedbuffer: *mut core::ffi::c_void, + access: COREWEBVIEW2_SHARED_BUFFER_ACCESS, + additionaldataasjson: windows_core::PCWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_17_Impl::PostSharedBufferToScript( + this, + core::mem::transmute_copy(&sharedbuffer), + core::mem::transmute_copy(&access), + core::mem::transmute(&additionaldataasjson), + ) + .into() + } + } + Self { + base__: ICoreWebView2_16_Vtbl::new::(), + PostSharedBufferToScript: PostSharedBufferToScript::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2_17 {} +windows_core::imp::define_interface!( + ICoreWebView2_18, + ICoreWebView2_18_Vtbl, + 0x7a626017_28be_49b2_b865_3ba2b3522d90 +); +impl core::ops::Deref for ICoreWebView2_18 { + type Target = ICoreWebView2_17; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2_18, + windows_core::IUnknown, + ICoreWebView2, + ICoreWebView2_2, + ICoreWebView2_3, + ICoreWebView2_4, + ICoreWebView2_5, + ICoreWebView2_6, + ICoreWebView2_7, + ICoreWebView2_8, + ICoreWebView2_9, + ICoreWebView2_10, + ICoreWebView2_11, + ICoreWebView2_12, + ICoreWebView2_13, + ICoreWebView2_14, + ICoreWebView2_15, + ICoreWebView2_16, + ICoreWebView2_17 +); +impl ICoreWebView2_18 { + pub unsafe fn add_LaunchingExternalUriScheme( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_LaunchingExternalUriScheme)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_LaunchingExternalUriScheme(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_LaunchingExternalUriScheme)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2_18_Vtbl { + pub base__: ICoreWebView2_17_Vtbl, + pub add_LaunchingExternalUriScheme: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_LaunchingExternalUriScheme: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, +} +pub trait ICoreWebView2_18_Impl: ICoreWebView2_17_Impl { + fn add_LaunchingExternalUriScheme( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2LaunchingExternalUriSchemeEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_LaunchingExternalUriScheme(&self, token: i64) -> windows_core::Result<()>; +} +impl ICoreWebView2_18_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn add_LaunchingExternalUriScheme< + Identity: ICoreWebView2_18_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_18_Impl::add_LaunchingExternalUriScheme( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_LaunchingExternalUriScheme< + Identity: ICoreWebView2_18_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_18_Impl::remove_LaunchingExternalUriScheme( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + Self { + base__: ICoreWebView2_17_Vtbl::new::(), + add_LaunchingExternalUriScheme: add_LaunchingExternalUriScheme::, + remove_LaunchingExternalUriScheme: remove_LaunchingExternalUriScheme::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2_18 {} +windows_core::imp::define_interface!( + ICoreWebView2_19, + ICoreWebView2_19_Vtbl, + 0x6921f954_79b0_437f_a997_c85811897c68 +); +impl core::ops::Deref for ICoreWebView2_19 { + type Target = ICoreWebView2_18; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2_19, + windows_core::IUnknown, + ICoreWebView2, + ICoreWebView2_2, + ICoreWebView2_3, + ICoreWebView2_4, + ICoreWebView2_5, + ICoreWebView2_6, + ICoreWebView2_7, + ICoreWebView2_8, + ICoreWebView2_9, + ICoreWebView2_10, + ICoreWebView2_11, + ICoreWebView2_12, + ICoreWebView2_13, + ICoreWebView2_14, + ICoreWebView2_15, + ICoreWebView2_16, + ICoreWebView2_17, + ICoreWebView2_18 +); +impl ICoreWebView2_19 { + pub unsafe fn MemoryUsageTargetLevel( + &self, + value: *mut COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).MemoryUsageTargetLevel)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetMemoryUsageTargetLevel( + &self, + value: COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetMemoryUsageTargetLevel)( + windows_core::Interface::as_raw(self), + value, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2_19_Vtbl { + pub base__: ICoreWebView2_18_Vtbl, + pub MemoryUsageTargetLevel: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL, + ) -> windows_core::HRESULT, + pub SetMemoryUsageTargetLevel: unsafe extern "system" fn( + *mut core::ffi::c_void, + COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2_19_Impl: ICoreWebView2_18_Impl { + fn MemoryUsageTargetLevel( + &self, + value: *mut COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL, + ) -> windows_core::Result<()>; + fn SetMemoryUsageTargetLevel( + &self, + value: COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2_19_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn MemoryUsageTargetLevel< + Identity: ICoreWebView2_19_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_19_Impl::MemoryUsageTargetLevel( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetMemoryUsageTargetLevel< + Identity: ICoreWebView2_19_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: COREWEBVIEW2_MEMORY_USAGE_TARGET_LEVEL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_19_Impl::SetMemoryUsageTargetLevel( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: ICoreWebView2_18_Vtbl::new::(), + MemoryUsageTargetLevel: MemoryUsageTargetLevel::, + SetMemoryUsageTargetLevel: SetMemoryUsageTargetLevel::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2_19 {} +windows_core::imp::define_interface!( + ICoreWebView2_2, + ICoreWebView2_2_Vtbl, + 0x9e8f0cf8_e670_4b5e_b2bc_73e061e3184c +); +impl core::ops::Deref for ICoreWebView2_2 { + type Target = ICoreWebView2; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!(ICoreWebView2_2, windows_core::IUnknown, ICoreWebView2); +impl ICoreWebView2_2 { + pub unsafe fn add_WebResourceResponseReceived( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_WebResourceResponseReceived)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_WebResourceResponseReceived( + &self, + token: i64, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_WebResourceResponseReceived)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } + pub unsafe fn NavigateWithWebResourceRequest(&self, request: P0) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).NavigateWithWebResourceRequest)( + windows_core::Interface::as_raw(self), + request.param().abi(), + ) + .ok() + } + } + pub unsafe fn add_DOMContentLoaded( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_DOMContentLoaded)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_DOMContentLoaded(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_DOMContentLoaded)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } + pub unsafe fn CookieManager(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).CookieManager)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } + pub unsafe fn Environment(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).Environment)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2_2_Vtbl { + pub base__: ICoreWebView2_Vtbl, + pub add_WebResourceResponseReceived: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_WebResourceResponseReceived: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, + pub NavigateWithWebResourceRequest: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub add_DOMContentLoaded: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_DOMContentLoaded: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, + pub CookieManager: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub Environment: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2_2_Impl: ICoreWebView2_Impl { + fn add_WebResourceResponseReceived( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2WebResourceResponseReceivedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_WebResourceResponseReceived(&self, token: i64) -> windows_core::Result<()>; + fn NavigateWithWebResourceRequest( + &self, + request: windows_core::Ref<'_, ICoreWebView2WebResourceRequest>, + ) -> windows_core::Result<()>; + fn add_DOMContentLoaded( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2DOMContentLoadedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_DOMContentLoaded(&self, token: i64) -> windows_core::Result<()>; + fn CookieManager(&self) -> windows_core::Result; + fn Environment(&self) -> windows_core::Result; +} +impl ICoreWebView2_2_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn add_WebResourceResponseReceived< + Identity: ICoreWebView2_2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_2_Impl::add_WebResourceResponseReceived( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_WebResourceResponseReceived< + Identity: ICoreWebView2_2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_2_Impl::remove_WebResourceResponseReceived( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn NavigateWithWebResourceRequest< + Identity: ICoreWebView2_2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + request: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_2_Impl::NavigateWithWebResourceRequest( + this, + core::mem::transmute_copy(&request), + ) + .into() + } + } + unsafe extern "system" fn add_DOMContentLoaded< + Identity: ICoreWebView2_2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_2_Impl::add_DOMContentLoaded( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_DOMContentLoaded< + Identity: ICoreWebView2_2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_2_Impl::remove_DOMContentLoaded( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn CookieManager< + Identity: ICoreWebView2_2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + cookiemanager: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2_2_Impl::CookieManager(this) { + Ok(ok__) => { + cookiemanager.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + unsafe extern "system" fn Environment< + Identity: ICoreWebView2_2_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + environment: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2_2_Impl::Environment(this) { + Ok(ok__) => { + environment.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: ICoreWebView2_Vtbl::new::(), + add_WebResourceResponseReceived: add_WebResourceResponseReceived::, + remove_WebResourceResponseReceived: remove_WebResourceResponseReceived::< + Identity, + OFFSET, + >, + NavigateWithWebResourceRequest: NavigateWithWebResourceRequest::, + add_DOMContentLoaded: add_DOMContentLoaded::, + remove_DOMContentLoaded: remove_DOMContentLoaded::, + CookieManager: CookieManager::, + Environment: Environment::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2_2 {} +windows_core::imp::define_interface!( + ICoreWebView2_20, + ICoreWebView2_20_Vtbl, + 0xb4bc1926_7305_11ee_b962_0242ac120002 +); +impl core::ops::Deref for ICoreWebView2_20 { + type Target = ICoreWebView2_19; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2_20, + windows_core::IUnknown, + ICoreWebView2, + ICoreWebView2_2, + ICoreWebView2_3, + ICoreWebView2_4, + ICoreWebView2_5, + ICoreWebView2_6, + ICoreWebView2_7, + ICoreWebView2_8, + ICoreWebView2_9, + ICoreWebView2_10, + ICoreWebView2_11, + ICoreWebView2_12, + ICoreWebView2_13, + ICoreWebView2_14, + ICoreWebView2_15, + ICoreWebView2_16, + ICoreWebView2_17, + ICoreWebView2_18, + ICoreWebView2_19 +); +impl ICoreWebView2_20 { + pub unsafe fn FrameId(&self, value: *mut u32) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).FrameId)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2_20_Vtbl { + pub base__: ICoreWebView2_19_Vtbl, + pub FrameId: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut u32) -> windows_core::HRESULT, +} +pub trait ICoreWebView2_20_Impl: ICoreWebView2_19_Impl { + fn FrameId(&self, value: *mut u32) -> windows_core::Result<()>; +} +impl ICoreWebView2_20_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn FrameId( + this: *mut core::ffi::c_void, + value: *mut u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_20_Impl::FrameId(this, core::mem::transmute_copy(&value)).into() + } + } + Self { + base__: ICoreWebView2_19_Vtbl::new::(), + FrameId: FrameId::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2_20 {} +windows_core::imp::define_interface!( + ICoreWebView2_21, + ICoreWebView2_21_Vtbl, + 0xc4980dea_587b_43b9_8143_3ef3bf552d95 +); +impl core::ops::Deref for ICoreWebView2_21 { + type Target = ICoreWebView2_20; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2_21, + windows_core::IUnknown, + ICoreWebView2, + ICoreWebView2_2, + ICoreWebView2_3, + ICoreWebView2_4, + ICoreWebView2_5, + ICoreWebView2_6, + ICoreWebView2_7, + ICoreWebView2_8, + ICoreWebView2_9, + ICoreWebView2_10, + ICoreWebView2_11, + ICoreWebView2_12, + ICoreWebView2_13, + ICoreWebView2_14, + ICoreWebView2_15, + ICoreWebView2_16, + ICoreWebView2_17, + ICoreWebView2_18, + ICoreWebView2_19, + ICoreWebView2_20 +); +impl ICoreWebView2_21 { + pub unsafe fn ExecuteScriptWithResult( + &self, + javascript: P0, + handler: P1, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).ExecuteScriptWithResult)( + windows_core::Interface::as_raw(self), + javascript.param().abi(), + handler.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2_21_Vtbl { + pub base__: ICoreWebView2_20_Vtbl, + pub ExecuteScriptWithResult: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2_21_Impl: ICoreWebView2_20_Impl { + fn ExecuteScriptWithResult( + &self, + javascript: &windows_core::PCWSTR, + handler: windows_core::Ref<'_, ICoreWebView2ExecuteScriptWithResultCompletedHandler>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2_21_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn ExecuteScriptWithResult< + Identity: ICoreWebView2_21_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + javascript: windows_core::PCWSTR, + handler: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_21_Impl::ExecuteScriptWithResult( + this, + core::mem::transmute(&javascript), + core::mem::transmute_copy(&handler), + ) + .into() + } + } + Self { + base__: ICoreWebView2_20_Vtbl::new::(), + ExecuteScriptWithResult: ExecuteScriptWithResult::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2_21 {} +windows_core::imp::define_interface!( + ICoreWebView2_22, + ICoreWebView2_22_Vtbl, + 0xdb75dfc7_a857_4632_a398_6969dde26c0a +); +impl core::ops::Deref for ICoreWebView2_22 { + type Target = ICoreWebView2_21; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2_22, + windows_core::IUnknown, + ICoreWebView2, + ICoreWebView2_2, + ICoreWebView2_3, + ICoreWebView2_4, + ICoreWebView2_5, + ICoreWebView2_6, + ICoreWebView2_7, + ICoreWebView2_8, + ICoreWebView2_9, + ICoreWebView2_10, + ICoreWebView2_11, + ICoreWebView2_12, + ICoreWebView2_13, + ICoreWebView2_14, + ICoreWebView2_15, + ICoreWebView2_16, + ICoreWebView2_17, + ICoreWebView2_18, + ICoreWebView2_19, + ICoreWebView2_20, + ICoreWebView2_21 +); +impl ICoreWebView2_22 { + pub unsafe fn AddWebResourceRequestedFilterWithRequestSourceKinds( + &self, + uri: P0, + resourcecontext: COREWEBVIEW2_WEB_RESOURCE_CONTEXT, + requestsourcekinds: COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self) + .AddWebResourceRequestedFilterWithRequestSourceKinds)( + windows_core::Interface::as_raw(self), + uri.param().abi(), + resourcecontext, + requestsourcekinds, + ) + .ok() + } + } + pub unsafe fn RemoveWebResourceRequestedFilterWithRequestSourceKinds( + &self, + uri: P0, + resourcecontext: COREWEBVIEW2_WEB_RESOURCE_CONTEXT, + requestsourcekinds: COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self) + .RemoveWebResourceRequestedFilterWithRequestSourceKinds)( + windows_core::Interface::as_raw(self), + uri.param().abi(), + resourcecontext, + requestsourcekinds, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2_22_Vtbl { + pub base__: ICoreWebView2_21_Vtbl, + pub AddWebResourceRequestedFilterWithRequestSourceKinds: + unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + COREWEBVIEW2_WEB_RESOURCE_CONTEXT, + COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS, + ) -> windows_core::HRESULT, + pub RemoveWebResourceRequestedFilterWithRequestSourceKinds: + unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + COREWEBVIEW2_WEB_RESOURCE_CONTEXT, + COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2_22_Impl: ICoreWebView2_21_Impl { + fn AddWebResourceRequestedFilterWithRequestSourceKinds( + &self, + uri: &windows_core::PCWSTR, + resourcecontext: COREWEBVIEW2_WEB_RESOURCE_CONTEXT, + requestsourcekinds: COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS, + ) -> windows_core::Result<()>; + fn RemoveWebResourceRequestedFilterWithRequestSourceKinds( + &self, + uri: &windows_core::PCWSTR, + resourcecontext: COREWEBVIEW2_WEB_RESOURCE_CONTEXT, + requestsourcekinds: COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2_22_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn AddWebResourceRequestedFilterWithRequestSourceKinds< + Identity: ICoreWebView2_22_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + uri: windows_core::PCWSTR, + resourcecontext: COREWEBVIEW2_WEB_RESOURCE_CONTEXT, + requestsourcekinds: COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_22_Impl::AddWebResourceRequestedFilterWithRequestSourceKinds( + this, + core::mem::transmute(&uri), + core::mem::transmute_copy(&resourcecontext), + core::mem::transmute_copy(&requestsourcekinds), + ) + .into() + } + } + unsafe extern "system" fn RemoveWebResourceRequestedFilterWithRequestSourceKinds< + Identity: ICoreWebView2_22_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + uri: windows_core::PCWSTR, + resourcecontext: COREWEBVIEW2_WEB_RESOURCE_CONTEXT, + requestsourcekinds: COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_22_Impl::RemoveWebResourceRequestedFilterWithRequestSourceKinds( + this, + core::mem::transmute(&uri), + core::mem::transmute_copy(&resourcecontext), + core::mem::transmute_copy(&requestsourcekinds), + ) + .into() + } + } + Self { + base__: ICoreWebView2_21_Vtbl::new::(), + AddWebResourceRequestedFilterWithRequestSourceKinds: + AddWebResourceRequestedFilterWithRequestSourceKinds::, + RemoveWebResourceRequestedFilterWithRequestSourceKinds: + RemoveWebResourceRequestedFilterWithRequestSourceKinds::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2_22 {} +windows_core::imp::define_interface!( + ICoreWebView2_23, + ICoreWebView2_23_Vtbl, + 0x508f0db5_90c4_5872_90a7_267a91377502 +); +impl core::ops::Deref for ICoreWebView2_23 { + type Target = ICoreWebView2_22; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2_23, + windows_core::IUnknown, + ICoreWebView2, + ICoreWebView2_2, + ICoreWebView2_3, + ICoreWebView2_4, + ICoreWebView2_5, + ICoreWebView2_6, + ICoreWebView2_7, + ICoreWebView2_8, + ICoreWebView2_9, + ICoreWebView2_10, + ICoreWebView2_11, + ICoreWebView2_12, + ICoreWebView2_13, + ICoreWebView2_14, + ICoreWebView2_15, + ICoreWebView2_16, + ICoreWebView2_17, + ICoreWebView2_18, + ICoreWebView2_19, + ICoreWebView2_20, + ICoreWebView2_21, + ICoreWebView2_22 +); +impl ICoreWebView2_23 { + pub unsafe fn PostWebMessageAsJsonWithAdditionalObjects( + &self, + webmessageasjson: P0, + additionalobjects: P1, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).PostWebMessageAsJsonWithAdditionalObjects)( + windows_core::Interface::as_raw(self), + webmessageasjson.param().abi(), + additionalobjects.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2_23_Vtbl { + pub base__: ICoreWebView2_22_Vtbl, + pub PostWebMessageAsJsonWithAdditionalObjects: + unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2_23_Impl: ICoreWebView2_22_Impl { + fn PostWebMessageAsJsonWithAdditionalObjects( + &self, + webmessageasjson: &windows_core::PCWSTR, + additionalobjects: windows_core::Ref<'_, ICoreWebView2ObjectCollectionView>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2_23_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn PostWebMessageAsJsonWithAdditionalObjects< + Identity: ICoreWebView2_23_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + webmessageasjson: windows_core::PCWSTR, + additionalobjects: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_23_Impl::PostWebMessageAsJsonWithAdditionalObjects( + this, + core::mem::transmute(&webmessageasjson), + core::mem::transmute_copy(&additionalobjects), + ) + .into() + } + } + Self { + base__: ICoreWebView2_22_Vtbl::new::(), + PostWebMessageAsJsonWithAdditionalObjects: PostWebMessageAsJsonWithAdditionalObjects::< + Identity, + OFFSET, + >, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2_23 {} +windows_core::imp::define_interface!( + ICoreWebView2_24, + ICoreWebView2_24_Vtbl, + 0x39a7ad55_4287_5cc1_88a1_c6f458593824 +); +impl core::ops::Deref for ICoreWebView2_24 { + type Target = ICoreWebView2_23; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2_24, + windows_core::IUnknown, + ICoreWebView2, + ICoreWebView2_2, + ICoreWebView2_3, + ICoreWebView2_4, + ICoreWebView2_5, + ICoreWebView2_6, + ICoreWebView2_7, + ICoreWebView2_8, + ICoreWebView2_9, + ICoreWebView2_10, + ICoreWebView2_11, + ICoreWebView2_12, + ICoreWebView2_13, + ICoreWebView2_14, + ICoreWebView2_15, + ICoreWebView2_16, + ICoreWebView2_17, + ICoreWebView2_18, + ICoreWebView2_19, + ICoreWebView2_20, + ICoreWebView2_21, + ICoreWebView2_22, + ICoreWebView2_23 +); +impl ICoreWebView2_24 { + pub unsafe fn add_NotificationReceived( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_NotificationReceived)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_NotificationReceived(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_NotificationReceived)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2_24_Vtbl { + pub base__: ICoreWebView2_23_Vtbl, + pub add_NotificationReceived: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_NotificationReceived: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, +} +pub trait ICoreWebView2_24_Impl: ICoreWebView2_23_Impl { + fn add_NotificationReceived( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2NotificationReceivedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_NotificationReceived(&self, token: i64) -> windows_core::Result<()>; +} +impl ICoreWebView2_24_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn add_NotificationReceived< + Identity: ICoreWebView2_24_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_24_Impl::add_NotificationReceived( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_NotificationReceived< + Identity: ICoreWebView2_24_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_24_Impl::remove_NotificationReceived( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + Self { + base__: ICoreWebView2_23_Vtbl::new::(), + add_NotificationReceived: add_NotificationReceived::, + remove_NotificationReceived: remove_NotificationReceived::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2_24 {} +windows_core::imp::define_interface!( + ICoreWebView2_25, + ICoreWebView2_25_Vtbl, + 0xb5a86092_df50_5b4f_a17b_6c8f8b40b771 +); +impl core::ops::Deref for ICoreWebView2_25 { + type Target = ICoreWebView2_24; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2_25, + windows_core::IUnknown, + ICoreWebView2, + ICoreWebView2_2, + ICoreWebView2_3, + ICoreWebView2_4, + ICoreWebView2_5, + ICoreWebView2_6, + ICoreWebView2_7, + ICoreWebView2_8, + ICoreWebView2_9, + ICoreWebView2_10, + ICoreWebView2_11, + ICoreWebView2_12, + ICoreWebView2_13, + ICoreWebView2_14, + ICoreWebView2_15, + ICoreWebView2_16, + ICoreWebView2_17, + ICoreWebView2_18, + ICoreWebView2_19, + ICoreWebView2_20, + ICoreWebView2_21, + ICoreWebView2_22, + ICoreWebView2_23, + ICoreWebView2_24 +); +impl ICoreWebView2_25 { + pub unsafe fn add_SaveAsUIShowing( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_SaveAsUIShowing)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_SaveAsUIShowing(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_SaveAsUIShowing)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } + pub unsafe fn ShowSaveAsUI(&self, handler: P0) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).ShowSaveAsUI)( + windows_core::Interface::as_raw(self), + handler.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2_25_Vtbl { + pub base__: ICoreWebView2_24_Vtbl, + pub add_SaveAsUIShowing: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_SaveAsUIShowing: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, + pub ShowSaveAsUI: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2_25_Impl: ICoreWebView2_24_Impl { + fn add_SaveAsUIShowing( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2SaveAsUIShowingEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_SaveAsUIShowing(&self, token: i64) -> windows_core::Result<()>; + fn ShowSaveAsUI( + &self, + handler: windows_core::Ref<'_, ICoreWebView2ShowSaveAsUICompletedHandler>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2_25_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn add_SaveAsUIShowing< + Identity: ICoreWebView2_25_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_25_Impl::add_SaveAsUIShowing( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_SaveAsUIShowing< + Identity: ICoreWebView2_25_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_25_Impl::remove_SaveAsUIShowing( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn ShowSaveAsUI< + Identity: ICoreWebView2_25_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + handler: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_25_Impl::ShowSaveAsUI(this, core::mem::transmute_copy(&handler)) + .into() + } + } + Self { + base__: ICoreWebView2_24_Vtbl::new::(), + add_SaveAsUIShowing: add_SaveAsUIShowing::, + remove_SaveAsUIShowing: remove_SaveAsUIShowing::, + ShowSaveAsUI: ShowSaveAsUI::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2_25 {} +windows_core::imp::define_interface!( + ICoreWebView2_26, + ICoreWebView2_26_Vtbl, + 0x806268b8_f897_5685_88e5_c45fca0b1a48 +); +impl core::ops::Deref for ICoreWebView2_26 { + type Target = ICoreWebView2_25; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2_26, + windows_core::IUnknown, + ICoreWebView2, + ICoreWebView2_2, + ICoreWebView2_3, + ICoreWebView2_4, + ICoreWebView2_5, + ICoreWebView2_6, + ICoreWebView2_7, + ICoreWebView2_8, + ICoreWebView2_9, + ICoreWebView2_10, + ICoreWebView2_11, + ICoreWebView2_12, + ICoreWebView2_13, + ICoreWebView2_14, + ICoreWebView2_15, + ICoreWebView2_16, + ICoreWebView2_17, + ICoreWebView2_18, + ICoreWebView2_19, + ICoreWebView2_20, + ICoreWebView2_21, + ICoreWebView2_22, + ICoreWebView2_23, + ICoreWebView2_24, + ICoreWebView2_25 +); +impl ICoreWebView2_26 { + pub unsafe fn add_SaveFileSecurityCheckStarting( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_SaveFileSecurityCheckStarting)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_SaveFileSecurityCheckStarting( + &self, + token: i64, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_SaveFileSecurityCheckStarting)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2_26_Vtbl { + pub base__: ICoreWebView2_25_Vtbl, + pub add_SaveFileSecurityCheckStarting: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_SaveFileSecurityCheckStarting: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, +} +pub trait ICoreWebView2_26_Impl: ICoreWebView2_25_Impl { + fn add_SaveFileSecurityCheckStarting( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2SaveFileSecurityCheckStartingEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_SaveFileSecurityCheckStarting(&self, token: i64) -> windows_core::Result<()>; +} +impl ICoreWebView2_26_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn add_SaveFileSecurityCheckStarting< + Identity: ICoreWebView2_26_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_26_Impl::add_SaveFileSecurityCheckStarting( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_SaveFileSecurityCheckStarting< + Identity: ICoreWebView2_26_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_26_Impl::remove_SaveFileSecurityCheckStarting( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + Self { + base__: ICoreWebView2_25_Vtbl::new::(), + add_SaveFileSecurityCheckStarting: add_SaveFileSecurityCheckStarting::, + remove_SaveFileSecurityCheckStarting: remove_SaveFileSecurityCheckStarting::< + Identity, + OFFSET, + >, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2_26 {} +windows_core::imp::define_interface!( + ICoreWebView2_27, + ICoreWebView2_27_Vtbl, + 0x00fbe33b_8c07_517c_aa23_0ddd4b5f6fa0 +); +impl core::ops::Deref for ICoreWebView2_27 { + type Target = ICoreWebView2_26; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2_27, + windows_core::IUnknown, + ICoreWebView2, + ICoreWebView2_2, + ICoreWebView2_3, + ICoreWebView2_4, + ICoreWebView2_5, + ICoreWebView2_6, + ICoreWebView2_7, + ICoreWebView2_8, + ICoreWebView2_9, + ICoreWebView2_10, + ICoreWebView2_11, + ICoreWebView2_12, + ICoreWebView2_13, + ICoreWebView2_14, + ICoreWebView2_15, + ICoreWebView2_16, + ICoreWebView2_17, + ICoreWebView2_18, + ICoreWebView2_19, + ICoreWebView2_20, + ICoreWebView2_21, + ICoreWebView2_22, + ICoreWebView2_23, + ICoreWebView2_24, + ICoreWebView2_25, + ICoreWebView2_26 +); +impl ICoreWebView2_27 { + pub unsafe fn add_ScreenCaptureStarting( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_ScreenCaptureStarting)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_ScreenCaptureStarting(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_ScreenCaptureStarting)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2_27_Vtbl { + pub base__: ICoreWebView2_26_Vtbl, + pub add_ScreenCaptureStarting: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_ScreenCaptureStarting: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, +} +pub trait ICoreWebView2_27_Impl: ICoreWebView2_26_Impl { + fn add_ScreenCaptureStarting( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2ScreenCaptureStartingEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_ScreenCaptureStarting(&self, token: i64) -> windows_core::Result<()>; +} +impl ICoreWebView2_27_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn add_ScreenCaptureStarting< + Identity: ICoreWebView2_27_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_27_Impl::add_ScreenCaptureStarting( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_ScreenCaptureStarting< + Identity: ICoreWebView2_27_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_27_Impl::remove_ScreenCaptureStarting( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + Self { + base__: ICoreWebView2_26_Vtbl::new::(), + add_ScreenCaptureStarting: add_ScreenCaptureStarting::, + remove_ScreenCaptureStarting: remove_ScreenCaptureStarting::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2_27 {} +windows_core::imp::define_interface!( + ICoreWebView2_28, + ICoreWebView2_28_Vtbl, + 0x62e50381_5bf5_51a8_aae0_f20a3a9c8a90 +); +impl core::ops::Deref for ICoreWebView2_28 { + type Target = ICoreWebView2_27; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2_28, + windows_core::IUnknown, + ICoreWebView2, + ICoreWebView2_2, + ICoreWebView2_3, + ICoreWebView2_4, + ICoreWebView2_5, + ICoreWebView2_6, + ICoreWebView2_7, + ICoreWebView2_8, + ICoreWebView2_9, + ICoreWebView2_10, + ICoreWebView2_11, + ICoreWebView2_12, + ICoreWebView2_13, + ICoreWebView2_14, + ICoreWebView2_15, + ICoreWebView2_16, + ICoreWebView2_17, + ICoreWebView2_18, + ICoreWebView2_19, + ICoreWebView2_20, + ICoreWebView2_21, + ICoreWebView2_22, + ICoreWebView2_23, + ICoreWebView2_24, + ICoreWebView2_25, + ICoreWebView2_26, + ICoreWebView2_27 +); +impl ICoreWebView2_28 { + pub unsafe fn Find(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).Find)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2_28_Vtbl { + pub base__: ICoreWebView2_27_Vtbl, + pub Find: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2_28_Impl: ICoreWebView2_27_Impl { + fn Find(&self) -> windows_core::Result; +} +impl ICoreWebView2_28_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn Find( + this: *mut core::ffi::c_void, + value: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match ICoreWebView2_28_Impl::Find(this) { + Ok(ok__) => { + value.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: ICoreWebView2_27_Vtbl::new::(), + Find: Find::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2_28 {} +windows_core::imp::define_interface!( + ICoreWebView2_3, + ICoreWebView2_3_Vtbl, + 0xa0d6df20_3b92_416d_aa0c_437a9c727857 +); +impl core::ops::Deref for ICoreWebView2_3 { + type Target = ICoreWebView2_2; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2_3, + windows_core::IUnknown, + ICoreWebView2, + ICoreWebView2_2 +); +impl ICoreWebView2_3 { + pub unsafe fn TrySuspend(&self, handler: P0) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).TrySuspend)( + windows_core::Interface::as_raw(self), + handler.param().abi(), + ) + .ok() + } + } + pub unsafe fn Resume(&self) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).Resume)(windows_core::Interface::as_raw(self)) + .ok() + } + } + pub unsafe fn IsSuspended( + &self, + issuspended: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).IsSuspended)( + windows_core::Interface::as_raw(self), + issuspended as _, + ) + .ok() + } + } + pub unsafe fn SetVirtualHostNameToFolderMapping( + &self, + hostname: P0, + folderpath: P1, + accesskind: COREWEBVIEW2_HOST_RESOURCE_ACCESS_KIND, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).SetVirtualHostNameToFolderMapping)( + windows_core::Interface::as_raw(self), + hostname.param().abi(), + folderpath.param().abi(), + accesskind, + ) + .ok() + } + } + pub unsafe fn ClearVirtualHostNameToFolderMapping( + &self, + hostname: P0, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).ClearVirtualHostNameToFolderMapping)( + windows_core::Interface::as_raw(self), + hostname.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2_3_Vtbl { + pub base__: ICoreWebView2_2_Vtbl, + pub TrySuspend: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, + pub Resume: unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT, + pub IsSuspended: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetVirtualHostNameToFolderMapping: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + windows_core::PCWSTR, + COREWEBVIEW2_HOST_RESOURCE_ACCESS_KIND, + ) -> windows_core::HRESULT, + pub ClearVirtualHostNameToFolderMapping: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + ) + -> windows_core::HRESULT, +} +pub trait ICoreWebView2_3_Impl: ICoreWebView2_2_Impl { + fn TrySuspend( + &self, + handler: windows_core::Ref<'_, ICoreWebView2TrySuspendCompletedHandler>, + ) -> windows_core::Result<()>; + fn Resume(&self) -> windows_core::Result<()>; + fn IsSuspended(&self, issuspended: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn SetVirtualHostNameToFolderMapping( + &self, + hostname: &windows_core::PCWSTR, + folderpath: &windows_core::PCWSTR, + accesskind: COREWEBVIEW2_HOST_RESOURCE_ACCESS_KIND, + ) -> windows_core::Result<()>; + fn ClearVirtualHostNameToFolderMapping( + &self, + hostname: &windows_core::PCWSTR, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2_3_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn TrySuspend< + Identity: ICoreWebView2_3_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + handler: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_3_Impl::TrySuspend(this, core::mem::transmute_copy(&handler)).into() + } + } + unsafe extern "system" fn Resume( + this: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_3_Impl::Resume(this).into() + } + } + unsafe extern "system" fn IsSuspended< + Identity: ICoreWebView2_3_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + issuspended: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_3_Impl::IsSuspended(this, core::mem::transmute_copy(&issuspended)) + .into() + } + } + unsafe extern "system" fn SetVirtualHostNameToFolderMapping< + Identity: ICoreWebView2_3_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + hostname: windows_core::PCWSTR, + folderpath: windows_core::PCWSTR, + accesskind: COREWEBVIEW2_HOST_RESOURCE_ACCESS_KIND, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_3_Impl::SetVirtualHostNameToFolderMapping( + this, + core::mem::transmute(&hostname), + core::mem::transmute(&folderpath), + core::mem::transmute_copy(&accesskind), + ) + .into() + } + } + unsafe extern "system" fn ClearVirtualHostNameToFolderMapping< + Identity: ICoreWebView2_3_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + hostname: windows_core::PCWSTR, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_3_Impl::ClearVirtualHostNameToFolderMapping( + this, + core::mem::transmute(&hostname), + ) + .into() + } + } + Self { + base__: ICoreWebView2_2_Vtbl::new::(), + TrySuspend: TrySuspend::, + Resume: Resume::, + IsSuspended: IsSuspended::, + SetVirtualHostNameToFolderMapping: SetVirtualHostNameToFolderMapping::, + ClearVirtualHostNameToFolderMapping: ClearVirtualHostNameToFolderMapping::< + Identity, + OFFSET, + >, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2_3 {} +windows_core::imp::define_interface!( + ICoreWebView2_4, + ICoreWebView2_4_Vtbl, + 0x20d02d59_6df2_42dc_bd06_f98a694b1302 +); +impl core::ops::Deref for ICoreWebView2_4 { + type Target = ICoreWebView2_3; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2_4, + windows_core::IUnknown, + ICoreWebView2, + ICoreWebView2_2, + ICoreWebView2_3 +); +impl ICoreWebView2_4 { + pub unsafe fn add_FrameCreated( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_FrameCreated)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_FrameCreated(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_FrameCreated)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } + pub unsafe fn add_DownloadStarting( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_DownloadStarting)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_DownloadStarting(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_DownloadStarting)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2_4_Vtbl { + pub base__: ICoreWebView2_3_Vtbl, + pub add_FrameCreated: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_FrameCreated: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, + pub add_DownloadStarting: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_DownloadStarting: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, +} +pub trait ICoreWebView2_4_Impl: ICoreWebView2_3_Impl { + fn add_FrameCreated( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2FrameCreatedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_FrameCreated(&self, token: i64) -> windows_core::Result<()>; + fn add_DownloadStarting( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2DownloadStartingEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_DownloadStarting(&self, token: i64) -> windows_core::Result<()>; +} +impl ICoreWebView2_4_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn add_FrameCreated< + Identity: ICoreWebView2_4_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_4_Impl::add_FrameCreated( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_FrameCreated< + Identity: ICoreWebView2_4_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_4_Impl::remove_FrameCreated(this, core::mem::transmute_copy(&token)) + .into() + } + } + unsafe extern "system" fn add_DownloadStarting< + Identity: ICoreWebView2_4_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_4_Impl::add_DownloadStarting( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_DownloadStarting< + Identity: ICoreWebView2_4_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_4_Impl::remove_DownloadStarting( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + Self { + base__: ICoreWebView2_3_Vtbl::new::(), + add_FrameCreated: add_FrameCreated::, + remove_FrameCreated: remove_FrameCreated::, + add_DownloadStarting: add_DownloadStarting::, + remove_DownloadStarting: remove_DownloadStarting::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2_4 {} +windows_core::imp::define_interface!( + ICoreWebView2_5, + ICoreWebView2_5_Vtbl, + 0xbedb11b8_d63c_11eb_b8bc_0242ac130003 +); +impl core::ops::Deref for ICoreWebView2_5 { + type Target = ICoreWebView2_4; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2_5, + windows_core::IUnknown, + ICoreWebView2, + ICoreWebView2_2, + ICoreWebView2_3, + ICoreWebView2_4 +); +impl ICoreWebView2_5 { + pub unsafe fn add_ClientCertificateRequested( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_ClientCertificateRequested)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_ClientCertificateRequested(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_ClientCertificateRequested)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2_5_Vtbl { + pub base__: ICoreWebView2_4_Vtbl, + pub add_ClientCertificateRequested: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_ClientCertificateRequested: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, +} +pub trait ICoreWebView2_5_Impl: ICoreWebView2_4_Impl { + fn add_ClientCertificateRequested( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2ClientCertificateRequestedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_ClientCertificateRequested(&self, token: i64) -> windows_core::Result<()>; +} +impl ICoreWebView2_5_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn add_ClientCertificateRequested< + Identity: ICoreWebView2_5_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_5_Impl::add_ClientCertificateRequested( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_ClientCertificateRequested< + Identity: ICoreWebView2_5_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_5_Impl::remove_ClientCertificateRequested( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + Self { + base__: ICoreWebView2_4_Vtbl::new::(), + add_ClientCertificateRequested: add_ClientCertificateRequested::, + remove_ClientCertificateRequested: remove_ClientCertificateRequested::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2_5 {} +windows_core::imp::define_interface!( + ICoreWebView2_6, + ICoreWebView2_6_Vtbl, + 0x499aadac_d92c_4589_8a75_111bfc167795 +); +impl core::ops::Deref for ICoreWebView2_6 { + type Target = ICoreWebView2_5; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2_6, + windows_core::IUnknown, + ICoreWebView2, + ICoreWebView2_2, + ICoreWebView2_3, + ICoreWebView2_4, + ICoreWebView2_5 +); +impl ICoreWebView2_6 { + pub unsafe fn OpenTaskManagerWindow(&self) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).OpenTaskManagerWindow)( + windows_core::Interface::as_raw(self), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2_6_Vtbl { + pub base__: ICoreWebView2_5_Vtbl, + pub OpenTaskManagerWindow: + unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT, +} +pub trait ICoreWebView2_6_Impl: ICoreWebView2_5_Impl { + fn OpenTaskManagerWindow(&self) -> windows_core::Result<()>; +} +impl ICoreWebView2_6_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn OpenTaskManagerWindow< + Identity: ICoreWebView2_6_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_6_Impl::OpenTaskManagerWindow(this).into() + } + } + Self { + base__: ICoreWebView2_5_Vtbl::new::(), + OpenTaskManagerWindow: OpenTaskManagerWindow::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2_6 {} +windows_core::imp::define_interface!( + ICoreWebView2_7, + ICoreWebView2_7_Vtbl, + 0x79c24d83_09a3_45ae_9418_487f32a58740 +); +impl core::ops::Deref for ICoreWebView2_7 { + type Target = ICoreWebView2_6; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2_7, + windows_core::IUnknown, + ICoreWebView2, + ICoreWebView2_2, + ICoreWebView2_3, + ICoreWebView2_4, + ICoreWebView2_5, + ICoreWebView2_6 +); +impl ICoreWebView2_7 { + pub unsafe fn PrintToPdf( + &self, + resultfilepath: P0, + printsettings: P1, + handler: P2, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + P1: windows_core::Param, + P2: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).PrintToPdf)( + windows_core::Interface::as_raw(self), + resultfilepath.param().abi(), + printsettings.param().abi(), + handler.param().abi(), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2_7_Vtbl { + pub base__: ICoreWebView2_6_Vtbl, + pub PrintToPdf: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::PCWSTR, + *mut core::ffi::c_void, + *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2_7_Impl: ICoreWebView2_6_Impl { + fn PrintToPdf( + &self, + resultfilepath: &windows_core::PCWSTR, + printsettings: windows_core::Ref<'_, ICoreWebView2PrintSettings>, + handler: windows_core::Ref<'_, ICoreWebView2PrintToPdfCompletedHandler>, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2_7_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn PrintToPdf< + Identity: ICoreWebView2_7_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + resultfilepath: windows_core::PCWSTR, + printsettings: *mut core::ffi::c_void, + handler: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_7_Impl::PrintToPdf( + this, + core::mem::transmute(&resultfilepath), + core::mem::transmute_copy(&printsettings), + core::mem::transmute_copy(&handler), + ) + .into() + } + } + Self { + base__: ICoreWebView2_6_Vtbl::new::(), + PrintToPdf: PrintToPdf::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2_7 {} +windows_core::imp::define_interface!( + ICoreWebView2_8, + ICoreWebView2_8_Vtbl, + 0xe9632730_6e1e_43ab_b7b8_7b2c9e62e094 +); +impl core::ops::Deref for ICoreWebView2_8 { + type Target = ICoreWebView2_7; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2_8, + windows_core::IUnknown, + ICoreWebView2, + ICoreWebView2_2, + ICoreWebView2_3, + ICoreWebView2_4, + ICoreWebView2_5, + ICoreWebView2_6, + ICoreWebView2_7 +); +impl ICoreWebView2_8 { + pub unsafe fn add_IsMutedChanged( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_IsMutedChanged)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_IsMutedChanged(&self, token: i64) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_IsMutedChanged)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } + pub unsafe fn IsMuted(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).IsMuted)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetIsMuted(&self, value: bool) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetIsMuted)( + windows_core::Interface::as_raw(self), + value.into(), + ) + .ok() + } + } + pub unsafe fn add_IsDocumentPlayingAudioChanged( + &self, + eventhandler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_IsDocumentPlayingAudioChanged)( + windows_core::Interface::as_raw(self), + eventhandler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_IsDocumentPlayingAudioChanged( + &self, + token: i64, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_IsDocumentPlayingAudioChanged)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } + pub unsafe fn IsDocumentPlayingAudio( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).IsDocumentPlayingAudio)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2_8_Vtbl { + pub base__: ICoreWebView2_7_Vtbl, + pub add_IsMutedChanged: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_IsMutedChanged: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, + pub IsMuted: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub SetIsMuted: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows_core::BOOL, + ) -> windows_core::HRESULT, + pub add_IsDocumentPlayingAudioChanged: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) -> windows_core::HRESULT, + pub remove_IsDocumentPlayingAudioChanged: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, + pub IsDocumentPlayingAudio: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2_8_Impl: ICoreWebView2_7_Impl { + fn add_IsMutedChanged( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2IsMutedChangedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_IsMutedChanged(&self, token: i64) -> windows_core::Result<()>; + fn IsMuted(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; + fn SetIsMuted(&self, value: windows_core::BOOL) -> windows_core::Result<()>; + fn add_IsDocumentPlayingAudioChanged( + &self, + eventhandler: windows_core::Ref<'_, ICoreWebView2IsDocumentPlayingAudioChangedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_IsDocumentPlayingAudioChanged(&self, token: i64) -> windows_core::Result<()>; + fn IsDocumentPlayingAudio(&self, value: *mut windows_core::BOOL) -> windows_core::Result<()>; +} +impl ICoreWebView2_8_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn add_IsMutedChanged< + Identity: ICoreWebView2_8_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_8_Impl::add_IsMutedChanged( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_IsMutedChanged< + Identity: ICoreWebView2_8_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_8_Impl::remove_IsMutedChanged(this, core::mem::transmute_copy(&token)) + .into() + } + } + unsafe extern "system" fn IsMuted( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_8_Impl::IsMuted(this, core::mem::transmute_copy(&value)).into() + } + } + unsafe extern "system" fn SetIsMuted< + Identity: ICoreWebView2_8_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_8_Impl::SetIsMuted(this, core::mem::transmute_copy(&value)).into() + } + } + unsafe extern "system" fn add_IsDocumentPlayingAudioChanged< + Identity: ICoreWebView2_8_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + eventhandler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_8_Impl::add_IsDocumentPlayingAudioChanged( + this, + core::mem::transmute_copy(&eventhandler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_IsDocumentPlayingAudioChanged< + Identity: ICoreWebView2_8_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_8_Impl::remove_IsDocumentPlayingAudioChanged( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn IsDocumentPlayingAudio< + Identity: ICoreWebView2_8_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_8_Impl::IsDocumentPlayingAudio( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + Self { + base__: ICoreWebView2_7_Vtbl::new::(), + add_IsMutedChanged: add_IsMutedChanged::, + remove_IsMutedChanged: remove_IsMutedChanged::, + IsMuted: IsMuted::, + SetIsMuted: SetIsMuted::, + add_IsDocumentPlayingAudioChanged: add_IsDocumentPlayingAudioChanged::, + remove_IsDocumentPlayingAudioChanged: remove_IsDocumentPlayingAudioChanged::< + Identity, + OFFSET, + >, + IsDocumentPlayingAudio: IsDocumentPlayingAudio::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2_8 {} +windows_core::imp::define_interface!( + ICoreWebView2_9, + ICoreWebView2_9_Vtbl, + 0x4d7b2eab_9fdc_468d_b998_a9260b5ed651 +); +impl core::ops::Deref for ICoreWebView2_9 { + type Target = ICoreWebView2_8; + fn deref(&self) -> &Self::Target { + unsafe { core::mem::transmute(self) } + } +} +windows_core::imp::interface_hierarchy!( + ICoreWebView2_9, + windows_core::IUnknown, + ICoreWebView2, + ICoreWebView2_2, + ICoreWebView2_3, + ICoreWebView2_4, + ICoreWebView2_5, + ICoreWebView2_6, + ICoreWebView2_7, + ICoreWebView2_8 +); +impl ICoreWebView2_9 { + pub unsafe fn add_IsDefaultDownloadDialogOpenChanged( + &self, + handler: P0, + token: *mut i64, + ) -> windows_core::Result<()> + where + P0: windows_core::Param, + { + unsafe { + (windows_core::Interface::vtable(self).add_IsDefaultDownloadDialogOpenChanged)( + windows_core::Interface::as_raw(self), + handler.param().abi(), + token as _, + ) + .ok() + } + } + pub unsafe fn remove_IsDefaultDownloadDialogOpenChanged( + &self, + token: i64, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).remove_IsDefaultDownloadDialogOpenChanged)( + windows_core::Interface::as_raw(self), + token, + ) + .ok() + } + } + pub unsafe fn IsDefaultDownloadDialogOpen( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).IsDefaultDownloadDialogOpen)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn OpenDefaultDownloadDialog(&self) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).OpenDefaultDownloadDialog)( + windows_core::Interface::as_raw(self), + ) + .ok() + } + } + pub unsafe fn CloseDefaultDownloadDialog(&self) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).CloseDefaultDownloadDialog)( + windows_core::Interface::as_raw(self), + ) + .ok() + } + } + pub unsafe fn DefaultDownloadDialogCornerAlignment( + &self, + value: *mut COREWEBVIEW2_DEFAULT_DOWNLOAD_DIALOG_CORNER_ALIGNMENT, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).DefaultDownloadDialogCornerAlignment)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetDefaultDownloadDialogCornerAlignment( + &self, + value: COREWEBVIEW2_DEFAULT_DOWNLOAD_DIALOG_CORNER_ALIGNMENT, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetDefaultDownloadDialogCornerAlignment)( + windows_core::Interface::as_raw(self), + value, + ) + .ok() + } + } + pub unsafe fn DefaultDownloadDialogMargin( + &self, + value: *mut windows::Win32::Foundation::POINT, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).DefaultDownloadDialogMargin)( + windows_core::Interface::as_raw(self), + value as _, + ) + .ok() + } + } + pub unsafe fn SetDefaultDownloadDialogMargin( + &self, + value: windows::Win32::Foundation::POINT, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).SetDefaultDownloadDialogMargin)( + windows_core::Interface::as_raw(self), + core::mem::transmute(value), + ) + .ok() + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct ICoreWebView2_9_Vtbl { + pub base__: ICoreWebView2_8_Vtbl, + pub add_IsDefaultDownloadDialogOpenChanged: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut core::ffi::c_void, + *mut i64, + ) + -> windows_core::HRESULT, + pub remove_IsDefaultDownloadDialogOpenChanged: + unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT, + pub IsDefaultDownloadDialogOpen: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows_core::BOOL, + ) -> windows_core::HRESULT, + pub OpenDefaultDownloadDialog: + unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT, + pub CloseDefaultDownloadDialog: + unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT, + pub DefaultDownloadDialogCornerAlignment: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut COREWEBVIEW2_DEFAULT_DOWNLOAD_DIALOG_CORNER_ALIGNMENT, + ) + -> windows_core::HRESULT, + pub SetDefaultDownloadDialogCornerAlignment: unsafe extern "system" fn( + *mut core::ffi::c_void, + COREWEBVIEW2_DEFAULT_DOWNLOAD_DIALOG_CORNER_ALIGNMENT, + ) + -> windows_core::HRESULT, + pub DefaultDownloadDialogMargin: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut windows::Win32::Foundation::POINT, + ) -> windows_core::HRESULT, + pub SetDefaultDownloadDialogMargin: unsafe extern "system" fn( + *mut core::ffi::c_void, + windows::Win32::Foundation::POINT, + ) -> windows_core::HRESULT, +} +pub trait ICoreWebView2_9_Impl: ICoreWebView2_8_Impl { + fn add_IsDefaultDownloadDialogOpenChanged( + &self, + handler: windows_core::Ref<'_, ICoreWebView2IsDefaultDownloadDialogOpenChangedEventHandler>, + token: *mut i64, + ) -> windows_core::Result<()>; + fn remove_IsDefaultDownloadDialogOpenChanged(&self, token: i64) -> windows_core::Result<()>; + fn IsDefaultDownloadDialogOpen( + &self, + value: *mut windows_core::BOOL, + ) -> windows_core::Result<()>; + fn OpenDefaultDownloadDialog(&self) -> windows_core::Result<()>; + fn CloseDefaultDownloadDialog(&self) -> windows_core::Result<()>; + fn DefaultDownloadDialogCornerAlignment( + &self, + value: *mut COREWEBVIEW2_DEFAULT_DOWNLOAD_DIALOG_CORNER_ALIGNMENT, + ) -> windows_core::Result<()>; + fn SetDefaultDownloadDialogCornerAlignment( + &self, + value: COREWEBVIEW2_DEFAULT_DOWNLOAD_DIALOG_CORNER_ALIGNMENT, + ) -> windows_core::Result<()>; + fn DefaultDownloadDialogMargin( + &self, + value: *mut windows::Win32::Foundation::POINT, + ) -> windows_core::Result<()>; + fn SetDefaultDownloadDialogMargin( + &self, + value: &windows::Win32::Foundation::POINT, + ) -> windows_core::Result<()>; +} +impl ICoreWebView2_9_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn add_IsDefaultDownloadDialogOpenChanged< + Identity: ICoreWebView2_9_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + handler: *mut core::ffi::c_void, + token: *mut i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_9_Impl::add_IsDefaultDownloadDialogOpenChanged( + this, + core::mem::transmute_copy(&handler), + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn remove_IsDefaultDownloadDialogOpenChanged< + Identity: ICoreWebView2_9_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + token: i64, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_9_Impl::remove_IsDefaultDownloadDialogOpenChanged( + this, + core::mem::transmute_copy(&token), + ) + .into() + } + } + unsafe extern "system" fn IsDefaultDownloadDialogOpen< + Identity: ICoreWebView2_9_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows_core::BOOL, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_9_Impl::IsDefaultDownloadDialogOpen( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn OpenDefaultDownloadDialog< + Identity: ICoreWebView2_9_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_9_Impl::OpenDefaultDownloadDialog(this).into() + } + } + unsafe extern "system" fn CloseDefaultDownloadDialog< + Identity: ICoreWebView2_9_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_9_Impl::CloseDefaultDownloadDialog(this).into() + } + } + unsafe extern "system" fn DefaultDownloadDialogCornerAlignment< + Identity: ICoreWebView2_9_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut COREWEBVIEW2_DEFAULT_DOWNLOAD_DIALOG_CORNER_ALIGNMENT, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_9_Impl::DefaultDownloadDialogCornerAlignment( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetDefaultDownloadDialogCornerAlignment< + Identity: ICoreWebView2_9_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: COREWEBVIEW2_DEFAULT_DOWNLOAD_DIALOG_CORNER_ALIGNMENT, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_9_Impl::SetDefaultDownloadDialogCornerAlignment( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn DefaultDownloadDialogMargin< + Identity: ICoreWebView2_9_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: *mut windows::Win32::Foundation::POINT, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_9_Impl::DefaultDownloadDialogMargin( + this, + core::mem::transmute_copy(&value), + ) + .into() + } + } + unsafe extern "system" fn SetDefaultDownloadDialogMargin< + Identity: ICoreWebView2_9_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + value: windows::Win32::Foundation::POINT, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + ICoreWebView2_9_Impl::SetDefaultDownloadDialogMargin( + this, + core::mem::transmute(&value), + ) + .into() + } + } + Self { + base__: ICoreWebView2_8_Vtbl::new::(), + add_IsDefaultDownloadDialogOpenChanged: add_IsDefaultDownloadDialogOpenChanged::< + Identity, + OFFSET, + >, + remove_IsDefaultDownloadDialogOpenChanged: remove_IsDefaultDownloadDialogOpenChanged::< + Identity, + OFFSET, + >, + IsDefaultDownloadDialogOpen: IsDefaultDownloadDialogOpen::, + OpenDefaultDownloadDialog: OpenDefaultDownloadDialog::, + CloseDefaultDownloadDialog: CloseDefaultDownloadDialog::, + DefaultDownloadDialogCornerAlignment: DefaultDownloadDialogCornerAlignment::< + Identity, + OFFSET, + >, + SetDefaultDownloadDialogCornerAlignment: SetDefaultDownloadDialogCornerAlignment::< + Identity, + OFFSET, + >, + DefaultDownloadDialogMargin: DefaultDownloadDialogMargin::, + SetDefaultDownloadDialogMargin: SetDefaultDownloadDialogMargin::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + || iid == &::IID + } +} +impl windows_core::RuntimeName for ICoreWebView2_9 {} diff --git a/src-tauri/vendor/webview2-com-sys/src/declared_interfaces.rs b/src-tauri/vendor/webview2-com-sys/src/declared_interfaces.rs new file mode 100644 index 00000000..20b3ff31 --- /dev/null +++ b/src-tauri/vendor/webview2-com-sys/src/declared_interfaces.rs @@ -0,0 +1,116 @@ +use std::collections::BTreeSet; + +/// Generate a list of all `ICoreWebView2...Handler` interfaces declared in `WebView2.h`. This is +/// for testing purposes to make sure they are all covered in +/// [callback.rs](../../webview2-com/src/callback.rs). +pub fn all_declared_callbacks() -> BTreeSet<&'static str> { + let mut interfaces = BTreeSet::new(); + + interfaces.insert("ICoreWebView2AcceleratorKeyPressedEventHandler"); + interfaces.insert("ICoreWebView2AddScriptToExecuteOnDocumentCreatedCompletedHandler"); + interfaces.insert("ICoreWebView2BasicAuthenticationRequestedEventHandler"); + interfaces.insert("ICoreWebView2BrowserExtensionEnableCompletedHandler"); + interfaces.insert("ICoreWebView2BrowserExtensionRemoveCompletedHandler"); + interfaces.insert("ICoreWebView2BrowserProcessExitedEventHandler"); + interfaces.insert("ICoreWebView2BytesReceivedChangedEventHandler"); + interfaces.insert("ICoreWebView2CallDevToolsProtocolMethodCompletedHandler"); + interfaces.insert("ICoreWebView2CapturePreviewCompletedHandler"); + interfaces.insert("ICoreWebView2ClearBrowsingDataCompletedHandler"); + interfaces.insert("ICoreWebView2ClearServerCertificateErrorActionsCompletedHandler"); + interfaces.insert("ICoreWebView2ClientCertificateRequestedEventHandler"); + interfaces.insert("ICoreWebView2ContainsFullScreenElementChangedEventHandler"); + interfaces.insert("ICoreWebView2ContentLoadingEventHandler"); + interfaces.insert("ICoreWebView2ContextMenuRequestedEventHandler"); + interfaces.insert("ICoreWebView2CreateCoreWebView2CompositionControllerCompletedHandler"); + interfaces.insert("ICoreWebView2CreateCoreWebView2ControllerCompletedHandler"); + interfaces.insert("ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler"); + interfaces.insert("ICoreWebView2CursorChangedEventHandler"); + interfaces.insert("ICoreWebView2CustomItemSelectedEventHandler"); + interfaces.insert("ICoreWebView2DOMContentLoadedEventHandler"); + interfaces.insert("ICoreWebView2DevToolsProtocolEventReceivedEventHandler"); + interfaces.insert("ICoreWebView2DocumentTitleChangedEventHandler"); + interfaces.insert("ICoreWebView2DownloadStartingEventHandler"); + interfaces.insert("ICoreWebView2EstimatedEndTimeChangedEventHandler"); + interfaces.insert("ICoreWebView2ExecuteScriptCompletedHandler"); + interfaces.insert("ICoreWebView2ExecuteScriptWithResultCompletedHandler"); + interfaces.insert("ICoreWebView2FaviconChangedEventHandler"); + interfaces.insert("ICoreWebView2FindActiveMatchIndexChangedEventHandler"); + interfaces.insert("ICoreWebView2FindMatchCountChangedEventHandler"); + interfaces.insert("ICoreWebView2FindStartCompletedHandler"); + interfaces.insert("ICoreWebView2FocusChangedEventHandler"); + interfaces.insert("ICoreWebView2FrameChildFrameCreatedEventHandler"); + interfaces.insert("ICoreWebView2FrameContentLoadingEventHandler"); + interfaces.insert("ICoreWebView2FrameCreatedEventHandler"); + interfaces.insert("ICoreWebView2FrameDOMContentLoadedEventHandler"); + interfaces.insert("ICoreWebView2FrameDestroyedEventHandler"); + interfaces.insert("ICoreWebView2FrameNameChangedEventHandler"); + interfaces.insert("ICoreWebView2FrameNavigationCompletedEventHandler"); + interfaces.insert("ICoreWebView2FrameNavigationStartingEventHandler"); + interfaces.insert("ICoreWebView2FramePermissionRequestedEventHandler"); + interfaces.insert("ICoreWebView2FrameScreenCaptureStartingEventHandler"); + interfaces.insert("ICoreWebView2FrameWebMessageReceivedEventHandler"); + interfaces.insert("ICoreWebView2GetCookiesCompletedHandler"); + interfaces.insert("ICoreWebView2GetFaviconCompletedHandler"); + interfaces.insert("ICoreWebView2GetNonDefaultPermissionSettingsCompletedHandler"); + interfaces.insert("ICoreWebView2GetProcessExtendedInfosCompletedHandler"); + interfaces.insert("ICoreWebView2HistoryChangedEventHandler"); + interfaces.insert("ICoreWebView2IsDefaultDownloadDialogOpenChangedEventHandler"); + interfaces.insert("ICoreWebView2IsDocumentPlayingAudioChangedEventHandler"); + interfaces.insert("ICoreWebView2IsMutedChangedEventHandler"); + interfaces.insert("ICoreWebView2LaunchingExternalUriSchemeEventHandler"); + interfaces.insert("ICoreWebView2MoveFocusRequestedEventHandler"); + interfaces.insert("ICoreWebView2NavigationCompletedEventHandler"); + interfaces.insert("ICoreWebView2NavigationStartingEventHandler"); + interfaces.insert("ICoreWebView2NewBrowserVersionAvailableEventHandler"); + interfaces.insert("ICoreWebView2NewWindowRequestedEventHandler"); + interfaces.insert("ICoreWebView2NonClientRegionChangedEventHandler"); + interfaces.insert("ICoreWebView2NotificationCloseRequestedEventHandler"); + interfaces.insert("ICoreWebView2NotificationReceivedEventHandler"); + interfaces.insert("ICoreWebView2PermissionRequestedEventHandler"); + interfaces.insert("ICoreWebView2PrintCompletedHandler"); + interfaces.insert("ICoreWebView2PrintToPdfCompletedHandler"); + interfaces.insert("ICoreWebView2PrintToPdfStreamCompletedHandler"); + interfaces.insert("ICoreWebView2ProcessFailedEventHandler"); + interfaces.insert("ICoreWebView2ProcessInfosChangedEventHandler"); + interfaces.insert("ICoreWebView2ProfileAddBrowserExtensionCompletedHandler"); + interfaces.insert("ICoreWebView2ProfileDeletedEventHandler"); + interfaces.insert("ICoreWebView2ProfileGetBrowserExtensionsCompletedHandler"); + interfaces.insert("ICoreWebView2RasterizationScaleChangedEventHandler"); + interfaces.insert("ICoreWebView2SaveAsUIShowingEventHandler"); + interfaces.insert("ICoreWebView2SaveFileSecurityCheckStartingEventHandler"); + interfaces.insert("ICoreWebView2ScreenCaptureStartingEventHandler"); + interfaces.insert("ICoreWebView2ScriptDialogOpeningEventHandler"); + interfaces.insert("ICoreWebView2ServerCertificateErrorDetectedEventHandler"); + interfaces.insert("ICoreWebView2SetPermissionStateCompletedHandler"); + interfaces.insert("ICoreWebView2ShowSaveAsUICompletedHandler"); + interfaces.insert("ICoreWebView2SourceChangedEventHandler"); + interfaces.insert("ICoreWebView2StateChangedEventHandler"); + interfaces.insert("ICoreWebView2StatusBarTextChangedEventHandler"); + interfaces.insert("ICoreWebView2TrySuspendCompletedHandler"); + interfaces.insert("ICoreWebView2WebMessageReceivedEventHandler"); + interfaces.insert("ICoreWebView2WebResourceRequestedEventHandler"); + interfaces.insert("ICoreWebView2WebResourceResponseReceivedEventHandler"); + interfaces.insert("ICoreWebView2WebResourceResponseViewGetContentCompletedHandler"); + interfaces.insert("ICoreWebView2WindowCloseRequestedEventHandler"); + interfaces.insert("ICoreWebView2ZoomFactorChangedEventHandler"); + + interfaces +} + +/// Generate a list of all `ICoreWebView2EnvironmentOptions` interfaces declared in `WebView2.h`. +/// This is for testing purposes to make sure they are all covered in +/// [options.rs](../../webview2-com/src/options.rs). +pub fn all_declared_options() -> BTreeSet<&'static str> { + let mut interfaces = BTreeSet::new(); + + interfaces.insert("ICoreWebView2EnvironmentOptions"); + interfaces.insert("ICoreWebView2EnvironmentOptions2"); + interfaces.insert("ICoreWebView2EnvironmentOptions3"); + interfaces.insert("ICoreWebView2EnvironmentOptions4"); + interfaces.insert("ICoreWebView2EnvironmentOptions5"); + interfaces.insert("ICoreWebView2EnvironmentOptions6"); + interfaces.insert("ICoreWebView2EnvironmentOptions7"); + interfaces.insert("ICoreWebView2EnvironmentOptions8"); + + interfaces +} diff --git a/src-tauri/vendor/webview2-com-sys/src/lib.rs b/src-tauri/vendor/webview2-com-sys/src/lib.rs new file mode 100644 index 00000000..076baf9f --- /dev/null +++ b/src-tauri/vendor/webview2-com-sys/src/lib.rs @@ -0,0 +1,66 @@ +#[allow( + non_snake_case, + non_upper_case_globals, + non_camel_case_types, + dead_code, + clippy::all +)] +pub mod Microsoft { + pub mod Web { + pub mod WebView2 { + pub mod Win32 { + mod windows_link { + macro_rules! link_webview2 { + ($library:literal $abi:literal fn $($function:tt)*) => ( + #[cfg_attr( + target_env = "msvc", + link(name = "WebView2LoaderStatic", kind = "static") + )] + #[cfg_attr( + not(target_env = "msvc"), + link(name = "WebView2Loader.dll") + )] + extern $abi { + pub fn $($function)*; + } + ) + } + + pub(crate) use link_webview2 as link; + } + + include!("bindings.rs"); + } + } + } +} + +pub mod declared_interfaces; + +#[cfg(test)] +mod test { + use windows_core::w; + + use crate::Microsoft::Web::WebView2::Win32::*; + + #[test] + fn compare_eq() { + let mut result = 1; + unsafe { CompareBrowserVersions(w!("1.0.0"), w!("1.0.0"), &mut result) }.unwrap(); + assert_eq!(0, result); + } + + #[test] + fn compare_lt() { + let mut result = 0; + unsafe { CompareBrowserVersions(w!("1.0.0"), w!("1.0.1"), &mut result) }.unwrap(); + assert_eq!(-1, result); + } + + #[test] + fn compare_gt() { + let mut result = 0; + unsafe { CompareBrowserVersions(w!("2.0.0"), w!("1.0.1"), &mut result) }.unwrap(); + assert_eq!(1, result); + } +} diff --git a/src-tauri/vendor/webview2-com-sys/x64/WebView2Loader.dll b/src-tauri/vendor/webview2-com-sys/x64/WebView2Loader.dll new file mode 100644 index 00000000..429a122d Binary files /dev/null and b/src-tauri/vendor/webview2-com-sys/x64/WebView2Loader.dll differ diff --git a/src-tauri/vendor/webview2-com-sys/x64/WebView2Loader.dll.lib b/src-tauri/vendor/webview2-com-sys/x64/WebView2Loader.dll.lib new file mode 100644 index 00000000..226d62a7 Binary files /dev/null and b/src-tauri/vendor/webview2-com-sys/x64/WebView2Loader.dll.lib differ diff --git a/src-tauri/vendor/webview2-com-sys/x64/WebView2LoaderStatic.lib b/src-tauri/vendor/webview2-com-sys/x64/WebView2LoaderStatic.lib new file mode 100644 index 00000000..899c069c Binary files /dev/null and b/src-tauri/vendor/webview2-com-sys/x64/WebView2LoaderStatic.lib differ diff --git a/src-tauri/vendor/webview2-com-sys/x86/WebView2Loader.dll b/src-tauri/vendor/webview2-com-sys/x86/WebView2Loader.dll new file mode 100644 index 00000000..0f4ab78f Binary files /dev/null and b/src-tauri/vendor/webview2-com-sys/x86/WebView2Loader.dll differ diff --git a/src-tauri/vendor/webview2-com-sys/x86/WebView2Loader.dll.lib b/src-tauri/vendor/webview2-com-sys/x86/WebView2Loader.dll.lib new file mode 100644 index 00000000..b8410e87 Binary files /dev/null and b/src-tauri/vendor/webview2-com-sys/x86/WebView2Loader.dll.lib differ diff --git a/src-tauri/vendor/webview2-com-sys/x86/WebView2LoaderStatic.lib b/src-tauri/vendor/webview2-com-sys/x86/WebView2LoaderStatic.lib new file mode 100644 index 00000000..9607379e Binary files /dev/null and b/src-tauri/vendor/webview2-com-sys/x86/WebView2LoaderStatic.lib differ diff --git a/src-tauri/vendor/windows-core/.cargo-ok b/src-tauri/vendor/windows-core/.cargo-ok new file mode 100644 index 00000000..5f8b7958 --- /dev/null +++ b/src-tauri/vendor/windows-core/.cargo-ok @@ -0,0 +1 @@ +{"v":1} \ No newline at end of file diff --git a/src-tauri/vendor/windows-core/.cargo_vcs_info.json b/src-tauri/vendor/windows-core/.cargo_vcs_info.json new file mode 100644 index 00000000..98677873 --- /dev/null +++ b/src-tauri/vendor/windows-core/.cargo_vcs_info.json @@ -0,0 +1,6 @@ +{ + "git": { + "sha1": "32c3144490c016fe496a0aed769bce60987a2e9d" + }, + "path_in_vcs": "crates/libs/core" +} \ No newline at end of file diff --git a/src-tauri/vendor/windows-core/Cargo.lock b/src-tauri/vendor/windows-core/Cargo.lock new file mode 100644 index 00000000..2dc77495 --- /dev/null +++ b/src-tauri/vendor/windows-core/Cargo.lock @@ -0,0 +1,95 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "proc-macro2" +version = "1.0.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "syn" +version = "2.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d" + +[[package]] +name = "windows-core" +version = "0.62.2" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-implement" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link", +] diff --git a/src-tauri/vendor/windows-core/Cargo.toml b/src-tauri/vendor/windows-core/Cargo.toml new file mode 100644 index 00000000..216b0663 --- /dev/null +++ b/src-tauri/vendor/windows-core/Cargo.toml @@ -0,0 +1,70 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO +# +# When uploading crates to the registry Cargo will automatically +# "normalize" Cargo.toml files for maximal compatibility +# with all versions of Cargo and also rewrite `path` dependencies +# to registry (e.g., crates.io) dependencies. +# +# If you are reading this file be aware that the original Cargo.toml +# will likely look very different (and much more reasonable). +# See Cargo.toml.orig for the original contents. + +[package] +edition = "2021" +rust-version = "1.82" +name = "windows-core" +version = "0.62.2" +build = false +autolib = false +autobins = false +autoexamples = false +autotests = false +autobenches = false +description = "Core type support for COM and Windows" +readme = "readme.md" +categories = ["os::windows-apis"] +license = "MIT OR Apache-2.0" +repository = "https://github.com/microsoft/windows-rs" + +[package.metadata.docs.rs] +default-target = "x86_64-pc-windows-msvc" +targets = [] + +[features] +default = ["std"] +std = [ + "windows-result/std", + "windows-strings/std", +] + +[lib] +name = "windows_core" +path = "src/lib.rs" + +[dependencies.windows-implement] +version = "0.60.2" +default-features = false + +[dependencies.windows-interface] +version = "0.59.3" +default-features = false + +[dependencies.windows-link] +version = "0.2.1" +default-features = false + +[dependencies.windows-result] +version = "0.4.1" +default-features = false + +[dependencies.windows-strings] +version = "0.5.1" +default-features = false + +[lints.rust] +missing_unsafe_on_extern = "warn" + +[lints.rust.unexpected_cfgs] +level = "warn" +priority = 0 +check-cfg = ["cfg(windows_raw_dylib, windows_slim_errors)"] diff --git a/src-tauri/vendor/windows-core/Cargo.toml.orig b/src-tauri/vendor/windows-core/Cargo.toml.orig new file mode 100644 index 00000000..db6bf082 --- /dev/null +++ b/src-tauri/vendor/windows-core/Cargo.toml.orig @@ -0,0 +1,28 @@ +[package] +name = "windows-core" +version = "0.62.2" +edition = "2021" +rust-version = "1.82" +license = "MIT OR Apache-2.0" +description = "Core type support for COM and Windows" +repository = "https://github.com/microsoft/windows-rs" +categories = ["os::windows-apis"] +readme = "readme.md" + +[dependencies] +windows-implement = { workspace = true } +windows-interface = { workspace = true } +windows-link = { workspace = true } +windows-result = { workspace = true } +windows-strings = { workspace = true } + +[features] +default = ["std"] +std = ["windows-result/std", "windows-strings/std"] + +[lints] +workspace = true + +[package.metadata.docs.rs] +default-target = "x86_64-pc-windows-msvc" +targets = [] diff --git a/src-tauri/vendor/windows-core/license-apache-2.0 b/src-tauri/vendor/windows-core/license-apache-2.0 new file mode 100644 index 00000000..b5ed4ece --- /dev/null +++ b/src-tauri/vendor/windows-core/license-apache-2.0 @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright (c) Microsoft Corporation. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/src-tauri/vendor/windows-core/license-mit b/src-tauri/vendor/windows-core/license-mit new file mode 100644 index 00000000..9e841e7a --- /dev/null +++ b/src-tauri/vendor/windows-core/license-mit @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/src-tauri/vendor/windows-core/readme.md b/src-tauri/vendor/windows-core/readme.md new file mode 100644 index 00000000..8e0af031 --- /dev/null +++ b/src-tauri/vendor/windows-core/readme.md @@ -0,0 +1,7 @@ +## Core type support for COM and Windows + +The [windows-core](https://crates.io/crates/windows-core) crate provides core type support for the windows-* family of crates. + +* [Getting started](https://kennykerr.ca/rust-getting-started/) +* [Samples](https://github.com/microsoft/windows-rs/tree/master/crates/samples) +* [Releases](https://github.com/microsoft/windows-rs/releases) diff --git a/src-tauri/vendor/windows-core/src/agile_reference.rs b/src-tauri/vendor/windows-core/src/agile_reference.rs new file mode 100644 index 00000000..74609a7a --- /dev/null +++ b/src-tauri/vendor/windows-core/src/agile_reference.rs @@ -0,0 +1,39 @@ +use super::*; +use core::marker::PhantomData; + +/// A type representing an agile reference to a COM/WinRT object. +#[repr(transparent)] +#[derive(Clone, PartialEq, Eq)] +pub struct AgileReference(imp::IAgileReference, PhantomData); + +impl AgileReference { + /// Creates an agile reference to the object. + pub fn new(object: &T) -> Result { + // TODO: this assert is required until we can catch this at compile time using an "associated const equality" constraint. + // For example, > + // https://github.com/rust-lang/rust/issues/92827 + assert!(T::UNKNOWN); + unsafe { + imp::RoGetAgileReference( + imp::AGILEREFERENCE_DEFAULT, + &T::IID, + core::mem::transmute::<&T, &IUnknown>(object), + ) + .map(|reference| Self(reference, Default::default())) + } + } + + /// Retrieves a proxy to the target of the `AgileReference` object that may safely be used within any thread context in which get is called. + pub fn resolve(&self) -> Result { + unsafe { self.0.Resolve() } + } +} + +unsafe impl Send for AgileReference {} +unsafe impl Sync for AgileReference {} + +impl core::fmt::Debug for AgileReference { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + write!(f, "AgileReference({:?})", &self.0) + } +} diff --git a/src-tauri/vendor/windows-core/src/array.rs b/src-tauri/vendor/windows-core/src/array.rs new file mode 100644 index 00000000..419fd2d4 --- /dev/null +++ b/src-tauri/vendor/windows-core/src/array.rs @@ -0,0 +1,165 @@ +use super::*; + +/// A WinRT array stores elements contiguously in a heap-allocated buffer. +pub struct Array> { + pub(crate) data: *mut T::Default, + pub(crate) len: u32, +} + +impl> Default for Array { + fn default() -> Self { + Self { + data: core::ptr::null_mut(), + len: 0, + } + } +} + +impl> Array { + /// Creates an empty array. + pub fn new() -> Self { + Self::default() + } + + /// Creates an array of the given length with default values. + pub fn with_len(len: usize) -> Self { + assert!(len < u32::MAX as usize); + let bytes_amount = len + .checked_mul(core::mem::size_of::()) + .expect("Attempted to allocate too large an Array"); + + // WinRT arrays must be allocated with CoTaskMemAlloc. + // SAFETY: the call to CoTaskMemAlloc is safe to perform + // if len is zero and overflow was checked above. + // We ensured we alloc enough space by multiplying len * size_of:: + let data = unsafe { imp::CoTaskMemAlloc(bytes_amount) as *mut T::Default }; + + assert!(!data.is_null(), "Could not successfully allocate for Array"); + + // SAFETY: It is by definition safe to zero-initialize WinRT types. + // `write_bytes` will write 0 to (len * size_of::()) + // bytes making the entire array zero initialized. We have assured + // above that the data ptr is not null. + unsafe { + core::ptr::write_bytes(data, 0, len); + } + + let len = len as u32; + Self { data, len } + } + + /// Creates an array by copying the elements from the slice. + pub fn from_slice(values: &[T::Default]) -> Self + where + T::Default: Clone, + { + let mut array = Self::with_len(values.len()); + array.clone_from_slice(values); + array + } + + /// Creates an array from a pointer and length. The `len` argument is the number of elements, not the number of bytes. + /// # Safety + /// The `data` argument must have been allocated with `CoTaskMemAlloc`. + pub unsafe fn from_raw_parts(data: *mut T::Default, len: u32) -> Self { + Self { data, len } + } + + /// Returns a slice containing the entire array. + pub fn as_slice(&self) -> &[T::Default] { + self + } + + /// Returns `true` if the array is empty. + pub fn is_empty(&self) -> bool { + self.len == 0 + } + + /// Returns the length of the array. + pub fn len(&self) -> usize { + self.len as usize + } + + /// Clears the contents of the array. + pub fn clear(&mut self) { + if self.is_empty() { + return; + } + + let mut data = core::ptr::null_mut(); + let mut len = 0; + + core::mem::swap(&mut data, &mut self.data); + core::mem::swap(&mut len, &mut self.len); + + // SAFETY: At this point, self has been reset to zero so any panics in T's destructor would + // only leak data not leave the array in bad state. + unsafe { + // Call the destructors of all the elements of the old array + // SAFETY: the slice cannot be used after the call to `drop_in_place` + core::ptr::drop_in_place(core::ptr::slice_from_raw_parts_mut(data, len as usize)); + // Free the data memory where the elements were + // SAFETY: we have unique access to the data pointer at this point + // so freeing it is the right thing to do + imp::CoTaskMemFree(data as _); + } + } + + #[doc(hidden)] + /// Get a mutable pointer to the array's length + /// + /// # Safety + /// + /// This function is safe but writing to the pointer is not. Calling this without + /// a subsequent call to `set_abi` is likely to either leak memory or cause UB + pub unsafe fn set_abi_len(&mut self) -> *mut u32 { + &mut self.len + } + + #[doc(hidden)] + /// Turn the array into a pointer to its data and its length + pub fn into_abi(self) -> (*mut T::Abi, u32) { + let abi = (self.data as *mut _, self.len); + core::mem::forget(self); + abi + } +} + +impl> core::ops::Deref for Array { + type Target = [T::Default]; + + fn deref(&self) -> &[T::Default] { + if self.is_empty() { + return &[]; + } + + // SAFETY: data must not be null if the array is not empty + unsafe { core::slice::from_raw_parts(self.data, self.len as usize) } + } +} + +impl> core::ops::DerefMut for Array { + fn deref_mut(&mut self) -> &mut [T::Default] { + if self.is_empty() { + return &mut []; + } + + // SAFETY: data must not be null if the array is not empty + unsafe { core::slice::from_raw_parts_mut(self.data, self.len as usize) } + } +} + +impl> Drop for Array { + fn drop(&mut self) { + self.clear(); + } +} + +impl> core::fmt::Debug for Array +where + T::Default: core::fmt::Debug, +{ + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + core::ops::Deref::deref(self).fmt(f) + } +} diff --git a/src-tauri/vendor/windows-core/src/as_impl.rs b/src-tauri/vendor/windows-core/src/as_impl.rs new file mode 100644 index 00000000..75a8b60b --- /dev/null +++ b/src-tauri/vendor/windows-core/src/as_impl.rs @@ -0,0 +1,20 @@ +/// A trait for retrieving the implementation behind a COM or WinRT interface. +/// +/// This trait is automatically implemented when using the `implement` macro. +pub trait AsImpl { + /// # Safety + /// + /// The caller needs to ensure that `self` is actually implemented by the + /// implementation `T`. + unsafe fn as_impl(&self) -> &T { + unsafe { self.as_impl_ptr().as_ref() } + } + + /// Returns a pointer to the implementation object. + /// + /// # Safety + /// + /// The caller needs to ensure that `self` is actually implemented by the + /// implementation `T`. + unsafe fn as_impl_ptr(&self) -> core::ptr::NonNull; +} diff --git a/src-tauri/vendor/windows-core/src/com_object.rs b/src-tauri/vendor/windows-core/src/com_object.rs new file mode 100644 index 00000000..8fd38c9d --- /dev/null +++ b/src-tauri/vendor/windows-core/src/com_object.rs @@ -0,0 +1,394 @@ +use crate::imp::Box; +use crate::{IUnknown, IUnknownImpl, Interface, InterfaceRef}; +use core::any::Any; +use core::borrow::Borrow; +use core::ops::Deref; +use core::ptr::NonNull; + +/// Identifies types that can be placed in [`ComObject`]. +/// +/// This trait links types that can be placed in `ComObject` with the types generated by the +/// `#[implement]` macro. The `#[implement]` macro generates implementations of this trait. +/// The generated types contain the vtable layouts and refcount-related fields for the COM +/// object implementation. +/// +/// This trait is an implementation detail of the Windows crates. +/// User code should not deal directly with this trait. +/// +/// This trait is sort of the reverse of [`IUnknownImpl`]. This trait allows user code to use +/// [`ComObject`] instead of `ComObject`. +pub trait ComObjectInner: Sized { + /// The generated `_Impl` type (aka the "boxed" type or "outer" type). + type Outer: IUnknownImpl; + + /// Moves an instance of this type into a new ComObject box and returns it. + /// + /// # Safety + /// + /// It is important that safe Rust code never be able to acquire an owned instance of a + /// generated "outer" COM object type, e.g. `_Impl`. This would be unsafe because the + /// `_Impl` object contains a reference count field and provides methods that adjust + /// the reference count, and destroy the object when the reference count reaches zero. + /// + /// Safe Rust code must only be able to interact with these values by accessing them via a + /// `ComObject` reference. `ComObject` handles adjusting reference counts and associates the + /// lifetime of a `&_Impl` with the lifetime of the related `ComObject`. + /// + /// The `#[implement]` macro generates the implementation of this `into_object` method. + /// The generated `into_object` method encapsulates the construction of the `_Impl` + /// object and immediately places it into the heap and returns a `ComObject` reference to it. + /// This ensures that our requirement -- that safe Rust code never own a `_Impl` value + /// directly -- is met. + fn into_object(self) -> ComObject; +} + +/// Describes the COM interfaces implemented by a specific COM object. +/// +/// The `#[implement]` macro generates implementations of this trait. Implementations are attached +/// to the "outer" types generated by `#[implement]`, e.g. the `MyApp_Impl` type. Each +/// implementation knows how to locate the interface-specific field within `MyApp_Impl`. +/// +/// This trait is an implementation detail of the Windows crates. +/// User code should not deal directly with this trait. +pub trait ComObjectInterface { + /// Gets a borrowed interface that is implemented by `T`. + fn as_interface_ref(&self) -> InterfaceRef<'_, I>; +} + +/// A counted pointer to a type that implements COM interfaces, where the object has been +/// placed in the heap (boxed). +/// +/// This type exists so that you can place an object into the heap and query for COM interfaces, +/// without losing the safe reference to the implementation object. +/// +/// Because the pointer inside this type is known to be non-null, `Option>` should +/// always have the same size as a single pointer. +/// +/// # Safety +/// +/// The contained `ptr` field is an owned, reference-counted pointer to a _pinned_ `Pin>`. +/// Although this code does not currently use `Pin`, it takes care not to expose any unsafe semantics +/// to safe code. However, code that calls unsafe functions on [`ComObject`] must, like all unsafe code, +/// understand and preserve invariants. +#[repr(transparent)] +pub struct ComObject { + ptr: NonNull, +} + +impl ComObject { + /// Allocates a heap cell (box) and moves `value` into it. Returns a counted pointer to `value`. + pub fn new(value: T) -> Self { + T::into_object(value) + } + + /// Creates a new `ComObject` that points to an existing boxed instance. + /// + /// # Safety + /// + /// The caller must ensure that `ptr` points to a valid, heap-allocated instance of `T::Outer`. + /// Normally, this pointer comes from using `Box::into_raw(Box::new(...))`. + /// + /// The pointed-to box must have a reference count that is greater than zero. + /// + /// This function takes ownership of the existing pointer; it does not call `AddRef`. + /// The reference count must accurately reflect all outstanding references to the box, + /// including `ptr` in the count. + pub unsafe fn from_raw(ptr: NonNull) -> Self { + Self { ptr } + } + + /// Gets a reference to the shared object stored in the box. + /// + /// [`ComObject`] also implements [`Deref`], so you can often deref directly into the object. + /// For those situations where using the [`Deref`] impl is inconvenient, you can use + /// this method to explicitly get a reference to the contents. + #[inline(always)] + pub fn get(&self) -> &T { + self.get_box().get_impl() + } + + /// Gets a reference to the shared object's heap box. + #[inline(always)] + fn get_box(&self) -> &T::Outer { + unsafe { self.ptr.as_ref() } + } + + // Note that we _do not_ provide a way to get a mutable reference to the outer box. + // It's ok to return `&mut T`, but not `&mut T::Outer`. That would allow someone to replace the + // contents of the entire object (box and reference count), which could lead to UB. + // This could maybe be solved by returning `Pin<&mut T::Outer>`, but that requires some + // additional thinking. + + /// Gets a mutable reference to the object stored in the box, if the reference count + /// is exactly 1. If there are multiple references to this object then this returns `None`. + #[inline(always)] + pub fn get_mut(&mut self) -> Option<&mut T> { + if self.is_reference_count_one() { + // SAFETY: We must only return &mut T, *NOT* &mut T::Outer. + // Returning T::Outer would allow swapping the contents of the object, which would + // allow (incorrectly) modifying the reference count. + unsafe { Some(self.ptr.as_mut().get_impl_mut()) } + } else { + None + } + } + + /// If this object has only a single object reference (i.e. this [`ComObject`] is the only + /// reference to the heap allocation), then this method will extract the inner `T` + /// (and return it in an `Ok`) and then free the heap allocation. + /// + /// If there is more than one reference to this object, then this returns `Err(self)`. + #[inline(always)] + pub fn take(self) -> Result { + if self.is_reference_count_one() { + let outer_box: Box = unsafe { core::mem::transmute(self) }; + Ok(outer_box.into_inner()) + } else { + Err(self) + } + } + + /// Casts to a given interface type. + /// + /// This always performs a `QueryInterface`, even if `T` is known to implement `I`. + /// If you know that `T` implements `I`, then use [`Self::as_interface`] or [`Self::to_interface`] because + /// those functions do not require a dynamic `QueryInterface` call. + #[inline(always)] + pub fn cast(&self) -> windows_core::Result + where + T::Outer: ComObjectInterface, + { + let unknown = self.as_interface::(); + unknown.cast() + } + + /// Gets a borrowed reference to an interface that is implemented by `T`. + /// + /// The returned reference does not have an additional reference count. + /// You can AddRef it by calling [`InterfaceRef::to_owned`]. + #[inline(always)] + pub fn as_interface(&self) -> InterfaceRef<'_, I> + where + T::Outer: ComObjectInterface, + { + self.get_box().as_interface_ref() + } + + /// Gets an owned (counted) reference to an interface that is implemented by this [`ComObject`]. + #[inline(always)] + pub fn to_interface(&self) -> I + where + T::Outer: ComObjectInterface, + { + self.as_interface::().to_owned() + } + + /// Converts `self` into an interface that it implements. + /// + /// This does not need to adjust reference counts because `self` is consumed. + #[inline(always)] + pub fn into_interface(self) -> I + where + T::Outer: ComObjectInterface, + { + unsafe { + let raw = self.get_box().as_interface_ref().as_raw(); + core::mem::forget(self); + I::from_raw(raw) + } + } + + /// This casts the given COM interface to [`&dyn Any`]. It returns a reference to the "outer" + /// object, e.g. `MyApp_Impl`, not the inner `MyApp` object. + /// + /// `T` must be a type that has been annotated with `#[implement]`; this is checked at + /// compile-time by the generic constraints of this method. However, note that the + /// returned `&dyn Any` refers to the _outer_ implementation object that was generated by + /// `#[implement]`, i.e. the `MyApp_Impl` type, not the inner `MyApp` type. + /// + /// If the given object is not a Rust object, or is a Rust object but not `T`, or is a Rust + /// object that contains non-static lifetimes, then this function will return `Err(E_NOINTERFACE)`. + /// + /// The returned value is an owned (counted) reference; this function calls `AddRef` on the + /// underlying COM object. If you do not need an owned reference, then you can use the + /// [`Interface::cast_object_ref`] method instead, and avoid the cost of `AddRef` / `Release`. + pub fn cast_from(interface: &I) -> crate::Result + where + I: Interface, + T::Outer: Any + 'static + IUnknownImpl, + { + interface.cast_object() + } +} + +impl Default for ComObject { + fn default() -> Self { + Self::new(T::default()) + } +} + +impl Drop for ComObject { + fn drop(&mut self) { + unsafe { + T::Outer::Release(self.ptr.as_ptr()); + } + } +} + +impl Clone for ComObject { + #[inline(always)] + fn clone(&self) -> Self { + unsafe { + self.ptr.as_ref().AddRef(); + Self { ptr: self.ptr } + } + } +} + +impl AsRef for ComObject { + #[inline(always)] + fn as_ref(&self) -> &T { + self.get() + } +} + +impl Deref for ComObject { + type Target = T::Outer; + + #[inline(always)] + fn deref(&self) -> &Self::Target { + self.get_box() + } +} + +// There is no DerefMut implementation because we cannot statically guarantee +// that the reference count is 1, which is a requirement for getting exclusive +// access to the contents of the object. Use get_mut() for dynamically-checked +// exclusive access. + +impl From for ComObject { + fn from(value: T) -> Self { + Self::new(value) + } +} + +// Delegate hashing, if implemented. +impl core::hash::Hash for ComObject { + fn hash(&self, state: &mut H) { + self.get().hash(state); + } +} + +// If T is Send (or Sync) then the ComObject is also Send (or Sync). +// Since the actual object storage is in the heap, the object is never moved. +unsafe impl Send for ComObject {} +unsafe impl Sync for ComObject {} + +impl PartialEq for ComObject { + fn eq(&self, other: &Self) -> bool { + let inner_self: &T = self.get(); + let other_self: &T = other.get(); + inner_self == other_self + } +} + +impl Eq for ComObject {} + +impl PartialOrd for ComObject { + fn partial_cmp(&self, other: &Self) -> Option { + let inner_self: &T = self.get(); + let other_self: &T = other.get(); + ::partial_cmp(inner_self, other_self) + } +} + +impl Ord for ComObject { + fn cmp(&self, other: &Self) -> core::cmp::Ordering { + let inner_self: &T = self.get(); + let other_self: &T = other.get(); + ::cmp(inner_self, other_self) + } +} + +impl core::fmt::Debug for ComObject { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + ::fmt(self.get(), f) + } +} + +impl core::fmt::Display for ComObject { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + ::fmt(self.get(), f) + } +} + +impl Borrow for ComObject { + fn borrow(&self) -> &T { + self.get() + } +} + +/// Enables applications to define COM objects using static storage. This is useful for factory +/// objects, stateless objects, or objects which use need to contain or use mutable global state. +/// +/// COM objects that are defined using `StaticComObject` have their storage placed directly in +/// static storage; they are not stored in the heap. +/// +/// COM objects defined using `StaticComObject` do have a reference count and this reference +/// count is adjusted when owned COM interface references (e.g. `IFoo` and `IUnknown`) are created +/// for the object. The reference count is initialized to 1. +/// +/// # Example +/// +/// ```rust,ignore +/// #[implement(IFoo)] +/// struct MyApp { +/// // ... +/// } +/// +/// static MY_STATIC_APP: StaticComObject = MyApp { ... }.into_static(); +/// +/// fn get_my_static_ifoo() -> IFoo { +/// MY_STATIC_APP.to_interface() +/// } +/// ``` +pub struct StaticComObject +where + T: ComObjectInner, +{ + outer: T::Outer, +} + +// IMPORTANT: Do not expose any methods that return mutable access to the contents of StaticComObject. +// Doing so would violate our safety invariants. For example, we provide a Deref impl but it would +// be unsound to provide a DerefMut impl. +impl StaticComObject +where + T: ComObjectInner, +{ + /// Wraps `outer` in a `StaticComObject`. + pub const fn from_outer(outer: T::Outer) -> Self { + Self { outer } + } +} + +impl StaticComObject +where + T: ComObjectInner, +{ + /// Gets access to the contained value. + pub const fn get(&'static self) -> &'static T::Outer { + &self.outer + } +} + +impl core::ops::Deref for StaticComObject +where + T: ComObjectInner, +{ + type Target = T::Outer; + + fn deref(&self) -> &Self::Target { + &self.outer + } +} diff --git a/src-tauri/vendor/windows-core/src/event.rs b/src-tauri/vendor/windows-core/src/event.rs new file mode 100644 index 00000000..3951ef2c --- /dev/null +++ b/src-tauri/vendor/windows-core/src/event.rs @@ -0,0 +1,144 @@ +use super::*; +use core::{iter::once, mem::transmute_copy}; +use std::sync::{Arc, RwLock}; + +/// A type that you can use to declare and implement an event of a specified delegate type. +/// +/// The implementation is thread-safe and designed to avoid contention between events being +/// raised and delegates being added or removed. +pub struct Event { + delegates: RwLock]>>>, +} + +unsafe impl Send for Event {} +unsafe impl Sync for Event {} + +impl Default for Event { + fn default() -> Self { + Self::new() + } +} + +impl Event { + /// Creates a new, empty `Event`. + pub const fn new() -> Self { + Self { + delegates: RwLock::new(None), + } + } + + /// Registers a delegate with the event object. + pub fn add(&self, delegate: &T) -> Result { + let new_delegate = Delegate::new(delegate)?; + let token = new_delegate.to_token(); + let new_iter = once(new_delegate); + let mut guard = self.delegates.write().unwrap(); + + let new_list = if let Some(old_delegates) = guard.as_ref() { + Arc::from_iter(old_delegates.iter().cloned().chain(new_iter)) + } else { + Arc::from_iter(new_iter) + }; + + let old_list = guard.replace(new_list); + drop(guard); + drop(old_list); // drop the old delegates _after_ releasing lock + + Ok(token) + } + + /// Revokes a delegate's registration from the event object. + pub fn remove(&self, token: i64) { + let mut guard = self.delegates.write().unwrap(); + let mut old_list = None; + if let Some(old_delegates) = guard.as_ref() { + // `self.delegates` is only modified if the token is found. + if let Some(i) = old_delegates + .iter() + .position(|old_delegate| old_delegate.to_token() == token) + { + let new_list = Arc::from_iter( + old_delegates[..i] + .iter() + .chain(old_delegates[i + 1..].iter()) + .cloned(), + ); + + old_list = guard.replace(new_list); + } + } + drop(guard); + drop(old_list); // drop the old delegates _after_ releasing lock + } + + /// Clears the event, removing all delegates. + pub fn clear(&self) { + let mut guard = self.delegates.write().unwrap(); + let old_list = guard.take(); + drop(guard); + drop(old_list); // drop the old delegates _after_ releasing lock + } + + /// Invokes all of the event object's registered delegates with the provided callback. + pub fn call Result<()>>(&self, mut callback: F) { + let delegates = { + let guard = self.delegates.read().unwrap(); + if let Some(delegates) = guard.as_ref() { + delegates.clone() + } else { + // No delegates to call. + return; + } + // <-- lock is released here + }; + + for delegate in delegates.iter() { + if let Err(error) = delegate.call(&mut callback) { + const RPC_E_SERVER_UNAVAILABLE: HRESULT = HRESULT(-2147023174); // HRESULT_FROM_WIN32(RPC_S_SERVER_UNAVAILABLE) + if matches!( + error.code(), + imp::RPC_E_DISCONNECTED | imp::JSCRIPT_E_CANTEXECUTE | RPC_E_SERVER_UNAVAILABLE + ) { + self.remove(delegate.to_token()); + } + } + } + } +} + +/// Holds either a direct or indirect reference to a delegate. A direct reference is typically +/// agile while an indirect reference is an agile wrapper. +#[derive(Clone)] +enum Delegate { + Direct(T), + Indirect(AgileReference), +} + +impl Delegate { + /// Creates a new `Delegate`, containing a suitable reference to the specified delegate. + fn new(delegate: &T) -> Result { + if delegate.cast::().is_ok() { + Ok(Self::Direct(delegate.clone())) + } else { + Ok(Self::Indirect(AgileReference::new(delegate)?)) + } + } + + /// Returns an encoded token to identify the delegate. + fn to_token(&self) -> i64 { + unsafe { + match self { + Self::Direct(delegate) => imp::EncodePointer(transmute_copy(delegate)) as i64, + Self::Indirect(delegate) => imp::EncodePointer(transmute_copy(delegate)) as i64, + } + } + } + + /// Invokes the delegates with the provided callback. + fn call Result<()>>(&self, mut callback: F) -> Result<()> { + match self { + Self::Direct(delegate) => callback(delegate), + Self::Indirect(delegate) => callback(&delegate.resolve()?), + } + } +} diff --git a/src-tauri/vendor/windows-core/src/guid.rs b/src-tauri/vendor/windows-core/src/guid.rs new file mode 100644 index 00000000..fc1ee325 --- /dev/null +++ b/src-tauri/vendor/windows-core/src/guid.rs @@ -0,0 +1,206 @@ +use super::*; + +/// A globally unique identifier ([GUID](https://docs.microsoft.com/en-us/windows/win32/api/guiddef/ns-guiddef-guid)) +/// used to identify COM and WinRT interfaces. +#[repr(C)] +#[derive(Clone, Copy, Default, PartialEq, Eq, Hash)] +pub struct GUID { + /// Specifies the first 8 hexadecimal digits. + pub data1: u32, + + /// Specifies the first group of 4 hexadecimal digits. + pub data2: u16, + + /// Specifies the second group of 4 hexadecimal digits. + pub data3: u16, + + /// The first 2 bytes contain the third group of 4 hexadecimal digits. The remaining 6 bytes contain the final 12 hexadecimal digits. + pub data4: [u8; 8], +} + +impl GUID { + /// Creates a unique `GUID` value. + pub fn new() -> Result { + let mut guid = Self::zeroed(); + let result = unsafe { imp::UuidCreate(&mut guid as *mut _ as _) }; + + if matches!(result, 0 | imp::RPC_S_UUID_LOCAL_ONLY) { + Ok(guid) + } else { + Err(Error::from_hresult(HRESULT::from_win32(result as u32))) + } + } + + /// Creates a `GUID` represented by the all-zero byte-pattern. + pub const fn zeroed() -> Self { + Self { + data1: 0, + data2: 0, + data3: 0, + data4: [0, 0, 0, 0, 0, 0, 0, 0], + } + } + + /// Creates a `GUID` with the given constant values. + pub const fn from_values(data1: u32, data2: u16, data3: u16, data4: [u8; 8]) -> Self { + Self { + data1, + data2, + data3, + data4, + } + } + + /// Creates a `GUID` from a `u128` value. + pub const fn from_u128(uuid: u128) -> Self { + Self { + data1: (uuid >> 96) as u32, + data2: ((uuid >> 80) & 0xffff) as u16, + data3: ((uuid >> 64) & 0xffff) as u16, + data4: (uuid as u64).to_be_bytes(), + } + } + + /// Converts a `GUID` to a `u128` value. + pub const fn to_u128(&self) -> u128 { + ((self.data1 as u128) << 96) + + ((self.data2 as u128) << 80) + + ((self.data3 as u128) << 64) + + u64::from_be_bytes(self.data4) as u128 + } + + /// Creates a `GUID` for a "generic" WinRT type. + pub const fn from_signature(signature: imp::ConstBuffer) -> Self { + let data = imp::ConstBuffer::from_slice(&[ + 0x11, 0xf4, 0x7a, 0xd5, 0x7b, 0x73, 0x42, 0xc0, 0xab, 0xae, 0x87, 0x8b, 0x1e, 0x16, + 0xad, 0xee, + ]); + + let data = data.push_other(signature); + + let bytes = imp::sha1(&data).bytes(); + let first = u32::from_be_bytes([bytes[0], bytes[1], bytes[2], bytes[3]]); + + let second = u16::from_be_bytes([bytes[4], bytes[5]]); + let mut third = u16::from_be_bytes([bytes[6], bytes[7]]); + third = (third & 0x0fff) | (5 << 12); + let fourth = (bytes[8] & 0x3f) | 0x80; + + Self::from_values( + first, + second, + third, + [ + fourth, bytes[9], bytes[10], bytes[11], bytes[12], bytes[13], bytes[14], bytes[15], + ], + ) + } +} + +impl RuntimeType for GUID { + const SIGNATURE: imp::ConstBuffer = imp::ConstBuffer::from_slice(b"g16"); +} + +impl TypeKind for GUID { + type TypeKind = CopyType; +} + +impl core::fmt::Debug for GUID { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + write!( + f, + "{:08X?}-{:04X?}-{:04X?}-{:02X?}{:02X?}-{:02X?}{:02X?}{:02X?}{:02X?}{:02X?}{:02X?}", + self.data1, + self.data2, + self.data3, + self.data4[0], + self.data4[1], + self.data4[2], + self.data4[3], + self.data4[4], + self.data4[5], + self.data4[6], + self.data4[7] + ) + } +} + +impl TryFrom<&str> for GUID { + type Error = Error; + + fn try_from(from: &str) -> Result { + if from.len() != 36 { + return Err(invalid_guid()); + } + + let bytes = &mut from.bytes(); + let mut guid = Self::zeroed(); + + guid.data1 = try_u32(bytes, true)?; + guid.data2 = try_u16(bytes, true)?; + guid.data3 = try_u16(bytes, true)?; + guid.data4[0] = try_u8(bytes, false)?; + guid.data4[1] = try_u8(bytes, true)?; + guid.data4[2] = try_u8(bytes, false)?; + guid.data4[3] = try_u8(bytes, false)?; + guid.data4[4] = try_u8(bytes, false)?; + guid.data4[5] = try_u8(bytes, false)?; + guid.data4[6] = try_u8(bytes, false)?; + guid.data4[7] = try_u8(bytes, false)?; + + Ok(guid) + } +} + +impl From for GUID { + fn from(value: u128) -> Self { + Self::from_u128(value) + } +} + +impl From for u128 { + fn from(value: GUID) -> Self { + value.to_u128() + } +} + +fn invalid_guid() -> Error { + Error::from_hresult(imp::E_INVALIDARG) +} + +fn try_u32(bytes: &mut core::str::Bytes, delimiter: bool) -> Result { + next(bytes, 8, delimiter).ok_or_else(invalid_guid) +} + +fn try_u16(bytes: &mut core::str::Bytes, delimiter: bool) -> Result { + next(bytes, 4, delimiter) + .map(|value| value as u16) + .ok_or_else(invalid_guid) +} + +fn try_u8(bytes: &mut core::str::Bytes, delimiter: bool) -> Result { + next(bytes, 2, delimiter) + .map(|value| value as u8) + .ok_or_else(invalid_guid) +} + +fn next(bytes: &mut core::str::Bytes, len: usize, delimiter: bool) -> Option { + let mut value: u32 = 0; + + for _ in 0..len { + let digit = bytes.next()?; + + match digit { + b'0'..=b'9' => value = (value << 4) + (digit - b'0') as u32, + b'A'..=b'F' => value = (value << 4) + (digit - b'A' + 10) as u32, + b'a'..=b'f' => value = (value << 4) + (digit - b'a' + 10) as u32, + _ => return None, + } + } + + if delimiter && bytes.next() != Some(b'-') { + None + } else { + Some(value) + } +} diff --git a/src-tauri/vendor/windows-core/src/handles.rs b/src-tauri/vendor/windows-core/src/handles.rs new file mode 100644 index 00000000..de395e36 --- /dev/null +++ b/src-tauri/vendor/windows-core/src/handles.rs @@ -0,0 +1,46 @@ +/// Custom code to free a handle. +/// +/// This is similar to the [`Drop`] trait, and may be used to implement [`Drop`], but allows handles +/// to be dropped depending on context. +pub trait Free { + /// Calls the handle's free function. + /// + /// # Safety + /// The handle must be owned by the caller and safe to free. + unsafe fn free(&mut self); +} + +/// A wrapper to provide ownership for handles to automatically drop via the handle's [`Free`] trait. +#[repr(transparent)] +#[derive(PartialEq, Eq, Default, Debug)] +pub struct Owned(T); + +impl Owned { + /// Takes ownership of the handle. + /// + /// # Safety + /// + /// The handle must be owned by the caller and safe to free. + pub unsafe fn new(x: T) -> Self { + Self(x) + } +} + +impl Drop for Owned { + fn drop(&mut self) { + unsafe { self.0.free() }; + } +} + +impl core::ops::Deref for Owned { + type Target = T; + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +impl core::ops::DerefMut for Owned { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} diff --git a/src-tauri/vendor/windows-core/src/imp/array_proxy.rs b/src-tauri/vendor/windows-core/src/imp/array_proxy.rs new file mode 100644 index 00000000..9b45ea8b --- /dev/null +++ b/src-tauri/vendor/windows-core/src/imp/array_proxy.rs @@ -0,0 +1,38 @@ +use crate::{Array, Type}; + +pub struct ArrayProxy> { + data: *mut *mut T::Default, + len: *mut u32, + temp: core::mem::ManuallyDrop>, +} + +pub unsafe fn array_proxy>(data: *mut *mut T::Default, len: *mut u32) -> ArrayProxy { + ArrayProxy { + data, + len, + temp: core::mem::ManuallyDrop::new(Array::new()), + } +} + +impl> Drop for ArrayProxy { + fn drop(&mut self) { + unsafe { + *self.data = self.temp.data; + *self.len = self.temp.len; + } + } +} + +impl> core::ops::Deref for ArrayProxy { + type Target = Array; + + fn deref(&self) -> &Array { + &self.temp + } +} + +impl> core::ops::DerefMut for ArrayProxy { + fn deref_mut(&mut self) -> &mut Array { + &mut self.temp + } +} diff --git a/src-tauri/vendor/windows-core/src/imp/bindings.rs b/src-tauri/vendor/windows-core/src/imp/bindings.rs new file mode 100644 index 00000000..db2bde2b --- /dev/null +++ b/src-tauri/vendor/windows-core/src/imp/bindings.rs @@ -0,0 +1,40 @@ +windows_link::link!("combase.dll" "system" fn CoIncrementMTAUsage(pcookie : *mut CO_MTA_USAGE_COOKIE) -> HRESULT); +windows_link::link!("ole32.dll" "system" fn CoTaskMemAlloc(cb : usize) -> *mut core::ffi::c_void); +windows_link::link!("ole32.dll" "system" fn CoTaskMemFree(pv : *const core::ffi::c_void)); +windows_link::link!("kernel32.dll" "system" fn EncodePointer(ptr : *const core::ffi::c_void) -> *mut core::ffi::c_void); +windows_link::link!("kernel32.dll" "system" fn FreeLibrary(hlibmodule : HMODULE) -> BOOL); +windows_link::link!("kernel32.dll" "system" fn GetProcAddress(hmodule : HMODULE, lpprocname : PCSTR) -> FARPROC); +windows_link::link!("kernel32.dll" "system" fn LoadLibraryExA(lplibfilename : PCSTR, hfile : HANDLE, dwflags : LOAD_LIBRARY_FLAGS) -> HMODULE); +windows_link::link!("api-ms-win-core-winrt-l1-1-0.dll" "system" fn RoGetActivationFactory(activatableclassid : HSTRING, iid : *const GUID, factory : *mut *mut core::ffi::c_void) -> HRESULT); +windows_link::link!("rpcrt4.dll" "system" fn UuidCreate(uuid : *mut GUID) -> RPC_STATUS); +pub type BOOL = i32; +pub type CO_MTA_USAGE_COOKIE = *mut core::ffi::c_void; +pub type FARPROC = Option isize>; +#[repr(C)] +#[derive(Clone, Copy)] +pub struct GUID { + pub data1: u32, + pub data2: u16, + pub data3: u16, + pub data4: [u8; 8], +} +impl GUID { + pub const fn from_u128(uuid: u128) -> Self { + Self { + data1: (uuid >> 96) as u32, + data2: (uuid >> 80 & 0xffff) as u16, + data3: (uuid >> 64 & 0xffff) as u16, + data4: (uuid as u64).to_be_bytes(), + } + } +} +pub type HANDLE = *mut core::ffi::c_void; +pub type HINSTANCE = *mut core::ffi::c_void; +pub type HMODULE = *mut core::ffi::c_void; +pub type HRESULT = i32; +pub type LOAD_LIBRARY_FLAGS = u32; +pub const LOAD_LIBRARY_SEARCH_DEFAULT_DIRS: LOAD_LIBRARY_FLAGS = 4096u32; +pub type PCSTR = *const u8; +pub type RPC_STATUS = i32; +pub const RPC_S_UUID_LOCAL_ONLY: RPC_STATUS = 1824i32; +pub type HSTRING = *mut core::ffi::c_void; diff --git a/src-tauri/vendor/windows-core/src/imp/can_into.rs b/src-tauri/vendor/windows-core/src/imp/can_into.rs new file mode 100644 index 00000000..47ee7838 --- /dev/null +++ b/src-tauri/vendor/windows-core/src/imp/can_into.rs @@ -0,0 +1,5 @@ +pub trait CanInto: Sized { + const QUERY: bool = false; +} + +impl CanInto for T where T: Clone {} diff --git a/src-tauri/vendor/windows-core/src/imp/com_bindings.rs b/src-tauri/vendor/windows-core/src/imp/com_bindings.rs new file mode 100644 index 00000000..052cf504 --- /dev/null +++ b/src-tauri/vendor/windows-core/src/imp/com_bindings.rs @@ -0,0 +1,246 @@ +#[inline] +pub unsafe fn RoGetAgileReference( + options: AgileReferenceOptions, + riid: *const windows_core::GUID, + punk: P2, +) -> windows_core::Result +where + P2: windows_core::Param, +{ + windows_core::link!("combase.dll" "system" fn RoGetAgileReference(options : AgileReferenceOptions, riid : *const windows_core::GUID, punk : * mut core::ffi::c_void, ppagilereference : *mut * mut core::ffi::c_void) -> windows_core::HRESULT); + unsafe { + let mut result__ = core::mem::zeroed(); + RoGetAgileReference(options, riid, punk.param().abi(), &mut result__) + .and_then(|| windows_core::Type::from_abi(result__)) + } +} +pub const AGILEREFERENCE_DEFAULT: AgileReferenceOptions = AgileReferenceOptions(0i32); +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] +pub struct AgileReferenceOptions(pub i32); +pub const CO_E_NOTINITIALIZED: windows_core::HRESULT = windows_core::HRESULT(0x800401F0_u32 as _); +pub const E_INVALIDARG: windows_core::HRESULT = windows_core::HRESULT(0x80070057_u32 as _); +pub const E_NOINTERFACE: windows_core::HRESULT = windows_core::HRESULT(0x80004002_u32 as _); +pub const E_POINTER: windows_core::HRESULT = windows_core::HRESULT(0x80004003_u32 as _); +windows_core::imp::define_interface!( + IAgileObject, + IAgileObject_Vtbl, + 0x94ea2b94_e9cc_49e0_c0ff_ee64ca8f5b90 +); +windows_core::imp::interface_hierarchy!(IAgileObject, windows_core::IUnknown); +#[repr(C)] +#[doc(hidden)] +pub struct IAgileObject_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, +} +pub trait IAgileObject_Impl: windows_core::IUnknownImpl {} +impl IAgileObject_Vtbl { + pub const fn new() -> Self { + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for IAgileObject {} +windows_core::imp::define_interface!( + IAgileReference, + IAgileReference_Vtbl, + 0xc03f6a43_65a4_9818_987e_e0b810d2a6f2 +); +windows_core::imp::interface_hierarchy!(IAgileReference, windows_core::IUnknown); +impl IAgileReference { + pub unsafe fn Resolve(&self) -> windows_core::Result + where + T: windows_core::Interface, + { + let mut result__ = core::ptr::null_mut(); + unsafe { + (windows_core::Interface::vtable(self).Resolve)( + windows_core::Interface::as_raw(self), + &T::IID, + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct IAgileReference_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Resolve: unsafe extern "system" fn( + *mut core::ffi::c_void, + *const windows_core::GUID, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait IAgileReference_Impl: windows_core::IUnknownImpl { + fn Resolve( + &self, + riid: *const windows_core::GUID, + ppvobjectreference: *mut *mut core::ffi::c_void, + ) -> windows_core::Result<()>; +} +impl IAgileReference_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn Resolve( + this: *mut core::ffi::c_void, + riid: *const windows_core::GUID, + ppvobjectreference: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + IAgileReference_Impl::Resolve( + this, + core::mem::transmute_copy(&riid), + core::mem::transmute_copy(&ppvobjectreference), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Resolve: Resolve::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for IAgileReference {} +windows_core::imp::define_interface!( + IWeakReference, + IWeakReference_Vtbl, + 0x00000037_0000_0000_c000_000000000046 +); +windows_core::imp::interface_hierarchy!(IWeakReference, windows_core::IUnknown); +impl IWeakReference { + pub unsafe fn Resolve(&self) -> windows_core::Result + where + T: windows_core::Interface, + { + let mut result__ = core::ptr::null_mut(); + unsafe { + (windows_core::Interface::vtable(self).Resolve)( + windows_core::Interface::as_raw(self), + &T::IID, + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct IWeakReference_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub Resolve: unsafe extern "system" fn( + *mut core::ffi::c_void, + *const windows_core::GUID, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait IWeakReference_Impl: windows_core::IUnknownImpl { + fn Resolve( + &self, + riid: *const windows_core::GUID, + objectreference: *mut *mut core::ffi::c_void, + ) -> windows_core::Result<()>; +} +impl IWeakReference_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn Resolve( + this: *mut core::ffi::c_void, + riid: *const windows_core::GUID, + objectreference: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + IWeakReference_Impl::Resolve( + this, + core::mem::transmute_copy(&riid), + core::mem::transmute_copy(&objectreference), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + Resolve: Resolve::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for IWeakReference {} +windows_core::imp::define_interface!( + IWeakReferenceSource, + IWeakReferenceSource_Vtbl, + 0x00000038_0000_0000_c000_000000000046 +); +windows_core::imp::interface_hierarchy!(IWeakReferenceSource, windows_core::IUnknown); +impl IWeakReferenceSource { + pub unsafe fn GetWeakReference(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).GetWeakReference)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .and_then(|| windows_core::Type::from_abi(result__)) + } + } +} +#[repr(C)] +#[doc(hidden)] +pub struct IWeakReferenceSource_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub GetWeakReference: unsafe extern "system" fn( + *mut core::ffi::c_void, + *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT, +} +pub trait IWeakReferenceSource_Impl: windows_core::IUnknownImpl { + fn GetWeakReference(&self) -> windows_core::Result; +} +impl IWeakReferenceSource_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn GetWeakReference< + Identity: IWeakReferenceSource_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + weakreference: *mut *mut core::ffi::c_void, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match IWeakReferenceSource_Impl::GetWeakReference(this) { + Ok(ok__) => { + weakreference.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + GetWeakReference: GetWeakReference::, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for IWeakReferenceSource {} +pub const JSCRIPT_E_CANTEXECUTE: windows_core::HRESULT = windows_core::HRESULT(0x89020001_u32 as _); +pub const REGDB_E_CLASSNOTREG: windows_core::HRESULT = windows_core::HRESULT(0x80040154_u32 as _); +pub const RPC_E_DISCONNECTED: windows_core::HRESULT = windows_core::HRESULT(0x80010108_u32 as _); +pub const S_OK: windows_core::HRESULT = windows_core::HRESULT(0x0_u32 as _); diff --git a/src-tauri/vendor/windows-core/src/imp/factory_cache.rs b/src-tauri/vendor/windows-core/src/imp/factory_cache.rs new file mode 100644 index 00000000..8adcb089 --- /dev/null +++ b/src-tauri/vendor/windows-core/src/imp/factory_cache.rs @@ -0,0 +1,214 @@ +use super::*; +use crate::Interface; +use core::ffi::c_void; +use core::marker::PhantomData; +use core::mem::{forget, transmute, transmute_copy}; +use core::ptr::null_mut; +use core::sync::atomic::{AtomicPtr, Ordering}; + +pub struct FactoryCache { + shared: AtomicPtr, + _c: PhantomData, + _i: PhantomData, +} + +impl FactoryCache { + pub const fn new() -> Self { + Self { + shared: AtomicPtr::new(null_mut()), + _c: PhantomData, + _i: PhantomData, + } + } +} + +impl Default for FactoryCache { + fn default() -> Self { + Self::new() + } +} + +impl FactoryCache { + pub fn call crate::Result>(&self, callback: F) -> crate::Result { + loop { + // Attempt to load a previously cached factory pointer. + let ptr = self.shared.load(Ordering::Relaxed); + + // If a pointer is found, the cache is primed and we're good to go. + if !ptr.is_null() { + return callback(unsafe { transmute::<&*mut c_void, &I>(&ptr) }); + } + + // Otherwise, we load the factory the usual way. + let factory = load_factory::()?; + + // If the factory is agile, we can safely cache it. + if factory.cast::().is_ok() { + if self + .shared + .compare_exchange_weak( + null_mut(), + factory.as_raw(), + Ordering::Relaxed, + Ordering::Relaxed, + ) + .is_ok() + { + forget(factory); + } + } else { + // Otherwise, for non-agile factories we simply use the factory + // and discard after use as it is not safe to cache. + return callback(&factory); + } + } + } +} + +// This is safe because `FactoryCache` only holds agile factory pointers, which are safe to cache and share between threads. +unsafe impl Sync for FactoryCache {} + +/// Attempts to load the factory object for the given WinRT class. +/// This can be used to access COM interfaces implemented on a Windows Runtime class factory. +pub fn load_factory() -> crate::Result { + let mut factory: Option = None; + let name = crate::HSTRING::from(C::NAME); + + let code = unsafe { + let mut get_com_factory = || { + crate::HRESULT(RoGetActivationFactory( + transmute_copy(&name), + &I::IID as *const _ as _, + &mut factory as *mut _ as *mut _, + )) + }; + let mut code = get_com_factory(); + + // If RoGetActivationFactory fails because combase hasn't been loaded yet then load combase + // automatically so that it "just works" for apartment-agnostic code. + if code == CO_E_NOTINITIALIZED { + let mut cookie = core::ptr::null_mut(); + CoIncrementMTAUsage(&mut cookie); + + // Now try a second time to get the activation factory via the OS. + code = get_com_factory(); + } + + code + }; + + // If this succeeded then return the resulting factory interface. + if let Some(factory) = factory { + return Ok(factory); + } + + // Reg-free activation should only be attempted if the class is not registered. + // It should not be attempted if the class is registered but fails to activate. + if code == REGDB_E_CLASSNOTREG { + // Now attempt to find the factory's implementation heuristically. + if let Some(i) = search_path(C::NAME, |library| unsafe { + get_activation_factory(library, &name) + }) { + return i.cast(); + } + } + + Err(crate::Error::from_hresult(code)) +} + +// Remove the suffix until a match is found appending `.dll\0` at the end +/// +/// For example, if the class name is +/// "A.B.TypeName" then the attempted load order will be: +/// 1. A.B.dll +/// 2. A.dll +fn search_path(mut path: &str, mut callback: F) -> Option +where + F: FnMut(crate::PCSTR) -> crate::Result, +{ + let suffix = b".dll\0"; + let mut library = alloc::vec![0; path.len() + suffix.len()]; + while let Some(pos) = path.rfind('.') { + path = &path[..pos]; + library.truncate(path.len() + suffix.len()); + library[..path.len()].copy_from_slice(path.as_bytes()); + library[path.len()..].copy_from_slice(suffix); + + if let Ok(r) = callback(crate::PCSTR::from_raw(library.as_ptr())) { + return Some(r); + } + } + + None +} + +unsafe fn get_activation_factory( + library: crate::PCSTR, + name: &crate::HSTRING, +) -> crate::Result { + unsafe { + let function = + delay_load::(library, crate::s!("DllGetActivationFactory")) + .ok_or_else(crate::Error::from_thread)?; + let mut abi = null_mut(); + function(transmute_copy(name), &mut abi).and_then(|| crate::Type::from_abi(abi)) + } +} + +unsafe fn delay_load(library: crate::PCSTR, function: crate::PCSTR) -> Option { + unsafe { + let library = LoadLibraryExA( + library.0, + core::ptr::null_mut(), + LOAD_LIBRARY_SEARCH_DEFAULT_DIRS, + ); + + if library.is_null() { + return None; + } + + let address = GetProcAddress(library, function.0); + + if address.is_some() { + return Some(core::mem::transmute_copy(&address)); + } + + FreeLibrary(library); + None + } +} + +type DllGetActivationFactory = + extern "system" fn(name: *mut c_void, factory: *mut *mut c_void) -> crate::HRESULT; + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn dll_search() { + let path = "A.B.TypeName"; + + // Test library successfully found + let mut results = Vec::new(); + let end_result = search_path(path, |library| { + results.push(unsafe { library.to_string().unwrap() }); + if unsafe { library.as_bytes() } == &b"A.dll"[..] { + Ok(42) + } else { + Err(crate::Error::empty()) + } + }); + assert!(matches!(end_result, Some(42))); + assert_eq!(results, vec!["A.B.dll", "A.dll"]); + + // Test library never successfully found + let mut results = Vec::new(); + let end_result = search_path(path, |library| { + results.push(unsafe { library.to_string().unwrap() }); + crate::Result::<()>::Err(crate::Error::empty()) + }); + assert!(end_result.is_none()); + assert_eq!(results, vec!["A.B.dll", "A.dll"]); + } +} diff --git a/src-tauri/vendor/windows-core/src/imp/generic_factory.rs b/src-tauri/vendor/windows-core/src/imp/generic_factory.rs new file mode 100644 index 00000000..1f9ddcee --- /dev/null +++ b/src-tauri/vendor/windows-core/src/imp/generic_factory.rs @@ -0,0 +1,33 @@ +use crate::Interface; +use core::ffi::c_void; +use core::mem::{transmute_copy, zeroed}; + +// A streamlined version of the IActivationFactory interface used by WinRT class factories used internally by the windows crate +// to simplify code generation. Components should implement the `IActivationFactory` interface published by the windows crate. +super::define_interface!( + IGenericFactory, + IGenericFactory_Vtbl, + 0x00000035_0000_0000_c000_000000000046 +); +super::interface_hierarchy!(IGenericFactory, crate::IUnknown, crate::IInspectable); + +impl IGenericFactory { + pub fn ActivateInstance(&self) -> crate::Result { + unsafe { + let mut result__ = zeroed(); + (Interface::vtable(self).ActivateInstance)( + transmute_copy(self), + &mut result__ as *mut _ as *mut _, + ) + .and_then(|| crate::Type::from_abi(result__)) + .and_then(|interface: crate::IInspectable| interface.cast()) + } + } +} + +#[repr(C)] +pub struct IGenericFactory_Vtbl { + pub base__: crate::IInspectable_Vtbl, + pub ActivateInstance: + unsafe extern "system" fn(this: *mut c_void, instance: *mut *mut c_void) -> crate::HRESULT, +} diff --git a/src-tauri/vendor/windows-core/src/imp/marshaler.rs b/src-tauri/vendor/windows-core/src/imp/marshaler.rs new file mode 100644 index 00000000..2ef9d847 --- /dev/null +++ b/src-tauri/vendor/windows-core/src/imp/marshaler.rs @@ -0,0 +1,268 @@ +use super::*; +use crate::{IUnknown, IUnknown_Vtbl, Interface, GUID, HRESULT}; +use core::ffi::c_void; +use core::mem::{transmute, transmute_copy}; +use core::ptr::null_mut; + +windows_link::link!("ole32.dll" "system" fn CoCreateFreeThreadedMarshaler(punkouter: *mut c_void, ppunkmarshal: *mut *mut c_void) -> HRESULT); + +pub unsafe fn marshaler(outer: IUnknown, result: *mut *mut c_void) -> HRESULT { + unsafe { + let mut marshaler_raw = null_mut(); + _ = CoCreateFreeThreadedMarshaler(null_mut(), &mut marshaler_raw); + assert!(!marshaler_raw.is_null(), "allocation failed"); + let marshaler: IUnknown = transmute(marshaler_raw); + + _ = (marshaler.vtable().QueryInterface)( + transmute_copy(&marshaler), + &IMarshal::IID, + &mut marshaler_raw, + ); + + debug_assert!(!marshaler_raw.is_null()); + let marshaler: IMarshal = transmute(marshaler_raw); + + let marshaler = Marshaler { + vtable: &Marshaler::VTABLE, + outer, + marshaler, + count: RefCount::new(1), + }; + + debug_assert!(!result.is_null()); + *result = transmute::, *mut c_void>(Box::new(marshaler)); + S_OK + } +} + +#[repr(C)] +struct Marshaler { + vtable: *const IMarshal_Vtbl, + outer: IUnknown, + marshaler: IMarshal, + count: RefCount, +} + +impl Marshaler { + const VTABLE: IMarshal_Vtbl = IMarshal_Vtbl { + base__: IUnknown_Vtbl { + QueryInterface: Self::QueryInterface, + AddRef: Self::AddRef, + Release: Self::Release, + }, + GetUnmarshalClass: Self::GetUnmarshalClass, + GetMarshalSizeMax: Self::GetMarshalSizeMax, + MarshalInterface: Self::MarshalInterface, + UnmarshalInterface: Self::UnmarshalInterface, + ReleaseMarshalData: Self::ReleaseMarshalData, + DisconnectObject: Self::DisconnectObject, + }; + + unsafe extern "system" fn QueryInterface( + this: *mut c_void, + iid: *const GUID, + interface: *mut *mut c_void, + ) -> HRESULT { + unsafe { + let this = this as *mut *mut c_void as *mut Self; + + if iid.is_null() || interface.is_null() { + return E_POINTER; + } + + if *iid == IMarshal::IID { + *interface = &mut (*this).vtable as *mut _ as _; + (*this).count.add_ref(); + return S_OK; + } + + ((*this).outer.vtable().QueryInterface)(transmute_copy(&(*this).outer), iid, interface) + } + } + + unsafe extern "system" fn AddRef(this: *mut c_void) -> u32 { + unsafe { + let this = this as *mut *mut c_void as *mut Self; + (*this).count.add_ref() + } + } + + unsafe extern "system" fn Release(this: *mut c_void) -> u32 { + unsafe { + let this = this as *mut *mut c_void as *mut Self; + let remaining = (*this).count.release(); + + if remaining == 0 { + let _ = Box::from_raw(this); + } + + remaining + } + } + + unsafe extern "system" fn GetUnmarshalClass( + this: *mut c_void, + riid: *const GUID, + pv: *const c_void, + dwdestcontext: u32, + pvdestcontext: *const c_void, + mshlflags: u32, + pcid: *mut GUID, + ) -> HRESULT { + unsafe { + let this = this as *mut *mut c_void as *mut Self; + + ((*this).marshaler.vtable().GetUnmarshalClass)( + transmute_copy(&(*this).marshaler), + riid, + pv, + dwdestcontext, + pvdestcontext, + mshlflags, + pcid, + ) + } + } + + unsafe extern "system" fn GetMarshalSizeMax( + this: *mut c_void, + riid: *const GUID, + pv: *const c_void, + dwdestcontext: u32, + pvdestcontext: *const c_void, + mshlflags: u32, + psize: *mut u32, + ) -> HRESULT { + unsafe { + let this = this as *mut *mut c_void as *mut Self; + + ((*this).marshaler.vtable().GetMarshalSizeMax)( + transmute_copy(&(*this).marshaler), + riid, + pv, + dwdestcontext, + pvdestcontext, + mshlflags, + psize, + ) + } + } + + unsafe extern "system" fn MarshalInterface( + this: *mut c_void, + pstm: *mut c_void, + riid: *const GUID, + pv: *const c_void, + dwdestcontext: u32, + pvdestcontext: *const c_void, + mshlflags: u32, + ) -> HRESULT { + unsafe { + let this = this as *mut *mut c_void as *mut Self; + + ((*this).marshaler.vtable().MarshalInterface)( + transmute_copy(&(*this).marshaler), + pstm, + riid, + pv, + dwdestcontext, + pvdestcontext, + mshlflags, + ) + } + } + + unsafe extern "system" fn UnmarshalInterface( + this: *mut c_void, + pstm: *mut c_void, + riid: *const GUID, + ppv: *mut *mut c_void, + ) -> HRESULT { + unsafe { + let this = this as *mut *mut c_void as *mut Self; + + ((*this).marshaler.vtable().UnmarshalInterface)( + transmute_copy(&(*this).marshaler), + pstm, + riid, + ppv, + ) + } + } + + unsafe extern "system" fn ReleaseMarshalData(this: *mut c_void, pstm: *mut c_void) -> HRESULT { + unsafe { + let this = this as *mut *mut c_void as *mut Self; + + ((*this).marshaler.vtable().ReleaseMarshalData)( + transmute_copy(&(*this).marshaler), + pstm, + ) + } + } + + unsafe extern "system" fn DisconnectObject(this: *mut c_void, dwreserved: u32) -> HRESULT { + unsafe { + let this = this as *mut *mut c_void as *mut Self; + + ((*this).marshaler.vtable().DisconnectObject)( + transmute_copy(&(*this).marshaler), + dwreserved, + ) + } + } +} + +#[repr(transparent)] +#[derive(Clone)] +pub struct IMarshal(IUnknown); + +unsafe impl Interface for IMarshal { + type Vtable = IMarshal_Vtbl; + const IID: GUID = GUID::from_u128(0x00000003_0000_0000_c000_000000000046); +} + +#[repr(C)] +pub struct IMarshal_Vtbl { + base__: IUnknown_Vtbl, + + GetUnmarshalClass: unsafe extern "system" fn( + *mut c_void, + *const GUID, + *const c_void, + u32, + *const c_void, + u32, + *mut GUID, + ) -> HRESULT, + + GetMarshalSizeMax: unsafe extern "system" fn( + *mut c_void, + *const GUID, + *const c_void, + u32, + *const c_void, + u32, + *mut u32, + ) -> HRESULT, + + MarshalInterface: unsafe extern "system" fn( + *mut c_void, + *mut c_void, + *const GUID, + *const c_void, + u32, + *const c_void, + u32, + ) -> HRESULT, + + UnmarshalInterface: unsafe extern "system" fn( + *mut c_void, + *mut c_void, + *const GUID, + *mut *mut c_void, + ) -> HRESULT, + + ReleaseMarshalData: unsafe extern "system" fn(*mut c_void, *mut c_void) -> HRESULT, + DisconnectObject: unsafe extern "system" fn(*mut c_void, u32) -> HRESULT, +} diff --git a/src-tauri/vendor/windows-core/src/imp/mod.rs b/src-tauri/vendor/windows-core/src/imp/mod.rs new file mode 100644 index 00000000..f4b84058 --- /dev/null +++ b/src-tauri/vendor/windows-core/src/imp/mod.rs @@ -0,0 +1,98 @@ +#[cfg(windows)] +include!("windows.rs"); + +mod bindings; +mod can_into; +mod com_bindings; +mod ref_count; +mod sha1; +mod weak_ref_count; + +pub(crate) use bindings::*; +pub use can_into::*; +pub use com_bindings::*; +pub use ref_count::*; +pub use sha1::*; +pub use weak_ref_count::*; + +#[doc(hidden)] +#[macro_export] +macro_rules! interface_hierarchy { + ($child:ident, $parent:ty) => { + impl ::windows_core::imp::CanInto<$parent> for $child {} + impl ::core::convert::From<&$child> for &$parent { + fn from(value: &$child) -> Self { + unsafe { ::core::mem::transmute(value) } + } + } + impl ::core::convert::From<$child> for $parent { + fn from(value: $child) -> Self { + unsafe { ::core::mem::transmute(value) } + } + } + }; + ($child:ident, $first:ty, $($rest:ty),+) => { + $crate::imp::interface_hierarchy!($child, $first); + $crate::imp::interface_hierarchy!($child, $($rest),+); + }; +} + +#[doc(hidden)] +pub use interface_hierarchy; + +#[doc(hidden)] +#[macro_export] +macro_rules! required_hierarchy { + ($child:ident, $parent:ty) => { + impl ::windows_core::imp::CanInto<$parent> for $child { const QUERY: bool = true; } + }; + ($child:ident, $first:ty, $($rest:ty),+) => { + $crate::imp::required_hierarchy!($child, $first); + $crate::imp::required_hierarchy!($child, $($rest),+); + }; +} + +#[doc(hidden)] +pub use required_hierarchy; + +#[doc(hidden)] +#[macro_export] +macro_rules! define_interface { + ($name:ident, $vtbl:ident, $iid:literal) => { + #[repr(transparent)] + #[derive(::core::cmp::PartialEq, ::core::cmp::Eq, ::core::clone::Clone)] + pub struct $name(::windows_core::IUnknown); + unsafe impl ::windows_core::Interface for $name { + type Vtable = $vtbl; + const IID: ::windows_core::GUID = ::windows_core::GUID::from_u128($iid); + } + impl ::core::fmt::Debug for $name { + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> core::fmt::Result { + f.debug_tuple(stringify!($name)) + .field(&::windows_core::Interface::as_raw(self)) + .finish() + } + } + }; + ($name:ident, $vtbl:ident) => { + #[repr(transparent)] + #[derive(::core::cmp::PartialEq, ::core::cmp::Eq, ::core::clone::Clone)] + pub struct $name(::core::ptr::NonNull<::core::ffi::c_void>); + unsafe impl ::windows_core::Interface for $name { + type Vtable = $vtbl; + const IID: ::windows_core::GUID = ::windows_core::GUID::zeroed(); + const UNKNOWN: bool = false; + } + impl ::core::fmt::Debug for $name { + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> core::fmt::Result { + f.debug_tuple(stringify!($name)).field(&self.0).finish() + } + } + }; +} + +#[doc(hidden)] +pub use define_interface; + +#[doc(hidden)] +pub use alloc::boxed::Box; diff --git a/src-tauri/vendor/windows-core/src/imp/ref_count.rs b/src-tauri/vendor/windows-core/src/imp/ref_count.rs new file mode 100644 index 00000000..97e1f2a6 --- /dev/null +++ b/src-tauri/vendor/windows-core/src/imp/ref_count.rs @@ -0,0 +1,33 @@ +use core::sync::atomic::{fence, AtomicI32, Ordering}; + +#[repr(transparent)] +#[derive(Default)] +pub struct RefCount(pub(crate) AtomicI32); + +impl RefCount { + /// Creates a new `RefCount` with an initial value of `1`. + pub const fn new(count: u32) -> Self { + Self(AtomicI32::new(count as i32)) + } + + /// Increments the reference count, returning the new value. + pub fn add_ref(&self) -> u32 { + (self.0.fetch_add(1, Ordering::Relaxed) + 1) as u32 + } + + /// Decrements the reference count, returning the new value. + /// + /// This operation inserts an `Acquire` fence when the reference count reaches zero. + /// This prevents reordering before the object is destroyed. + pub fn release(&self) -> u32 { + let remaining = self.0.fetch_sub(1, Ordering::Release) - 1; + + match remaining.cmp(&0) { + core::cmp::Ordering::Equal => fence(Ordering::Acquire), + core::cmp::Ordering::Less => panic!("Object has been over-released."), + core::cmp::Ordering::Greater => {} + } + + remaining as u32 + } +} diff --git a/src-tauri/vendor/windows-core/src/imp/sha1.rs b/src-tauri/vendor/windows-core/src/imp/sha1.rs new file mode 100644 index 00000000..98d81cb6 --- /dev/null +++ b/src-tauri/vendor/windows-core/src/imp/sha1.rs @@ -0,0 +1,487 @@ +pub const fn sha1(data: &ConstBuffer) -> Digest { + let state: [u32; 5] = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0]; + let len: u64 = 0; + let blocks = Blocks { + len: 0, + data: [0; 64], + }; + let (blocks, len, state) = process_blocks(blocks, data, len, state); + digest(state, len, blocks) +} + +const BUFFER_SIZE: usize = 1024; + +pub struct ConstBuffer { + data: [u8; BUFFER_SIZE], + head: usize, +} + +impl Default for ConstBuffer { + fn default() -> Self { + Self::new() + } +} + +impl ConstBuffer { + pub const fn for_class() -> Self { + Self::new() + .push_slice(b"rc(") + .push_slice(C::NAME.as_bytes()) + .push(b';') + .push_other(I::SIGNATURE) + .push(b')') + } + + pub const fn for_interface() -> Self { + Self::new().push_guid(&T::IID) + } + + pub const fn from_slice(slice: &[u8]) -> Self { + let s = Self::new(); + s.push_slice(slice) + } + + pub const fn new() -> Self { + Self { + data: [0; BUFFER_SIZE], + head: 0, + } + } + + pub const fn push_slice(self, slice: &[u8]) -> Self { + self.push_amount(slice, slice.len()) + } + + const fn get(&self, index: usize) -> u8 { + self.data[index] + } + + const fn len(&self) -> usize { + self.head + } + + pub fn as_slice(&self) -> &[u8] { + &self.data[..self.head] + } + + pub const fn push_other(self, other: Self) -> Self { + self.push_amount(&other.data, other.len()) + } + + const fn push(mut self, value: u8) -> Self { + self.data[self.head] = value; + self.head += 1; + self + } + + const fn push_hex_u8(self, value: u8) -> Self { + const fn digit(mut value: u8) -> u8 { + value &= 0xF; + + if value < 10 { + b'0' + value + } else { + b'a' + (value - 10) + } + } + + self.push(digit(value >> 4)).push(digit(value)) + } + + const fn push_hex_u16(self, value: u16) -> Self { + self.push_hex_u8((value >> 8) as u8) + .push_hex_u8((value & 0xFF) as u8) + } + + const fn push_hex_u32(self, value: u32) -> Self { + self.push_hex_u16((value >> 16) as u16) + .push_hex_u16((value & 0xFFFF) as u16) + } + + const fn push_amount(mut self, slice: &[u8], amount: usize) -> Self { + let mut i = 0; + while i < amount { + self.data[self.head + i] = slice[i]; + i += 1; + } + self.head += i; + self + } + + const fn push_guid(self, guid: &crate::GUID) -> Self { + self.push(b'{') + .push_hex_u32(guid.data1) + .push(b'-') + .push_hex_u16(guid.data2) + .push(b'-') + .push_hex_u16(guid.data3) + .push(b'-') + .push_hex_u16(((guid.data4[0] as u16) << 8) | guid.data4[1] as u16) + .push(b'-') + .push_hex_u16(((guid.data4[2] as u16) << 8) | guid.data4[3] as u16) + .push_hex_u16(((guid.data4[4] as u16) << 8) | guid.data4[5] as u16) + .push_hex_u16(((guid.data4[6] as u16) << 8) | guid.data4[7] as u16) + .push(b'}') + } +} + +struct Blocks { + len: u32, + data: [u8; 64], +} + +const fn process_blocks( + mut blocks: Blocks, + data: &ConstBuffer, + mut len: u64, + mut state: [u32; 5], +) -> (Blocks, u64, [u32; 5]) { + const fn as_block(input: &ConstBuffer, offset: usize) -> [u32; 16] { + let mut result = [0u32; 16]; + + let mut i = 0; + while i != 16 { + let off = offset + (i * 4); + result[i] = (input.get(off + 3) as u32) + | ((input.get(off + 2) as u32) << 8) + | ((input.get(off + 1) as u32) << 16) + | ((input.get(off) as u32) << 24); + i += 1; + } + result + } + + const fn clone_from_slice_64( + mut data: [u8; 64], + slice: &[u8], + offset: usize, + num_elems: usize, + ) -> [u8; 64] { + let mut i = 0; + while i < num_elems { + data[i] = slice[offset + i]; + i += 1; + } + data + } + + let mut i = 0; + while i < data.len() { + if data.len() - i >= 64 { + let chunk_block = as_block(data, i); + len += 64; + state = process_state(state, chunk_block); + i += 64; + } else { + let num_elems = data.len() - i; + blocks.data = clone_from_slice_64(blocks.data, &data.data, i, num_elems); + blocks.len = num_elems as u32; + break; + } + } + (blocks, len, state) +} + +const fn process_state(mut state: [u32; 5], block: [u32; 16]) -> [u32; 5] { + let a = state[0]; + let b = state[1]; + let c = state[2]; + let d = state[3]; + let e = state[4]; + let (block, b, e) = r0(block, a, b, c, d, e, 0); + let (block, a, d) = r0(block, e, a, b, c, d, 1); + let (block, e, c) = r0(block, d, e, a, b, c, 2); + let (block, d, b) = r0(block, c, d, e, a, b, 3); + let (block, c, a) = r0(block, b, c, d, e, a, 4); + let (block, b, e) = r0(block, a, b, c, d, e, 5); + let (block, a, d) = r0(block, e, a, b, c, d, 6); + let (block, e, c) = r0(block, d, e, a, b, c, 7); + let (block, d, b) = r0(block, c, d, e, a, b, 8); + let (block, c, a) = r0(block, b, c, d, e, a, 9); + let (block, b, e) = r0(block, a, b, c, d, e, 10); + let (block, a, d) = r0(block, e, a, b, c, d, 11); + let (block, e, c) = r0(block, d, e, a, b, c, 12); + let (block, d, b) = r0(block, c, d, e, a, b, 13); + let (block, c, a) = r0(block, b, c, d, e, a, 14); + let (block, b, e) = r0(block, a, b, c, d, e, 15); + let (block, a, d) = r1(block, e, a, b, c, d, 0); + let (block, e, c) = r1(block, d, e, a, b, c, 1); + let (block, d, b) = r1(block, c, d, e, a, b, 2); + let (block, c, a) = r1(block, b, c, d, e, a, 3); + let (block, b, e) = r2(block, a, b, c, d, e, 4); + let (block, a, d) = r2(block, e, a, b, c, d, 5); + let (block, e, c) = r2(block, d, e, a, b, c, 6); + let (block, d, b) = r2(block, c, d, e, a, b, 7); + let (block, c, a) = r2(block, b, c, d, e, a, 8); + let (block, b, e) = r2(block, a, b, c, d, e, 9); + let (block, a, d) = r2(block, e, a, b, c, d, 10); + let (block, e, c) = r2(block, d, e, a, b, c, 11); + let (block, d, b) = r2(block, c, d, e, a, b, 12); + let (block, c, a) = r2(block, b, c, d, e, a, 13); + let (block, b, e) = r2(block, a, b, c, d, e, 14); + let (block, a, d) = r2(block, e, a, b, c, d, 15); + let (block, e, c) = r2(block, d, e, a, b, c, 0); + let (block, d, b) = r2(block, c, d, e, a, b, 1); + let (block, c, a) = r2(block, b, c, d, e, a, 2); + let (block, b, e) = r2(block, a, b, c, d, e, 3); + let (block, a, d) = r2(block, e, a, b, c, d, 4); + let (block, e, c) = r2(block, d, e, a, b, c, 5); + let (block, d, b) = r2(block, c, d, e, a, b, 6); + let (block, c, a) = r2(block, b, c, d, e, a, 7); + let (block, b, e) = r3(block, a, b, c, d, e, 8); + let (block, a, d) = r3(block, e, a, b, c, d, 9); + let (block, e, c) = r3(block, d, e, a, b, c, 10); + let (block, d, b) = r3(block, c, d, e, a, b, 11); + let (block, c, a) = r3(block, b, c, d, e, a, 12); + let (block, b, e) = r3(block, a, b, c, d, e, 13); + let (block, a, d) = r3(block, e, a, b, c, d, 14); + let (block, e, c) = r3(block, d, e, a, b, c, 15); + let (block, d, b) = r3(block, c, d, e, a, b, 0); + let (block, c, a) = r3(block, b, c, d, e, a, 1); + let (block, b, e) = r3(block, a, b, c, d, e, 2); + let (block, a, d) = r3(block, e, a, b, c, d, 3); + let (block, e, c) = r3(block, d, e, a, b, c, 4); + let (block, d, b) = r3(block, c, d, e, a, b, 5); + let (block, c, a) = r3(block, b, c, d, e, a, 6); + let (block, b, e) = r3(block, a, b, c, d, e, 7); + let (block, a, d) = r3(block, e, a, b, c, d, 8); + let (block, e, c) = r3(block, d, e, a, b, c, 9); + let (block, d, b) = r3(block, c, d, e, a, b, 10); + let (block, c, a) = r3(block, b, c, d, e, a, 11); + let (block, b, e) = r4(block, a, b, c, d, e, 12); + let (block, a, d) = r4(block, e, a, b, c, d, 13); + let (block, e, c) = r4(block, d, e, a, b, c, 14); + let (block, d, b) = r4(block, c, d, e, a, b, 15); + let (block, c, a) = r4(block, b, c, d, e, a, 0); + let (block, b, e) = r4(block, a, b, c, d, e, 1); + let (block, a, d) = r4(block, e, a, b, c, d, 2); + let (block, e, c) = r4(block, d, e, a, b, c, 3); + let (block, d, b) = r4(block, c, d, e, a, b, 4); + let (block, c, a) = r4(block, b, c, d, e, a, 5); + let (block, b, e) = r4(block, a, b, c, d, e, 6); + let (block, a, d) = r4(block, e, a, b, c, d, 7); + let (block, e, c) = r4(block, d, e, a, b, c, 8); + let (block, d, b) = r4(block, c, d, e, a, b, 9); + let (block, c, a) = r4(block, b, c, d, e, a, 10); + let (block, b, e) = r4(block, a, b, c, d, e, 11); + let (block, a, d) = r4(block, e, a, b, c, d, 12); + let (block, e, c) = r4(block, d, e, a, b, c, 13); + let (block, d, b) = r4(block, c, d, e, a, b, 14); + let (_, c, a) = r4(block, b, c, d, e, a, 15); + + state[0] = state[0].wrapping_add(a); + state[1] = state[1].wrapping_add(b); + state[2] = state[2].wrapping_add(c); + state[3] = state[3].wrapping_add(d); + state[4] = state[4].wrapping_add(e); + state +} + +const fn digest(mut state: [u32; 5], len: u64, blocks: Blocks) -> Digest { + const fn clone_from_slice_128( + mut data: [u8; 128], + slice: &[u8], + offset: usize, + num_elems: usize, + ) -> [u8; 128] { + let mut i = 0; + while i < num_elems { + data[i] = slice[offset + i]; + i += 1; + } + data + } + + const fn clone_slice_128(mut data: [u8; 128], slice: &[u8], _offset: usize) -> [u8; 128] { + let mut i = 0; + while i < slice.len() { + data[_offset + i] = slice[i]; + i += 1; + } + data + } + + const fn as_block(input: &[u8], offset: usize) -> [u32; 16] { + let mut result = [0u32; 16]; + + let mut i = 0; + while i != 16 { + let off = offset + (i * 4); + result[i] = (input[off + 3] as u32) + | ((input[off + 2] as u32) << 8) + | ((input[off + 1] as u32) << 16) + | ((input[off] as u32) << 24); + i += 1; + } + result + } + + let bits = (len + (blocks.len as u64)) * 8; + let extra = [ + (bits >> 56) as u8, + (bits >> 48) as u8, + (bits >> 40) as u8, + (bits >> 32) as u8, + (bits >> 24) as u8, + (bits >> 16) as u8, + (bits >> 8) as u8, + bits as u8, + ]; + let mut last = [0; 128]; + let blocklen = blocks.len as usize; + last = clone_from_slice_128(last, &blocks.data, 0, blocklen); + last[blocklen] = 0x80; + + if blocklen < 56 { + last = clone_slice_128(last, &extra, 56); + state = process_state(state, as_block(&last, 0)); + } else { + last = clone_slice_128(last, &extra, 120); + state = process_state(state, as_block(&last, 0)); + state = process_state(state, as_block(&last, 64)); + } + Digest { data: state } +} + +const fn rol(value: u32, bits: usize) -> u32 { + (value << bits) | (value >> (32 - bits)) +} + +const fn blk(block: &[u32], i: usize) -> u32 { + let value = block[(i + 13) & 15] ^ block[(i + 8) & 15] ^ block[(i + 2) & 15] ^ block[i]; + rol(value, 1) +} + +const fn r0( + block: [u32; 16], + v: u32, + mut w: u32, + x: u32, + y: u32, + mut z: u32, + i: usize, +) -> ([u32; 16], u32, u32) { + let n = ((w & (x ^ y)) ^ y) + .wrapping_add(block[i]) + .wrapping_add(0x5a82_7999) + .wrapping_add(rol(v, 5)); + z = z.wrapping_add(n); + w = rol(w, 30); + (block, w, z) +} + +const fn r1( + mut block: [u32; 16], + v: u32, + mut w: u32, + x: u32, + y: u32, + mut z: u32, + i: usize, +) -> ([u32; 16], u32, u32) { + block[i] = blk(&block, i); + let n = ((w & (x ^ y)) ^ y) + .wrapping_add(block[i]) + .wrapping_add(0x5a82_7999) + .wrapping_add(rol(v, 5)); + z = z.wrapping_add(n); + w = rol(w, 30); + (block, w, z) +} + +const fn r2( + mut block: [u32; 16], + v: u32, + mut w: u32, + x: u32, + y: u32, + mut z: u32, + i: usize, +) -> ([u32; 16], u32, u32) { + block[i] = blk(&block, i); + let n = (w ^ x ^ y) + .wrapping_add(block[i]) + .wrapping_add(0x6ed9_eba1) + .wrapping_add(rol(v, 5)); + z = z.wrapping_add(n); + w = rol(w, 30); + (block, w, z) +} + +const fn r3( + mut block: [u32; 16], + v: u32, + mut w: u32, + x: u32, + y: u32, + mut z: u32, + i: usize, +) -> ([u32; 16], u32, u32) { + block[i] = blk(&block, i); + let n = (((w | x) & y) | (w & x)) + .wrapping_add(block[i]) + .wrapping_add(0x8f1b_bcdc) + .wrapping_add(rol(v, 5)); + z = z.wrapping_add(n); + w = rol(w, 30); + (block, w, z) +} + +const fn r4( + mut block: [u32; 16], + v: u32, + mut w: u32, + x: u32, + y: u32, + mut z: u32, + i: usize, +) -> ([u32; 16], u32, u32) { + block[i] = blk(&block, i); + let n = (w ^ x ^ y) + .wrapping_add(block[i]) + .wrapping_add(0xca62_c1d6) + .wrapping_add(rol(v, 5)); + z = z.wrapping_add(n); + w = rol(w, 30); + (block, w, z) +} + +pub struct Digest { + data: [u32; 5], +} + +impl Digest { + pub const fn bytes(&self) -> [u8; 20] { + [ + (self.data[0] >> 24) as u8, + (self.data[0] >> 16) as u8, + (self.data[0] >> 8) as u8, + self.data[0] as u8, + (self.data[1] >> 24) as u8, + (self.data[1] >> 16) as u8, + (self.data[1] >> 8) as u8, + self.data[1] as u8, + (self.data[2] >> 24) as u8, + (self.data[2] >> 16) as u8, + (self.data[2] >> 8) as u8, + self.data[2] as u8, + (self.data[3] >> 24) as u8, + (self.data[3] >> 16) as u8, + (self.data[3] >> 8) as u8, + self.data[3] as u8, + (self.data[4] >> 24) as u8, + (self.data[4] >> 16) as u8, + (self.data[4] >> 8) as u8, + self.data[4] as u8, + ] + } +} + +impl core::fmt::Display for Digest { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + for i in self.data.iter() { + write!(f, "{i:08x}")?; + } + Ok(()) + } +} diff --git a/src-tauri/vendor/windows-core/src/imp/weak_ref_count.rs b/src-tauri/vendor/windows-core/src/imp/weak_ref_count.rs new file mode 100644 index 00000000..f8fde660 --- /dev/null +++ b/src-tauri/vendor/windows-core/src/imp/weak_ref_count.rs @@ -0,0 +1,327 @@ +use super::*; +use crate::{IUnknown, IUnknown_Vtbl, Interface, GUID, HRESULT}; +use core::ffi::c_void; +use core::mem::{transmute, transmute_copy}; +use core::ptr::null_mut; +use core::sync::atomic::{AtomicIsize, Ordering}; + +#[repr(transparent)] +#[derive(Default)] +pub struct WeakRefCount(AtomicIsize); + +impl WeakRefCount { + pub const fn new() -> Self { + Self(AtomicIsize::new(1)) + } + + pub fn add_ref(&self) -> u32 { + self.0 + .fetch_update(Ordering::Relaxed, Ordering::Relaxed, |count_or_pointer| { + bool::then_some(!is_weak_ref(count_or_pointer), count_or_pointer + 1) + }) + .map(|u| u as u32 + 1) + .unwrap_or_else(|pointer| unsafe { TearOff::decode(pointer).strong_count.add_ref() }) + } + + #[inline(always)] + pub fn is_one(&self) -> bool { + self.0.load(Ordering::Acquire) == 1 + } + + pub fn release(&self) -> u32 { + self.0 + .fetch_update(Ordering::Release, Ordering::Relaxed, |count_or_pointer| { + bool::then_some(!is_weak_ref(count_or_pointer), count_or_pointer - 1) + }) + .map(|u| u as u32 - 1) + .unwrap_or_else(|pointer| unsafe { + let tear_off = TearOff::decode(pointer); + let remaining = tear_off.strong_count.release(); + + // If this is the last strong reference, we can release the weak reference implied by the strong reference. + // There may still be weak references, so the WeakRelease is called to handle such possibilities. + if remaining == 0 { + TearOff::WeakRelease(&mut tear_off.weak_vtable as *mut _ as _); + } + + remaining + }) + } + + /// # Safety + pub unsafe fn query(&self, iid: &GUID, object: *mut c_void) -> *mut c_void { + unsafe { + if iid != &IWeakReferenceSource::IID { + return null_mut(); + } + + let mut count_or_pointer = self.0.load(Ordering::Relaxed); + + if is_weak_ref(count_or_pointer) { + return TearOff::from_encoding(count_or_pointer); + } + + let tear_off = TearOff::new(object, count_or_pointer as u32); + let tear_off_ptr: *mut c_void = transmute_copy(&tear_off); + let encoding: usize = ((tear_off_ptr as usize) >> 1) | (1 << (usize::BITS - 1)); + + loop { + match self.0.compare_exchange_weak( + count_or_pointer, + encoding as isize, + Ordering::AcqRel, + Ordering::Relaxed, + ) { + Ok(_) => { + let result: *mut c_void = transmute(tear_off); + TearOff::from_strong_ptr(result).strong_count.add_ref(); + return result; + } + Err(pointer) => count_or_pointer = pointer, + } + + if is_weak_ref(count_or_pointer) { + return TearOff::from_encoding(count_or_pointer); + } + + TearOff::from_strong_ptr(tear_off_ptr) + .strong_count + .0 + .store(count_or_pointer as i32, Ordering::SeqCst); + } + } + } +} + +fn is_weak_ref(value: isize) -> bool { + value < 0 +} + +#[repr(C)] +struct TearOff { + strong_vtable: *const IWeakReferenceSource_Vtbl, + weak_vtable: *const IWeakReference_Vtbl, + object: *mut c_void, + strong_count: RefCount, + weak_count: RefCount, +} + +impl TearOff { + #[expect(clippy::new_ret_no_self)] + unsafe fn new(object: *mut c_void, strong_count: u32) -> IWeakReferenceSource { + unsafe { + transmute(Box::new(Self { + strong_vtable: &Self::STRONG_VTABLE, + weak_vtable: &Self::WEAK_VTABLE, + object, + strong_count: RefCount::new(strong_count), + weak_count: RefCount::new(1), + })) + } + } + + unsafe fn from_encoding(encoding: isize) -> *mut c_void { + unsafe { + let tear_off = Self::decode(encoding); + tear_off.strong_count.add_ref(); + tear_off as *mut _ as *mut _ + } + } + + const STRONG_VTABLE: IWeakReferenceSource_Vtbl = IWeakReferenceSource_Vtbl { + base__: IUnknown_Vtbl { + QueryInterface: Self::StrongQueryInterface, + AddRef: Self::StrongAddRef, + Release: Self::StrongRelease, + }, + GetWeakReference: Self::StrongDowngrade, + }; + + const WEAK_VTABLE: IWeakReference_Vtbl = IWeakReference_Vtbl { + base__: IUnknown_Vtbl { + QueryInterface: Self::WeakQueryInterface, + AddRef: Self::WeakAddRef, + Release: Self::WeakRelease, + }, + Resolve: Self::WeakUpgrade, + }; + + unsafe fn from_strong_ptr<'a>(this: *mut c_void) -> &'a mut Self { + unsafe { &mut *(this as *mut *mut c_void as *mut Self) } + } + + unsafe fn from_weak_ptr<'a>(this: *mut c_void) -> &'a mut Self { + unsafe { &mut *((this as *mut *mut c_void).sub(1) as *mut Self) } + } + + unsafe fn decode<'a>(value: isize) -> &'a mut Self { + unsafe { &mut *((value << 1) as *mut Self) as &mut Self } + } + + unsafe fn query_interface(&self, iid: *const GUID, interface: *mut *mut c_void) -> HRESULT { + unsafe { + ((*(*(self.object as *mut *mut IUnknown_Vtbl))).QueryInterface)( + self.object, + iid, + interface, + ) + } + } + + unsafe extern "system" fn StrongQueryInterface( + ptr: *mut c_void, + iid: *const GUID, + interface: *mut *mut c_void, + ) -> HRESULT { + unsafe { + let this = Self::from_strong_ptr(ptr); + + if iid.is_null() || interface.is_null() { + return E_POINTER; + } + + // Only directly respond to queries for the the tear-off's strong interface. This is + // effectively a self-query. + if *iid == IWeakReferenceSource::IID { + *interface = ptr; + this.strong_count.add_ref(); + return HRESULT(0); + } + + // As the tear-off is sharing the identity of the object, simply delegate any remaining + // queries to the object. + this.query_interface(iid, interface) + } + } + + unsafe extern "system" fn WeakQueryInterface( + ptr: *mut c_void, + iid: *const GUID, + interface: *mut *mut c_void, + ) -> HRESULT { + unsafe { + let this = Self::from_weak_ptr(ptr); + + if iid.is_null() || interface.is_null() { + return E_POINTER; + } + + // While the weak vtable is packed into the same allocation as the strong vtable and + // tear-off, it represents a distinct COM identity and thus does not share or delegate to + // the object. + + *interface = if *iid == IWeakReference::IID + || *iid == IUnknown::IID + || *iid == IAgileObject::IID + { + ptr + } else { + #[cfg(windows)] + if *iid == IMarshal::IID { + this.weak_count.add_ref(); + return marshaler(transmute::<*mut c_void, IUnknown>(ptr), interface); + } + + null_mut() + }; + + if (*interface).is_null() { + E_NOINTERFACE + } else { + this.weak_count.add_ref(); + HRESULT(0) + } + } + } + + unsafe extern "system" fn StrongAddRef(ptr: *mut c_void) -> u32 { + unsafe { + let this = Self::from_strong_ptr(ptr); + + // Implement `AddRef` directly as we own the strong reference. + this.strong_count.add_ref() + } + } + + unsafe extern "system" fn WeakAddRef(ptr: *mut c_void) -> u32 { + unsafe { + let this = Self::from_weak_ptr(ptr); + + // Implement `AddRef` directly as we own the weak reference. + this.weak_count.add_ref() + } + } + + unsafe extern "system" fn StrongRelease(ptr: *mut c_void) -> u32 { + unsafe { + let this = Self::from_strong_ptr(ptr); + + // Forward strong `Release` to the object so that it can destroy itself. It will then + // decrement its weak reference and allow the tear-off to be released as needed. + ((*(*(this.object as *mut *mut IUnknown_Vtbl))).Release)(this.object) + } + } + + unsafe extern "system" fn WeakRelease(ptr: *mut c_void) -> u32 { + unsafe { + let this = Self::from_weak_ptr(ptr); + + // Implement `Release` directly as we own the weak reference. + let remaining = this.weak_count.release(); + + // If there are no remaining references, it means that the object has already been + // destroyed. Go ahead and destroy the tear-off. + if remaining == 0 { + let _ = Box::from_raw(this); + } + + remaining + } + } + + unsafe extern "system" fn StrongDowngrade( + ptr: *mut c_void, + interface: *mut *mut c_void, + ) -> HRESULT { + unsafe { + let this = Self::from_strong_ptr(ptr); + + // The strong vtable hands out a reference to the weak vtable. This is always safe and + // straightforward since a strong reference guarantees there is at least one weak + // reference. + *interface = &mut this.weak_vtable as *mut _ as _; + this.weak_count.add_ref(); + HRESULT(0) + } + } + + unsafe extern "system" fn WeakUpgrade( + ptr: *mut c_void, + iid: *const GUID, + interface: *mut *mut c_void, + ) -> HRESULT { + unsafe { + let this = Self::from_weak_ptr(ptr); + + this.strong_count + .0 + .fetch_update(Ordering::Acquire, Ordering::Relaxed, |count| { + // Attempt to acquire a strong reference count to stabilize the object for the duration + // of the `QueryInterface` call. + bool::then_some(count != 0, count + 1) + }) + .map(|_| { + // Let the object respond to the upgrade query. + let result = this.query_interface(iid, interface); + // Decrement the temporary reference account used to stabilize the object. + this.strong_count.0.fetch_sub(1, Ordering::Relaxed); + // Return the result of the query. + result + }) + .unwrap_or_else(|_| { + *interface = null_mut(); + HRESULT(0) + }) + } + } +} diff --git a/src-tauri/vendor/windows-core/src/imp/windows.rs b/src-tauri/vendor/windows-core/src/imp/windows.rs new file mode 100644 index 00000000..d9f44ad3 --- /dev/null +++ b/src-tauri/vendor/windows-core/src/imp/windows.rs @@ -0,0 +1,11 @@ +mod factory_cache; +pub use factory_cache::*; + +mod generic_factory; +pub use generic_factory::*; + +mod marshaler; +pub use marshaler::*; + +mod array_proxy; +pub use array_proxy::*; diff --git a/src-tauri/vendor/windows-core/src/inspectable.rs b/src-tauri/vendor/windows-core/src/inspectable.rs new file mode 100644 index 00000000..adca8a3c --- /dev/null +++ b/src-tauri/vendor/windows-core/src/inspectable.rs @@ -0,0 +1,123 @@ +use super::*; +use core::ffi::c_void; +use core::ptr::null_mut; + +/// Parent interface for all WinRT interfaces. +/// +/// A WinRT object that may be used as a polymorphic stand-in for any WinRT class, interface, or boxed value. +/// [`IInspectable`] represents the +/// [IInspectable](https://docs.microsoft.com/en-us/windows/win32/api/inspectable/nn-inspectable-iinspectable) +/// interface. +#[repr(transparent)] +#[derive(Clone, PartialEq, Eq, Debug)] +pub struct IInspectable(pub IUnknown); + +interface_hierarchy!(IInspectable, IUnknown); + +impl IInspectable { + /// Returns the canonical type name for the underlying object. + #[cfg(windows)] + pub fn GetRuntimeClassName(&self) -> Result { + unsafe { + let mut abi = null_mut(); + (self.vtable().GetRuntimeClassName)(core::mem::transmute_copy(self), &mut abi).ok()?; + Ok(core::mem::transmute::<*mut c_void, HSTRING>(abi)) + } + } + + /// Gets the trust level of the current object. + pub fn GetTrustLevel(&self) -> Result { + unsafe { + let mut value = 0; + (self.vtable().GetTrustLevel)(core::mem::transmute_copy(self), &mut value).ok()?; + Ok(value) + } + } +} + +#[doc(hidden)] +#[repr(C)] +pub struct IInspectable_Vtbl { + pub base: IUnknown_Vtbl, + pub GetIids: unsafe extern "system" fn( + this: *mut c_void, + count: *mut u32, + values: *mut *mut GUID, + ) -> HRESULT, + pub GetRuntimeClassName: + unsafe extern "system" fn(this: *mut c_void, value: *mut *mut c_void) -> HRESULT, + pub GetTrustLevel: unsafe extern "system" fn(this: *mut c_void, value: *mut i32) -> HRESULT, +} + +unsafe impl Interface for IInspectable { + type Vtable = IInspectable_Vtbl; + const IID: GUID = GUID::from_u128(0xaf86e2e0_b12d_4c6a_9c5a_d7aa65101e90); +} + +impl RuntimeType for IInspectable { + const SIGNATURE: imp::ConstBuffer = imp::ConstBuffer::from_slice(b"cinterface(IInspectable)"); +} + +impl RuntimeName for IInspectable {} + +impl IInspectable_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn GetIids( + _: *mut c_void, + count: *mut u32, + values: *mut *mut GUID, + ) -> HRESULT { + unsafe { + if count.is_null() || values.is_null() { + return imp::E_POINTER; + } + // Note: even if we end up implementing this in future, it still doesn't need a this pointer + // since the data to be returned is type- not instance-specific so can be shared for all + // interfaces. + *count = 0; + *values = null_mut(); + HRESULT(0) + } + } + unsafe extern "system" fn GetRuntimeClassName( + _: *mut c_void, + value: *mut *mut c_void, + ) -> HRESULT { + unsafe { + if value.is_null() { + return imp::E_POINTER; + } + + #[cfg(windows)] + { + *value = core::mem::transmute::(T::NAME.into()); + } + + #[cfg(not(windows))] + { + *value = core::ptr::null_mut(); + } + + HRESULT(0) + } + } + unsafe extern "system" fn GetTrustLevel( + this: *mut c_void, + value: *mut i32, + ) -> HRESULT { + unsafe { + if value.is_null() { + return imp::E_POINTER; + } + let this = (this as *mut *mut c_void).offset(OFFSET) as *mut T; + (*this).GetTrustLevel(value) + } + } + Self { + base: IUnknown_Vtbl::new::(), + GetIids, + GetRuntimeClassName: GetRuntimeClassName::, + GetTrustLevel: GetTrustLevel::, + } + } +} diff --git a/src-tauri/vendor/windows-core/src/interface.rs b/src-tauri/vendor/windows-core/src/interface.rs new file mode 100644 index 00000000..bea43735 --- /dev/null +++ b/src-tauri/vendor/windows-core/src/interface.rs @@ -0,0 +1,339 @@ +use super::*; +use core::any::Any; +use core::ffi::c_void; +use core::marker::PhantomData; +use core::mem::{forget, transmute_copy, MaybeUninit}; +use core::ptr::NonNull; + +/// Provides low-level access to an interface vtable. +/// +/// This trait is automatically implemented by the generated bindings and should not be +/// implemented manually. +/// +/// # Safety +pub unsafe trait Interface: Sized + Clone { + #[doc(hidden)] + type Vtable; + + /// The `GUID` associated with the interface. + const IID: GUID; + + #[doc(hidden)] + const UNKNOWN: bool = true; + + /// A reference to the interface's vtable + #[doc(hidden)] + #[inline(always)] + fn vtable(&self) -> &Self::Vtable { + // SAFETY: the implementor of the trait guarantees that `Self` is castable to its vtable + unsafe { self.assume_vtable::() } + } + + /// Cast this interface as a reference to the supplied interfaces `Vtable` + /// + /// # Safety + /// + /// This is safe if `T` is an equivalent interface to `Self` or a super interface. + /// In other words, `T::Vtable` must be equivalent to the beginning of `Self::Vtable`. + #[doc(hidden)] + #[inline(always)] + unsafe fn assume_vtable(&self) -> &T::Vtable { + unsafe { &**(self.as_raw() as *mut *mut T::Vtable) } + } + + /// Returns the raw COM interface pointer. The resulting pointer continues to be owned by the `Interface` implementation. + #[inline(always)] + fn as_raw(&self) -> *mut c_void { + // SAFETY: implementors of this trait must guarantee that the implementing type has a pointer in-memory representation + unsafe { transmute_copy(self) } + } + + /// Returns the raw COM interface pointer and releases ownership. It the caller's responsibility to release the COM interface pointer. + #[inline(always)] + fn into_raw(self) -> *mut c_void { + // SAFETY: implementors of this trait must guarantee that the implementing type has a pointer in-memory representation + let raw = self.as_raw(); + forget(self); + raw + } + + /// Creates an `Interface` by taking ownership of the `raw` COM interface pointer. + /// + /// # Safety + /// + /// The `raw` pointer must be owned by the caller and represent a valid COM interface pointer. In other words, + /// it must point to a vtable beginning with the `IUnknown` function pointers and match the vtable of `Interface`. + unsafe fn from_raw(raw: *mut c_void) -> Self { + unsafe { transmute_copy(&raw) } + } + + /// Creates an `Interface` that is valid so long as the `raw` COM interface pointer is valid. + /// + /// # Safety + /// + /// The `raw` pointer must be a valid COM interface pointer. In other words, it must point to a vtable + /// beginning with the `IUnknown` function pointers and match the vtable of `Interface`. + #[inline(always)] + unsafe fn from_raw_borrowed(raw: &*mut c_void) -> Option<&Self> { + unsafe { + if raw.is_null() { + None + } else { + Some(transmute_copy(&raw)) + } + } + } + + /// Attempts to cast the current interface to another interface using `QueryInterface`. + /// + /// The name `cast` is preferred to `query` because there is a WinRT method named query but not one + /// named cast. + #[inline(always)] + fn cast(&self) -> Result { + // SAFETY: `result` is valid for writing an interface pointer and it is safe + // to cast the `result` pointer as `T` on success because we are using the `IID` tied + // to `T` which the implementor of `Interface` has guaranteed is correct + unsafe { + // If query() returns a failure code then we propagate that failure code to the caller. + // In that case, we ignore the contents of 'result' (which will _not_ be dropped, + // because MaybeUninit intentionally does not drop its contents). + // + // This guards against implementations of COM interfaces which may store non-null values + // in 'result' but still return E_NOINTERFACE. + let mut result = MaybeUninit::>::zeroed(); + self.query(&T::IID, result.as_mut_ptr() as _).ok()?; + + // If we get here, then query() has succeeded, but we still need to double-check + // that the output pointer is non-null. + if let Some(obj) = result.assume_init() { + Ok(obj) + } else { + Err(imp::E_POINTER.into()) + } + } + } + + /// This casts the given COM interface to [`&dyn Any`]. + /// + /// Applications should generally _not_ call this method directly. Instead, use the + /// [`Interface::cast_object_ref`] or [`Interface::cast_object`] methods. + /// + /// `T` must be a type that has been annotated with `#[implement]`; this is checked at + /// compile-time by the generic constraints of this method. However, note that the + /// returned `&dyn Any` refers to the _outer_ implementation object that was generated by + /// `#[implement]`, i.e. the `MyApp_Impl` type, not the inner `MyApp` type. + /// + /// If the given object is not a Rust object, or is a Rust object but not `T`, or is a Rust + /// object that contains non-static lifetimes, then this function will return `Err(E_NOINTERFACE)`. + /// + /// # Safety + /// + /// **IMPORTANT!!** This uses a non-standard protocol for QueryInterface! The `DYNAMIC_CAST_IID` + /// IID identifies this protocol, but there is no `IDynamicCast` interface. Instead, objects + /// that recognize `DYNAMIC_CAST_IID` simply store their `&dyn Any` directly at the interface + /// pointer that was passed to `QueryInterface. This means that the returned value has a + /// size that is twice as large (`size_of::<&dyn Any>() == 2 * size_of::<*const c_void>()`). + /// + /// This means that callers that use this protocol cannot simply pass `&mut ptr` for + /// an ordinary single-pointer-sized pointer. Only this method understands this protocol. + /// + /// Another part of this protocol is that the implementation of `QueryInterface` _does not_ + /// AddRef the object. The caller must guarantee the liveness of the COM object. In Rust, + /// this means tying the lifetime of the IUnknown* that we used for the QueryInterface + /// call to the lifetime of the returned `&dyn Any` value. + /// + /// This method preserves type safety and relies on these invariants: + /// + /// * All `QueryInterface` implementations that recognize `DYNAMIC_CAST_IID` are generated by + /// the `#[implement]` macro and respect the rules described here. + #[inline(always)] + fn cast_to_any(&self) -> Result<&dyn Any> + where + T: ComObjectInner, + T::Outer: Any + 'static + IUnknownImpl, + { + unsafe { + let mut any_ref_arg: MaybeUninit<&dyn Any> = MaybeUninit::zeroed(); + self.query( + &DYNAMIC_CAST_IID, + any_ref_arg.as_mut_ptr() as *mut *mut c_void, + ) + .ok()?; + Ok(any_ref_arg.assume_init()) + } + } + + /// Returns `true` if the given COM interface refers to an implementation of `T`. + /// + /// `T` must be a type that has been annotated with `#[implement]`; this is checked at + /// compile-time by the generic constraints of this method. + /// + /// If the given object is not a Rust object, or is a Rust object but not `T`, or is a Rust + /// object that contains non-static lifetimes, then this function will return `false`. + #[inline(always)] + fn is_object(&self) -> bool + where + T: ComObjectInner, + T::Outer: Any + 'static + IUnknownImpl, + { + if let Ok(any) = self.cast_to_any::() { + any.is::() + } else { + false + } + } + + /// This casts the given COM interface to [`&dyn Any`]. It returns a reference to the "outer" + /// object, e.g. `&MyApp_Impl`, not the inner `&MyApp` object. + /// + /// `T` must be a type that has been annotated with `#[implement]`; this is checked at + /// compile-time by the generic constraints of this method. However, note that the + /// returned `&dyn Any` refers to the _outer_ implementation object that was generated by + /// `#[implement]`, i.e. the `MyApp_Impl` type, not the inner `MyApp` type. + /// + /// If the given object is not a Rust object, or is a Rust object but not `T`, or is a Rust + /// object that contains non-static lifetimes, then this function will return `Err(E_NOINTERFACE)`. + /// + /// The returned value is borrowed. If you need an owned (counted) reference, then use + /// [`Interface::cast_object`]. + #[inline(always)] + fn cast_object_ref(&self) -> Result<&T::Outer> + where + T: ComObjectInner, + T::Outer: Any + 'static + IUnknownImpl, + { + let any: &dyn Any = self.cast_to_any::()?; + if let Some(outer) = any.downcast_ref::() { + Ok(outer) + } else { + Err(imp::E_NOINTERFACE.into()) + } + } + + /// This casts the given COM interface to [`&dyn Any`]. It returns a reference to the "outer" + /// object, e.g. `MyApp_Impl`, not the inner `MyApp` object. + /// + /// `T` must be a type that has been annotated with `#[implement]`; this is checked at + /// compile-time by the generic constraints of this method. However, note that the + /// returned `&dyn Any` refers to the _outer_ implementation object that was generated by + /// `#[implement]`, i.e. the `MyApp_Impl` type, not the inner `MyApp` type. + /// + /// If the given object is not a Rust object, or is a Rust object but not `T`, or is a Rust + /// object that contains non-static lifetimes, then this function will return `Err(E_NOINTERFACE)`. + /// + /// The returned value is an owned (counted) reference; this function calls `AddRef` on the + /// underlying COM object. If you do not need an owned reference, then you can use the + /// [`Interface::cast_object_ref`] method instead, and avoid the cost of `AddRef` / `Release`. + #[inline(always)] + fn cast_object(&self) -> Result> + where + T: ComObjectInner, + T::Outer: Any + 'static + IUnknownImpl, + { + let object_ref = self.cast_object_ref::()?; + Ok(object_ref.to_object()) + } + + /// Attempts to create a [`Weak`] reference to this object. + fn downgrade(&self) -> Result> { + self.cast::() + .map(|source| Weak::downgrade(&source)) + } + + /// Call `QueryInterface` on this interface + /// + /// # Safety + /// + /// `interface` must be a non-null, valid pointer for writing an interface pointer. + #[inline(always)] + unsafe fn query(&self, iid: *const GUID, interface: *mut *mut c_void) -> HRESULT { + unsafe { + if Self::UNKNOWN { + (self.assume_vtable::().QueryInterface)(self.as_raw(), iid, interface) + } else { + panic!("Non-COM interfaces cannot be queried.") + } + } + } + + /// Creates an `InterfaceRef` for this reference. The `InterfaceRef` tracks lifetimes statically, + /// and eliminates the need for dynamic reference count adjustments (AddRef/Release). + fn to_ref(&self) -> InterfaceRef<'_, Self> { + InterfaceRef::from_interface(self) + } +} + +/// This has the same memory representation as `IFoo`, but represents a borrowed interface pointer. +/// +/// This type has no `Drop` impl; it does not AddRef/Release the given interface. However, because +/// it has a lifetime parameter, it always represents a non-null pointer to an interface. +#[repr(transparent)] +pub struct InterfaceRef<'a, I>(NonNull, PhantomData<&'a I>); + +impl Copy for InterfaceRef<'_, I> {} + +impl Clone for InterfaceRef<'_, I> { + fn clone(&self) -> Self { + *self + } +} + +impl core::fmt::Debug for InterfaceRef<'_, I> { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + ::fmt(&**self, f) + } +} + +impl InterfaceRef<'_, I> { + /// Creates an `InterfaceRef` from a raw pointer. _This is extremely dangerous, since there + /// is no lifetime tracking at all!_ + /// + /// # Safety + /// The caller must guarantee that the `'a` lifetime parameter is bound by context to a correct + /// lifetime. + #[inline(always)] + pub unsafe fn from_raw(ptr: NonNull) -> Self { + Self(ptr, PhantomData) + } + + /// Creates an `InterfaceRef` from an interface reference. This safely associates the lifetime + /// of the interface reference with the `'a` parameter of `InterfaceRef`. This allows for + /// lifetime checking _without_ calling AddRef/Release on the underlying lifetime, which can + /// improve efficiency. + #[inline(always)] + pub fn from_interface(interface: &I) -> Self { + unsafe { + // SAFETY: new_unchecked() should be valid because Interface::as_raw should always + // return a non-null pointer. + Self(NonNull::new_unchecked(interface.as_raw()), PhantomData) + } + } + + /// Calls AddRef on the underlying COM interface and returns an "owned" (counted) reference. + #[inline(always)] + pub fn to_owned(self) -> I { + (*self).clone() + } +} + +impl<'a, 'i: 'a, I: Interface> From<&'i I> for InterfaceRef<'a, I> { + #[inline(always)] + fn from(interface: &'a I) -> Self { + InterfaceRef::from_interface(interface) + } +} + +impl core::ops::Deref for InterfaceRef<'_, I> { + type Target = I; + + #[inline(always)] + fn deref(&self) -> &I { + unsafe { core::mem::transmute(self) } + } +} + +/// This IID identifies a special protocol, used by [`Interface::cast_to_any`]. This is _not_ +/// an ordinary COM interface; it uses special lifetime rules and a larger interface pointer. +/// See the comments on [`Interface::cast_to_any`]. +#[doc(hidden)] +pub const DYNAMIC_CAST_IID: GUID = GUID::from_u128(0xae49d5cb_143f_431c_874c_2729336e4eca); diff --git a/src-tauri/vendor/windows-core/src/lib.rs b/src-tauri/vendor/windows-core/src/lib.rs new file mode 100644 index 00000000..38257270 --- /dev/null +++ b/src-tauri/vendor/windows-core/src/lib.rs @@ -0,0 +1,61 @@ +#![doc = include_str!("../readme.md")] +#![doc(html_no_source)] +#![debugger_visualizer(natvis_file = "../windows-core.natvis")] +#![cfg_attr(all(not(feature = "std")), no_std)] +#![expect( + non_snake_case, + non_camel_case_types, + dead_code, + clippy::missing_transmute_annotations, + clippy::upper_case_acronyms +)] + +#[cfg(windows)] +include!("windows.rs"); + +extern crate self as windows_core; + +extern crate alloc; + +use alloc::boxed::Box; + +#[doc(hidden)] +pub mod imp; + +mod as_impl; +mod com_object; +mod guid; +mod inspectable; +mod interface; +mod out_param; +mod out_ref; +mod param; +mod param_value; +mod r#ref; +mod runtime_name; +mod runtime_type; +mod scoped_interface; +mod r#type; +mod unknown; +mod weak; + +pub use as_impl::*; +pub use com_object::*; +pub use guid::*; +pub use inspectable::*; +pub use interface::*; +pub use out_param::*; +pub use out_ref::*; +pub use param::*; +pub use param_value::*; +pub use r#ref::*; +pub use r#type::*; +pub use runtime_name::*; +pub use runtime_type::*; +pub use scoped_interface::*; +pub use unknown::*; +pub use weak::*; +pub use windows_implement::implement; +pub use windows_interface::interface; +pub use windows_link::link; +pub use windows_result::*; diff --git a/src-tauri/vendor/windows-core/src/out_param.rs b/src-tauri/vendor/windows-core/src/out_param.rs new file mode 100644 index 00000000..828746c1 --- /dev/null +++ b/src-tauri/vendor/windows-core/src/out_param.rs @@ -0,0 +1,63 @@ +use super::*; +use core::mem::{take, transmute_copy, zeroed}; + +/// Provides automatic parameter conversion in cases where the Windows API expects implicit conversion support. +/// +/// This is a mutable version of [Param] meant to support out parameters. +/// There is no need to implement this trait. Blanket implementations are provided for all applicable Windows types. +pub trait OutParam::TypeKind>: Sized +where + T: Type, +{ + #[doc(hidden)] + unsafe fn borrow_mut(&self) -> OutRef<'_, T>; +} + +impl OutParam for &mut T +where + T: TypeKind + Clone + Default, +{ + unsafe fn borrow_mut(&self) -> OutRef<'_, T> { + unsafe { + let this: &mut T = transmute_copy(self); + take(this); + transmute_copy(self) + } + } +} + +impl OutParam for &mut T +where + T: TypeKind + Clone + Default, +{ + unsafe fn borrow_mut(&self) -> OutRef<'_, T> { + unsafe { transmute_copy(self) } + } +} + +impl OutParam for &mut Option +where + T: TypeKind + Clone, +{ + unsafe fn borrow_mut(&self) -> OutRef<'_, T> { + unsafe { + let this: &mut Option = transmute_copy(self); + take(this); + transmute_copy(self) + } + } +} + +impl OutParam for Option<&mut T> +where + T: Type, +{ + unsafe fn borrow_mut(&self) -> OutRef<'_, T> { + unsafe { + match self { + Some(this) => transmute_copy(this), + None => zeroed(), + } + } + } +} diff --git a/src-tauri/vendor/windows-core/src/out_ref.rs b/src-tauri/vendor/windows-core/src/out_ref.rs new file mode 100644 index 00000000..eb4fd0ca --- /dev/null +++ b/src-tauri/vendor/windows-core/src/out_ref.rs @@ -0,0 +1,37 @@ +use super::*; + +/// A borrowed type with the same memory layout as the type itself that can be used to construct ABI-compatible function signatures. +/// +/// This is a mutable version of [Ref] meant to support out parameters. +#[repr(transparent)] +pub struct OutRef<'a, T: Type>(*mut T::Abi, core::marker::PhantomData<&'a T>); + +impl> OutRef<'_, T> { + /// Returns `true` if the argument is null. + pub fn is_null(&self) -> bool { + self.0.is_null() + } + + /// Overwrites a memory location with the given value without reading or dropping the old value. + pub fn write(self, value: T::Default) -> Result<()> { + if self.0.is_null() { + Err(Error::from_hresult(imp::E_POINTER)) + } else { + unsafe { *self.0 = core::mem::transmute_copy(&value) } + core::mem::forget(value); + Ok(()) + } + } +} + +impl<'a, T: Type> From<&'a mut T::Default> for OutRef<'a, T> { + fn from(from: &'a mut T::Default) -> Self { + unsafe { core::mem::transmute(from) } + } +} + +impl> Default for OutRef<'_, T> { + fn default() -> Self { + unsafe { core::mem::zeroed() } + } +} diff --git a/src-tauri/vendor/windows-core/src/param.rs b/src-tauri/vendor/windows-core/src/param.rs new file mode 100644 index 00000000..5ebf3add --- /dev/null +++ b/src-tauri/vendor/windows-core/src/param.rs @@ -0,0 +1,76 @@ +use super::*; +use core::mem::transmute_copy; +use core::mem::zeroed; + +/// Provides automatic parameter conversion in cases where the Windows API expects implicit conversion support. +/// +/// There is no need to implement this trait. Blanket implementations are provided for all applicable Windows types. +pub trait Param::TypeKind>: Sized +where + T: Type, +{ + #[doc(hidden)] + unsafe fn param(self) -> ParamValue; +} + +impl Param for Option<&T> +where + T: Type, +{ + unsafe fn param(self) -> ParamValue { + unsafe { + ParamValue::Borrowed(match self { + Some(item) => transmute_copy(item), + None => zeroed(), + }) + } + } +} + +impl Param for InterfaceRef<'_, T> +where + T: Type, +{ + unsafe fn param(self) -> ParamValue { + unsafe { ParamValue::Borrowed(transmute_copy(&self)) } + } +} + +impl Param for &U +where + T: TypeKind + Clone, + T: Interface, + U: Interface, + U: imp::CanInto, +{ + unsafe fn param(self) -> ParamValue { + unsafe { + if U::QUERY { + self.cast() + .map_or(ParamValue::Borrowed(zeroed()), |ok| ParamValue::Owned(ok)) + } else { + ParamValue::Borrowed(transmute_copy(self)) + } + } + } +} + +impl Param for &T +where + T: TypeKind + Clone, +{ + unsafe fn param(self) -> ParamValue { + unsafe { ParamValue::Borrowed(transmute_copy(self)) } + } +} + +impl Param for U +where + T: TypeKind + Clone, + U: TypeKind + Clone, + U: imp::CanInto, +{ + unsafe fn param(self) -> ParamValue { + unsafe { ParamValue::Owned(transmute_copy(&self)) } + } +} diff --git a/src-tauri/vendor/windows-core/src/param_value.rs b/src-tauri/vendor/windows-core/src/param_value.rs new file mode 100644 index 00000000..4500e261 --- /dev/null +++ b/src-tauri/vendor/windows-core/src/param_value.rs @@ -0,0 +1,24 @@ +use super::*; +use core::mem::transmute_copy; + +#[doc(hidden)] +pub enum ParamValue> { + Owned(T), + Borrowed(T::Abi), +} + +impl> ParamValue { + // TODO: replace with `borrow` in windows-bindgen + pub fn abi(&self) -> T::Abi { + unsafe { + match self { + Self::Owned(item) => transmute_copy(item), + Self::Borrowed(borrowed) => transmute_copy(borrowed), + } + } + } + + pub fn borrow(&self) -> Ref<'_, T> { + unsafe { transmute_copy(&self.abi()) } + } +} diff --git a/src-tauri/vendor/windows-core/src/ref.rs b/src-tauri/vendor/windows-core/src/ref.rs new file mode 100644 index 00000000..8f13e6ae --- /dev/null +++ b/src-tauri/vendor/windows-core/src/ref.rs @@ -0,0 +1,88 @@ +use super::*; +use core::mem::transmute; + +/// A borrowed type with the same memory layout as the type itself that can be used to construct ABI-compatible function signatures. +#[repr(transparent)] +pub struct Ref<'a, T: Type>(T::Abi, core::marker::PhantomData<&'a T>); + +impl> Ref<'_, T> { + /// Returns `true` if the argument is null. + pub fn is_null(&self) -> bool { + T::is_null(&self.0) + } + + /// Converts the argument to a [`Result<&T>`] reference. + pub fn ok(&self) -> Result<&T> { + self.as_ref() + .ok_or_else(|| Error::from_hresult(imp::E_POINTER)) + } + + /// Converts the argument to a [`Option<&T>`] reference. + pub fn as_ref(&self) -> Option<&T> { + if self.is_null() { + None + } else { + unsafe { Some(self.assume_init_ref()) } + } + } + + /// Converts the argument to a `&T` reference. + /// + /// # Panics + /// + /// Panics if the argument is null. + #[track_caller] + pub fn unwrap(&self) -> &T { + self.as_ref().expect("called `Ref::unwrap` on a null value") + } + + /// Converts the argument to an [`Option`] by cloning the reference. + pub fn cloned(&self) -> Option { + self.as_ref().cloned() + } + + unsafe fn assume_init_ref(&self) -> &T { + unsafe { T::assume_init_ref(&self.0) } + } +} + +impl> Default for Ref<'_, T> { + fn default() -> Self { + unsafe { core::mem::zeroed() } + } +} + +impl> core::ops::Deref for Ref<'_, T> { + type Target = T::Default; + fn deref(&self) -> &Self::Target { + unsafe { transmute(&self.0) } + } +} + +impl<'a, T: Type> From<&'a Option> for Ref<'a, T> +where + T: TypeKind, +{ + fn from(from: &'a Option) -> Self { + unsafe { core::mem::transmute_copy(from) } + } +} + +impl<'a, T: Type> From> for Ref<'a, T> +where + T: TypeKind, +{ + fn from(from: Option<&'a T>) -> Self { + if let Some(from) = from { + unsafe { core::mem::transmute_copy(from) } + } else { + unsafe { core::mem::zeroed() } + } + } +} + +impl<'a, T: Type> From<&'a T> for Ref<'a, T> { + fn from(from: &'a T) -> Self { + unsafe { core::mem::transmute_copy(from) } + } +} diff --git a/src-tauri/vendor/windows-core/src/runtime_name.rs b/src-tauri/vendor/windows-core/src/runtime_name.rs new file mode 100644 index 00000000..c6af26ae --- /dev/null +++ b/src-tauri/vendor/windows-core/src/runtime_name.rs @@ -0,0 +1,5 @@ +#[doc(hidden)] +pub trait RuntimeName { + // TODO: needs to use ConstBuffer like RuntimeType to allow generic interfaces to have names for GetRuntimeClassName + const NAME: &'static str = ""; +} diff --git a/src-tauri/vendor/windows-core/src/runtime_type.rs b/src-tauri/vendor/windows-core/src/runtime_type.rs new file mode 100644 index 00000000..f28ded85 --- /dev/null +++ b/src-tauri/vendor/windows-core/src/runtime_type.rs @@ -0,0 +1,30 @@ +use super::*; + +#[doc(hidden)] +pub trait RuntimeType: Type { + const SIGNATURE: imp::ConstBuffer; +} + +macro_rules! primitives { + ($(($t:ty, $s:literal)),+) => { + $( + impl RuntimeType for $t { + const SIGNATURE: imp::ConstBuffer = imp::ConstBuffer::from_slice($s); + } + )* + }; +} + +primitives! { + (bool, b"b1"), + (i8, b"i1"), + (u8, b"u1"), + (i16, b"i2"), + (u16, b"u2"), + (i32, b"i4"), + (u32, b"u4"), + (i64, b"i8"), + (u64, b"u8"), + (f32, b"f4"), + (f64, b"f8") +} diff --git a/src-tauri/vendor/windows-core/src/scoped_interface.rs b/src-tauri/vendor/windows-core/src/scoped_interface.rs new file mode 100644 index 00000000..5a701e8c --- /dev/null +++ b/src-tauri/vendor/windows-core/src/scoped_interface.rs @@ -0,0 +1,41 @@ +use super::*; +use core::ffi::c_void; +use core::marker::PhantomData; + +#[doc(hidden)] +#[repr(C)] +pub struct ScopedHeap { + pub vtable: *const c_void, + pub this: *const c_void, +} + +#[doc(hidden)] +pub struct ScopedInterface<'a, T: Interface> { + interface: T, + lifetime: PhantomData<&'a T>, +} + +impl ScopedInterface<'_, T> { + pub fn new(interface: T) -> Self { + Self { + interface, + lifetime: PhantomData, + } + } +} + +impl core::ops::Deref for ScopedInterface<'_, T> { + type Target = T; + + fn deref(&self) -> &T { + &self.interface + } +} + +impl Drop for ScopedInterface<'_, T> { + fn drop(&mut self) { + unsafe { + let _ = Box::from_raw(self.interface.as_raw() as *const _ as *mut ScopedHeap); + } + } +} diff --git a/src-tauri/vendor/windows-core/src/type.rs b/src-tauri/vendor/windows-core/src/type.rs new file mode 100644 index 00000000..a64f191d --- /dev/null +++ b/src-tauri/vendor/windows-core/src/type.rs @@ -0,0 +1,127 @@ +use super::*; + +#[doc(hidden)] +pub trait TypeKind { + type TypeKind; +} + +#[doc(hidden)] +pub struct InterfaceType; + +#[doc(hidden)] +pub struct CloneType; + +#[doc(hidden)] +pub struct CopyType; + +#[doc(hidden)] +pub trait Type::TypeKind>: TypeKind + Sized + Clone { + type Abi; + type Default; + + fn is_null(abi: &Self::Abi) -> bool; + unsafe fn assume_init_ref(abi: &Self::Abi) -> &Self; + unsafe fn from_abi(abi: Self::Abi) -> Result; + fn from_default(default: &Self::Default) -> Result; +} + +impl Type for T +where + T: TypeKind + Clone, +{ + type Abi = *mut core::ffi::c_void; + type Default = Option; + + fn is_null(abi: &Self::Abi) -> bool { + abi.is_null() + } + + unsafe fn assume_init_ref(abi: &Self::Abi) -> &Self { + unsafe { core::mem::transmute::<&*mut core::ffi::c_void, &T>(abi) } + } + + unsafe fn from_abi(abi: Self::Abi) -> Result { + unsafe { + if !abi.is_null() { + Ok(core::mem::transmute_copy(&abi)) + } else { + Err(Error::empty()) + } + } + } + + fn from_default(default: &Self::Default) -> Result { + default.as_ref().cloned().ok_or(Error::empty()) + } +} + +impl Type for T +where + T: TypeKind + Clone, +{ + type Abi = core::mem::MaybeUninit; + type Default = Self; + + fn is_null(_: &Self::Abi) -> bool { + false + } + + unsafe fn assume_init_ref(abi: &Self::Abi) -> &Self { + unsafe { abi.assume_init_ref() } + } + + unsafe fn from_abi(abi: Self::Abi) -> Result { + unsafe { Ok(abi.assume_init()) } + } + + fn from_default(default: &Self::Default) -> Result { + Ok(default.clone()) + } +} + +impl Type for T +where + T: TypeKind + Clone, +{ + type Abi = Self; + type Default = Self; + + fn is_null(_: &Self::Abi) -> bool { + false + } + + unsafe fn assume_init_ref(abi: &Self::Abi) -> &Self { + abi + } + + unsafe fn from_abi(abi: Self::Abi) -> Result { + Ok(abi) + } + + fn from_default(default: &Self) -> Result { + Ok(default.clone()) + } +} + +impl TypeKind for T { + type TypeKind = InterfaceType; +} + +impl TypeKind for *mut T { + type TypeKind = CopyType; +} + +macro_rules! primitives { + ($($t:ty),+) => { + $( + impl TypeKind for $t { + type TypeKind = CopyType; + } + )* + }; +} + +primitives!(bool, i8, u8, i16, u16, i32, u32, i64, u64, f32, f64, usize, isize); + +#[doc(hidden)] +pub type AbiType = >::Abi; diff --git a/src-tauri/vendor/windows-core/src/unknown.rs b/src-tauri/vendor/windows-core/src/unknown.rs new file mode 100644 index 00000000..4dc6aa71 --- /dev/null +++ b/src-tauri/vendor/windows-core/src/unknown.rs @@ -0,0 +1,186 @@ +use super::*; +use core::ffi::c_void; +use core::ptr::NonNull; + +/// Base interface for all COM interfaces. +/// +/// All COM interfaces (and thus WinRT classes and interfaces) implement +/// [IUnknown](https://docs.microsoft.com/en-us/windows/win32/api/unknwn/nn-unknwn-iunknown) +/// under the hood to provide reference-counted lifetime management as well as the ability +/// to query for additional interfaces that the object may implement. +#[repr(transparent)] +pub struct IUnknown(NonNull); + +#[doc(hidden)] +#[repr(C)] +pub struct IUnknown_Vtbl { + pub QueryInterface: unsafe extern "system" fn( + this: *mut c_void, + iid: *const GUID, + interface: *mut *mut c_void, + ) -> HRESULT, + pub AddRef: unsafe extern "system" fn(this: *mut c_void) -> u32, + pub Release: unsafe extern "system" fn(this: *mut c_void) -> u32, +} + +unsafe impl Interface for IUnknown { + type Vtable = IUnknown_Vtbl; + const IID: GUID = GUID::from_u128(0x00000000_0000_0000_c000_000000000046); +} + +impl Clone for IUnknown { + fn clone(&self) -> Self { + unsafe { + (self.vtable().AddRef)(core::mem::transmute_copy(self)); + } + + Self(self.0) + } +} + +impl Drop for IUnknown { + fn drop(&mut self) { + unsafe { + (self.vtable().Release)(core::mem::transmute_copy(self)); + } + } +} + +impl PartialEq for IUnknown { + fn eq(&self, other: &Self) -> bool { + // First we test for ordinary pointer equality. If two COM interface pointers have the + // same pointer value, then they are the same object. This can save us a lot of time, + // since calling QueryInterface is much more expensive than a single pointer comparison. + // + // However, interface pointers may have different values and yet point to the same object. + // Since COM objects may implement multiple interfaces, COM identity can only + // be determined by querying for `IUnknown` explicitly and then comparing the + // pointer values. This works since `QueryInterface` is required to return + // the same pointer value for queries for `IUnknown`. + core::ptr::eq(self.as_raw(), other.as_raw()) + || self.cast::().unwrap().0 == other.cast::().unwrap().0 + } +} + +impl Eq for IUnknown {} + +impl core::fmt::Debug for IUnknown { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_tuple("IUnknown").field(&self.as_raw()).finish() + } +} + +/// The `#[implement]` macro generates implementations of this trait for the types +/// that it generates, e.g. `MyApp_Impl`, +/// +/// `ComObject` uses this trait to interact with boxed COM objects. +#[doc(hidden)] +pub trait IUnknownImpl { + /// The contained user type, e.g. `MyApp`. Also known as the "inner" type. + type Impl; + + /// Get a reference to the backing implementation. + fn get_impl(&self) -> &Self::Impl; + + /// Get a mutable reference to the contained (inner) object. + fn get_impl_mut(&mut self) -> &mut Self::Impl; + + /// Consumes the box and returns the contained (inner) object. This is the opposite of `new_box`. + fn into_inner(self) -> Self::Impl; + + /// The classic `QueryInterface` method from COM. + /// + /// # Safety + /// + /// This function is safe to call as long as the interface pointer is non-null and valid for writes + /// of an interface pointer. + unsafe fn QueryInterface(&self, iid: *const GUID, interface: *mut *mut c_void) -> HRESULT; + + /// Increments the reference count of the interface + fn AddRef(&self) -> u32; + + /// Decrements the reference count causing the interface's memory to be freed when the count is 0 + /// + /// # Safety + /// + /// This function should only be called when the interface pointer is no longer used as calling `Release` + /// on a non-aliased interface pointer and then using that interface pointer may result in use after free. + /// + /// This function takes `*mut Self` because the object may be freed by the time this method returns. + /// Taking `&self` would violate Rust's rules on reference lifetime. + unsafe fn Release(self_: *mut Self) -> u32; + + /// Returns `true` if the reference count of the box is equal to 1. + fn is_reference_count_one(&self) -> bool; + + /// Gets the trust level of the current object. + unsafe fn GetTrustLevel(&self, value: *mut i32) -> HRESULT; + + /// Gets a borrowed reference to an interface that is implemented by this ComObject. + /// + /// The returned reference does not have an additional reference count. + /// You can AddRef it by calling to_owned(). + #[inline(always)] + fn as_interface(&self) -> InterfaceRef<'_, I> + where + Self: ComObjectInterface, + { + >::as_interface_ref(self) + } + + /// Gets an owned (counted) reference to an interface that is implemented by this ComObject. + #[inline(always)] + fn to_interface(&self) -> I + where + Self: ComObjectInterface, + { + >::as_interface_ref(self).to_owned() + } + + /// Creates a new owned reference to this object. + /// + /// # Safety + /// + /// This function can only be safely called by `_Impl` objects that are embedded in a + /// `ComObject`. Since we only allow safe Rust code to access these objects using a `ComObject` + /// or a `&_Impl` that points within a `ComObject`, this is safe. + fn to_object(&self) -> ComObject + where + Self::Impl: ComObjectInner; +} + +impl IUnknown_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn QueryInterface( + this: *mut c_void, + iid: *const GUID, + interface: *mut *mut c_void, + ) -> HRESULT { + unsafe { + let this = (this as *mut *mut c_void).offset(OFFSET) as *mut T; + (*this).QueryInterface(iid, interface) + } + } + unsafe extern "system" fn AddRef( + this: *mut c_void, + ) -> u32 { + unsafe { + let this = (this as *mut *mut c_void).offset(OFFSET) as *mut T; + (*this).AddRef() + } + } + unsafe extern "system" fn Release( + this: *mut c_void, + ) -> u32 { + unsafe { + let this = (this as *mut *mut c_void).offset(OFFSET) as *mut T; + T::Release(this) + } + } + Self { + QueryInterface: QueryInterface::, + AddRef: AddRef::, + Release: Release::, + } + } +} diff --git a/src-tauri/vendor/windows-core/src/weak.rs b/src-tauri/vendor/windows-core/src/weak.rs new file mode 100644 index 00000000..b110ffbb --- /dev/null +++ b/src-tauri/vendor/windows-core/src/weak.rs @@ -0,0 +1,28 @@ +use super::*; +use core::marker::PhantomData; + +/// `Weak` holds a non-owning reference to an object. +#[derive(Clone, PartialEq, Eq, Default)] +pub struct Weak(Option, PhantomData); + +impl Weak { + /// Creates a new `Weak` object without any backing object. + pub const fn new() -> Self { + Self(None, PhantomData) + } + + /// Attempts to upgrade the weak reference to a strong reference. + pub fn upgrade(&self) -> Option { + self.0 + .as_ref() + .and_then(|inner| unsafe { inner.Resolve().ok() }) + } + + pub(crate) fn downgrade(source: &imp::IWeakReferenceSource) -> Self { + let reference = unsafe { source.GetWeakReference().ok() }; + Self(reference, PhantomData) + } +} + +unsafe impl Send for Weak {} +unsafe impl Sync for Weak {} diff --git a/src-tauri/vendor/windows-core/src/windows.rs b/src-tauri/vendor/windows-core/src/windows.rs new file mode 100644 index 00000000..6f055bbc --- /dev/null +++ b/src-tauri/vendor/windows-core/src/windows.rs @@ -0,0 +1,73 @@ +mod agile_reference; +pub use agile_reference::*; + +mod array; +pub use array::*; + +#[cfg(feature = "std")] +mod event; +#[cfg(feature = "std")] +pub use event::*; + +mod handles; +pub use handles::*; + +pub use windows_strings::*; + +/// Attempts to load the factory object for the given WinRT class. +/// This can be used to access COM interfaces implemented on a Windows Runtime class factory. +pub fn factory() -> Result { + imp::load_factory::() +} + +impl Param for &BSTR { + unsafe fn param(self) -> ParamValue { + ParamValue::Owned(PCWSTR(self.as_ptr())) + } +} + +impl Param for &HSTRING { + unsafe fn param(self) -> ParamValue { + ParamValue::Owned(PCWSTR(self.as_ptr())) + } +} + +impl Param for PWSTR { + unsafe fn param(self) -> ParamValue { + ParamValue::Owned(PCWSTR(self.0)) + } +} + +impl Param for PSTR { + unsafe fn param(self) -> ParamValue { + ParamValue::Owned(PCSTR(self.0)) + } +} + +impl RuntimeType for HSTRING { + const SIGNATURE: imp::ConstBuffer = imp::ConstBuffer::from_slice(b"string"); +} + +impl TypeKind for PWSTR { + type TypeKind = CopyType; +} + +impl TypeKind for PSTR { + type TypeKind = CopyType; +} + +impl TypeKind for PCWSTR { + type TypeKind = CopyType; +} + +impl TypeKind for PCSTR { + type TypeKind = CopyType; +} + +impl TypeKind for HSTRING { + type TypeKind = CloneType; +} + +impl TypeKind for BSTR { + type TypeKind = CloneType; +} diff --git a/src-tauri/vendor/windows-core/windows-core.natvis b/src-tauri/vendor/windows-core/windows-core.natvis new file mode 100644 index 00000000..192804a5 --- /dev/null +++ b/src-tauri/vendor/windows-core/windows-core.natvis @@ -0,0 +1,18 @@ + + + + {{ len={len} }} + + + len + + len + data + + + + + + {__0} + +