///
/// HybridNitroAccessibilityModuleSpecCxx.swift
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © 2024 Marc Rousavy @ Margelo
///

import Foundation
import NitroModules

/**
 * Helper class for converting instances of `HybridNitroAccessibilityModuleSpecCxx` from- and to unsafe pointers.
 * This is useful to pass Swift classes to C++, without having to strongly type the C++ function signature.
 * The actual Swift type can be included in the .cpp file, without having to forward-declare anything in .hpp.
 */
public final class HybridNitroAccessibilityModuleSpecCxxUnsafe {
  /**
   * Casts a `HybridNitroAccessibilityModuleSpecCxx` instance to a retained unsafe raw pointer.
   * This acquires one additional strong reference on the object!
   */
  public static func toUnsafe(_ instance: HybridNitroAccessibilityModuleSpecCxx) -> UnsafeMutableRawPointer {
    return Unmanaged.passRetained(instance).toOpaque()
  }

  /**
   * Casts an unsafe pointer to a `HybridNitroAccessibilityModuleSpecCxx`.
   * The pointer has to be a retained opaque `Unmanaged<HybridNitroAccessibilityModuleSpecCxx>`.
   * This removes one strong reference from the object!
   */
  public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> HybridNitroAccessibilityModuleSpecCxx {
    return Unmanaged<HybridNitroAccessibilityModuleSpecCxx>.fromOpaque(pointer).takeRetainedValue()
  }
}

/**
 * A class implementation that bridges HybridNitroAccessibilityModuleSpec over to C++.
 * In C++, we cannot use Swift protocols - so we need to wrap it in a class to make it strongly defined.
 *
 * Also, some Swift types need to be bridged with special handling:
 * - Enums need to be wrapped in Structs, otherwise they cannot be accessed bi-directionally (Swift bug: https://github.com/swiftlang/swift/issues/75330)
 * - Other HybridObjects need to be wrapped/unwrapped from the Swift TCxx wrapper
 * - Throwing methods need to be wrapped with a Result<T, Error> type, as exceptions cannot be propagated to C++
 */
public class HybridNitroAccessibilityModuleSpecCxx {
  /**
   * The Swift <> C++ bridge's namespace (`margelo::nitro::stylesheet::bridge::swift`)
   * from `NitroStyleSheet-Swift-Cxx-Bridge.hpp`.
   * This contains specialized C++ templates, and C++ helper functions that can be accessed from Swift.
   */
  public typealias bridge = margelo.nitro.stylesheet.bridge.swift

  /**
   * Holds an instance of the `HybridNitroAccessibilityModuleSpec` Swift protocol.
   */
  private var __implementation: any HybridNitroAccessibilityModuleSpec

  /**
   * Create a new `HybridNitroAccessibilityModuleSpecCxx` that wraps the given `HybridNitroAccessibilityModuleSpec`.
   * All properties and methods bridge to C++ types.
   */
  public init(_ implementation: some HybridNitroAccessibilityModuleSpec) {
    self.__implementation = implementation
    /* no base class */
  }

  /**
   * Get the actual `HybridNitroAccessibilityModuleSpec` instance this class wraps.
   */
  @inline(__always)
  public func getHybridNitroAccessibilityModuleSpec() -> any HybridNitroAccessibilityModuleSpec {
    return __implementation
  }

  /**
   * Contains a (weak) reference to the C++ HybridObject to cache it.
   */
  public var hybridContext: margelo.nitro.HybridContext {
    @inline(__always)
    get {
      return self.__implementation.hybridContext
    }
    @inline(__always)
    set {
      self.__implementation.hybridContext = newValue
    }
  }

  /**
   * Get the memory size of the Swift class (plus size of any other allocations)
   * so the JS VM can properly track it and garbage-collect the JS object if needed.
   */
  @inline(__always)
  public var memorySize: Int {
    return self.__implementation.memorySize
  }

  // Properties
  

  // Methods
  @inline(__always)
  public func removeListeners() -> Void {
    do {
      try self.__implementation.removeListeners()
      return 
    } catch {
      let __message = "\(error.localizedDescription)"
      fatalError("Swift errors can currently not be propagated to C++! See https://github.com/swiftlang/swift/issues/75290 (Error: \(__message))")
    }
  }
  
  @inline(__always)
  public func getAllSettings() -> AccessibilitySettings {
    do {
      let __result = try self.__implementation.getAllSettings()
      return __result
    } catch {
      let __message = "\(error.localizedDescription)"
      fatalError("Swift errors can currently not be propagated to C++! See https://github.com/swiftlang/swift/issues/75290 (Error: \(__message))")
    }
  }
  
  @inline(__always)
  public func getIsReduceMotionEnabled() -> bridge.std__optional_bool_ {
    do {
      let __result = try self.__implementation.getIsReduceMotionEnabled()
      return { () -> bridge.std__optional_bool_ in
        if let __unwrappedValue = __result {
          return bridge.create_std__optional_bool_(__unwrappedValue)
        } else {
          return .init()
        }
      }()
    } catch {
      let __message = "\(error.localizedDescription)"
      fatalError("Swift errors can currently not be propagated to C++! See https://github.com/swiftlang/swift/issues/75290 (Error: \(__message))")
    }
  }
  
  @inline(__always)
  public func addReduceMotionListener(onChanged: bridge.Func_void_std__optional_bool_) -> Void {
    do {
      try self.__implementation.addReduceMotionListener(onChanged: { () -> ((Bool?) -> Void) in
        let __sharedClosure = bridge.share_Func_void_std__optional_bool_(onChanged)
        return { (__isEnabled: Bool?) -> Void in
          __sharedClosure.pointee.call({ () -> bridge.std__optional_bool_ in
          if let __unwrappedValue = __isEnabled {
            return bridge.create_std__optional_bool_(__unwrappedValue)
          } else {
            return .init()
          }
        }())
        }
      }())
      return 
    } catch {
      let __message = "\(error.localizedDescription)"
      fatalError("Swift errors can currently not be propagated to C++! See https://github.com/swiftlang/swift/issues/75290 (Error: \(__message))")
    }
  }
  
  @inline(__always)
  public func getIsReduceTransparencyEnabled() -> bridge.std__optional_bool_ {
    do {
      let __result = try self.__implementation.getIsReduceTransparencyEnabled()
      return { () -> bridge.std__optional_bool_ in
        if let __unwrappedValue = __result {
          return bridge.create_std__optional_bool_(__unwrappedValue)
        } else {
          return .init()
        }
      }()
    } catch {
      let __message = "\(error.localizedDescription)"
      fatalError("Swift errors can currently not be propagated to C++! See https://github.com/swiftlang/swift/issues/75290 (Error: \(__message))")
    }
  }
  
  @inline(__always)
  public func addReduceTransparencyListener(onChanged: bridge.Func_void_std__optional_bool_) -> Void {
    do {
      try self.__implementation.addReduceTransparencyListener(onChanged: { () -> ((Bool?) -> Void) in
        let __sharedClosure = bridge.share_Func_void_std__optional_bool_(onChanged)
        return { (__isEnabled: Bool?) -> Void in
          __sharedClosure.pointee.call({ () -> bridge.std__optional_bool_ in
          if let __unwrappedValue = __isEnabled {
            return bridge.create_std__optional_bool_(__unwrappedValue)
          } else {
            return .init()
          }
        }())
        }
      }())
      return 
    } catch {
      let __message = "\(error.localizedDescription)"
      fatalError("Swift errors can currently not be propagated to C++! See https://github.com/swiftlang/swift/issues/75290 (Error: \(__message))")
    }
  }
  
  @inline(__always)
  public func getIsDifferentiateWithoutColorEnabled() -> bridge.std__optional_bool_ {
    do {
      let __result = try self.__implementation.getIsDifferentiateWithoutColorEnabled()
      return { () -> bridge.std__optional_bool_ in
        if let __unwrappedValue = __result {
          return bridge.create_std__optional_bool_(__unwrappedValue)
        } else {
          return .init()
        }
      }()
    } catch {
      let __message = "\(error.localizedDescription)"
      fatalError("Swift errors can currently not be propagated to C++! See https://github.com/swiftlang/swift/issues/75290 (Error: \(__message))")
    }
  }
  
  @inline(__always)
  public func addDifferentiateWithoutColorListener(onChanged: bridge.Func_void_std__optional_bool_) -> Void {
    do {
      try self.__implementation.addDifferentiateWithoutColorListener(onChanged: { () -> ((Bool?) -> Void) in
        let __sharedClosure = bridge.share_Func_void_std__optional_bool_(onChanged)
        return { (__isEnabled: Bool?) -> Void in
          __sharedClosure.pointee.call({ () -> bridge.std__optional_bool_ in
          if let __unwrappedValue = __isEnabled {
            return bridge.create_std__optional_bool_(__unwrappedValue)
          } else {
            return .init()
          }
        }())
        }
      }())
      return 
    } catch {
      let __message = "\(error.localizedDescription)"
      fatalError("Swift errors can currently not be propagated to C++! See https://github.com/swiftlang/swift/issues/75290 (Error: \(__message))")
    }
  }
  
  @inline(__always)
  public func getIsInvertColorsEnabled() -> bridge.std__optional_bool_ {
    do {
      let __result = try self.__implementation.getIsInvertColorsEnabled()
      return { () -> bridge.std__optional_bool_ in
        if let __unwrappedValue = __result {
          return bridge.create_std__optional_bool_(__unwrappedValue)
        } else {
          return .init()
        }
      }()
    } catch {
      let __message = "\(error.localizedDescription)"
      fatalError("Swift errors can currently not be propagated to C++! See https://github.com/swiftlang/swift/issues/75290 (Error: \(__message))")
    }
  }
  
  @inline(__always)
  public func addInvertColorsListener(onChanged: bridge.Func_void_std__optional_bool_) -> Void {
    do {
      try self.__implementation.addInvertColorsListener(onChanged: { () -> ((Bool?) -> Void) in
        let __sharedClosure = bridge.share_Func_void_std__optional_bool_(onChanged)
        return { (__isEnabled: Bool?) -> Void in
          __sharedClosure.pointee.call({ () -> bridge.std__optional_bool_ in
          if let __unwrappedValue = __isEnabled {
            return bridge.create_std__optional_bool_(__unwrappedValue)
          } else {
            return .init()
          }
        }())
        }
      }())
      return 
    } catch {
      let __message = "\(error.localizedDescription)"
      fatalError("Swift errors can currently not be propagated to C++! See https://github.com/swiftlang/swift/issues/75290 (Error: \(__message))")
    }
  }
  
  @inline(__always)
  public func getIsShowButtonShapesEnabled() -> bridge.std__optional_bool_ {
    do {
      let __result = try self.__implementation.getIsShowButtonShapesEnabled()
      return { () -> bridge.std__optional_bool_ in
        if let __unwrappedValue = __result {
          return bridge.create_std__optional_bool_(__unwrappedValue)
        } else {
          return .init()
        }
      }()
    } catch {
      let __message = "\(error.localizedDescription)"
      fatalError("Swift errors can currently not be propagated to C++! See https://github.com/swiftlang/swift/issues/75290 (Error: \(__message))")
    }
  }
  
  @inline(__always)
  public func addShowButtonShapesListener(onChanged: bridge.Func_void_std__optional_bool_) -> Void {
    do {
      try self.__implementation.addShowButtonShapesListener(onChanged: { () -> ((Bool?) -> Void) in
        let __sharedClosure = bridge.share_Func_void_std__optional_bool_(onChanged)
        return { (__isEnabled: Bool?) -> Void in
          __sharedClosure.pointee.call({ () -> bridge.std__optional_bool_ in
          if let __unwrappedValue = __isEnabled {
            return bridge.create_std__optional_bool_(__unwrappedValue)
          } else {
            return .init()
          }
        }())
        }
      }())
      return 
    } catch {
      let __message = "\(error.localizedDescription)"
      fatalError("Swift errors can currently not be propagated to C++! See https://github.com/swiftlang/swift/issues/75290 (Error: \(__message))")
    }
  }
  
  @inline(__always)
  public func getIsBoldTextEnabled() -> bridge.std__optional_bool_ {
    do {
      let __result = try self.__implementation.getIsBoldTextEnabled()
      return { () -> bridge.std__optional_bool_ in
        if let __unwrappedValue = __result {
          return bridge.create_std__optional_bool_(__unwrappedValue)
        } else {
          return .init()
        }
      }()
    } catch {
      let __message = "\(error.localizedDescription)"
      fatalError("Swift errors can currently not be propagated to C++! See https://github.com/swiftlang/swift/issues/75290 (Error: \(__message))")
    }
  }
  
  @inline(__always)
  public func addBoldTextListener(onChanged: bridge.Func_void_std__optional_bool_) -> Void {
    do {
      try self.__implementation.addBoldTextListener(onChanged: { () -> ((Bool?) -> Void) in
        let __sharedClosure = bridge.share_Func_void_std__optional_bool_(onChanged)
        return { (__isEnabled: Bool?) -> Void in
          __sharedClosure.pointee.call({ () -> bridge.std__optional_bool_ in
          if let __unwrappedValue = __isEnabled {
            return bridge.create_std__optional_bool_(__unwrappedValue)
          } else {
            return .init()
          }
        }())
        }
      }())
      return 
    } catch {
      let __message = "\(error.localizedDescription)"
      fatalError("Swift errors can currently not be propagated to C++! See https://github.com/swiftlang/swift/issues/75290 (Error: \(__message))")
    }
  }
  
  @inline(__always)
  public func getIsVoiceOverEnabled() -> bridge.std__optional_bool_ {
    do {
      let __result = try self.__implementation.getIsVoiceOverEnabled()
      return { () -> bridge.std__optional_bool_ in
        if let __unwrappedValue = __result {
          return bridge.create_std__optional_bool_(__unwrappedValue)
        } else {
          return .init()
        }
      }()
    } catch {
      let __message = "\(error.localizedDescription)"
      fatalError("Swift errors can currently not be propagated to C++! See https://github.com/swiftlang/swift/issues/75290 (Error: \(__message))")
    }
  }
  
  @inline(__always)
  public func addVoiceOverListener(onChanged: bridge.Func_void_std__optional_bool_) -> Void {
    do {
      try self.__implementation.addVoiceOverListener(onChanged: { () -> ((Bool?) -> Void) in
        let __sharedClosure = bridge.share_Func_void_std__optional_bool_(onChanged)
        return { (__isEnabled: Bool?) -> Void in
          __sharedClosure.pointee.call({ () -> bridge.std__optional_bool_ in
          if let __unwrappedValue = __isEnabled {
            return bridge.create_std__optional_bool_(__unwrappedValue)
          } else {
            return .init()
          }
        }())
        }
      }())
      return 
    } catch {
      let __message = "\(error.localizedDescription)"
      fatalError("Swift errors can currently not be propagated to C++! See https://github.com/swiftlang/swift/issues/75290 (Error: \(__message))")
    }
  }
  
  @inline(__always)
  public func getIsSwitchControlEnabled() -> bridge.std__optional_bool_ {
    do {
      let __result = try self.__implementation.getIsSwitchControlEnabled()
      return { () -> bridge.std__optional_bool_ in
        if let __unwrappedValue = __result {
          return bridge.create_std__optional_bool_(__unwrappedValue)
        } else {
          return .init()
        }
      }()
    } catch {
      let __message = "\(error.localizedDescription)"
      fatalError("Swift errors can currently not be propagated to C++! See https://github.com/swiftlang/swift/issues/75290 (Error: \(__message))")
    }
  }
  
  @inline(__always)
  public func addSwitchControlListener(onChanged: bridge.Func_void_std__optional_bool_) -> Void {
    do {
      try self.__implementation.addSwitchControlListener(onChanged: { () -> ((Bool?) -> Void) in
        let __sharedClosure = bridge.share_Func_void_std__optional_bool_(onChanged)
        return { (__isEnabled: Bool?) -> Void in
          __sharedClosure.pointee.call({ () -> bridge.std__optional_bool_ in
          if let __unwrappedValue = __isEnabled {
            return bridge.create_std__optional_bool_(__unwrappedValue)
          } else {
            return .init()
          }
        }())
        }
      }())
      return 
    } catch {
      let __message = "\(error.localizedDescription)"
      fatalError("Swift errors can currently not be propagated to C++! See https://github.com/swiftlang/swift/issues/75290 (Error: \(__message))")
    }
  }
  
  @inline(__always)
  public func getIsVideoAutoplayEnabled() -> bridge.std__optional_bool_ {
    do {
      let __result = try self.__implementation.getIsVideoAutoplayEnabled()
      return { () -> bridge.std__optional_bool_ in
        if let __unwrappedValue = __result {
          return bridge.create_std__optional_bool_(__unwrappedValue)
        } else {
          return .init()
        }
      }()
    } catch {
      let __message = "\(error.localizedDescription)"
      fatalError("Swift errors can currently not be propagated to C++! See https://github.com/swiftlang/swift/issues/75290 (Error: \(__message))")
    }
  }
  
  @inline(__always)
  public func addVideoAutoplayListener(onChanged: bridge.Func_void_std__optional_bool_) -> Void {
    do {
      try self.__implementation.addVideoAutoplayListener(onChanged: { () -> ((Bool?) -> Void) in
        let __sharedClosure = bridge.share_Func_void_std__optional_bool_(onChanged)
        return { (__isEnabled: Bool?) -> Void in
          __sharedClosure.pointee.call({ () -> bridge.std__optional_bool_ in
          if let __unwrappedValue = __isEnabled {
            return bridge.create_std__optional_bool_(__unwrappedValue)
          } else {
            return .init()
          }
        }())
        }
      }())
      return 
    } catch {
      let __message = "\(error.localizedDescription)"
      fatalError("Swift errors can currently not be propagated to C++! See https://github.com/swiftlang/swift/issues/75290 (Error: \(__message))")
    }
  }
  
  @inline(__always)
  public func getIsClosedCaptioningEnabled() -> bridge.std__optional_bool_ {
    do {
      let __result = try self.__implementation.getIsClosedCaptioningEnabled()
      return { () -> bridge.std__optional_bool_ in
        if let __unwrappedValue = __result {
          return bridge.create_std__optional_bool_(__unwrappedValue)
        } else {
          return .init()
        }
      }()
    } catch {
      let __message = "\(error.localizedDescription)"
      fatalError("Swift errors can currently not be propagated to C++! See https://github.com/swiftlang/swift/issues/75290 (Error: \(__message))")
    }
  }
  
  @inline(__always)
  public func addClosedCaptioningListener(onChanged: bridge.Func_void_std__optional_bool_) -> Void {
    do {
      try self.__implementation.addClosedCaptioningListener(onChanged: { () -> ((Bool?) -> Void) in
        let __sharedClosure = bridge.share_Func_void_std__optional_bool_(onChanged)
        return { (__isEnabled: Bool?) -> Void in
          __sharedClosure.pointee.call({ () -> bridge.std__optional_bool_ in
          if let __unwrappedValue = __isEnabled {
            return bridge.create_std__optional_bool_(__unwrappedValue)
          } else {
            return .init()
          }
        }())
        }
      }())
      return 
    } catch {
      let __message = "\(error.localizedDescription)"
      fatalError("Swift errors can currently not be propagated to C++! See https://github.com/swiftlang/swift/issues/75290 (Error: \(__message))")
    }
  }
  
  @inline(__always)
  public func getPrefersCrossFadeTransitionsEnabled() -> bridge.std__optional_bool_ {
    do {
      let __result = try self.__implementation.getPrefersCrossFadeTransitionsEnabled()
      return { () -> bridge.std__optional_bool_ in
        if let __unwrappedValue = __result {
          return bridge.create_std__optional_bool_(__unwrappedValue)
        } else {
          return .init()
        }
      }()
    } catch {
      let __message = "\(error.localizedDescription)"
      fatalError("Swift errors can currently not be propagated to C++! See https://github.com/swiftlang/swift/issues/75290 (Error: \(__message))")
    }
  }
  
  @inline(__always)
  public func addPrefersCrossFadeTransitionsListener(onChanged: bridge.Func_void_std__optional_bool_) -> Void {
    do {
      try self.__implementation.addPrefersCrossFadeTransitionsListener(onChanged: { () -> ((Bool?) -> Void) in
        let __sharedClosure = bridge.share_Func_void_std__optional_bool_(onChanged)
        return { (__isEnabled: Bool?) -> Void in
          __sharedClosure.pointee.call({ () -> bridge.std__optional_bool_ in
          if let __unwrappedValue = __isEnabled {
            return bridge.create_std__optional_bool_(__unwrappedValue)
          } else {
            return .init()
          }
        }())
        }
      }())
      return 
    } catch {
      let __message = "\(error.localizedDescription)"
      fatalError("Swift errors can currently not be propagated to C++! See https://github.com/swiftlang/swift/issues/75290 (Error: \(__message))")
    }
  }
  
  @inline(__always)
  public func getIsGrayscaleEnabled() -> bridge.std__optional_bool_ {
    do {
      let __result = try self.__implementation.getIsGrayscaleEnabled()
      return { () -> bridge.std__optional_bool_ in
        if let __unwrappedValue = __result {
          return bridge.create_std__optional_bool_(__unwrappedValue)
        } else {
          return .init()
        }
      }()
    } catch {
      let __message = "\(error.localizedDescription)"
      fatalError("Swift errors can currently not be propagated to C++! See https://github.com/swiftlang/swift/issues/75290 (Error: \(__message))")
    }
  }
  
  @inline(__always)
  public func addGrayscaleListener(onChanged: bridge.Func_void_std__optional_bool_) -> Void {
    do {
      try self.__implementation.addGrayscaleListener(onChanged: { () -> ((Bool?) -> Void) in
        let __sharedClosure = bridge.share_Func_void_std__optional_bool_(onChanged)
        return { (__isEnabled: Bool?) -> Void in
          __sharedClosure.pointee.call({ () -> bridge.std__optional_bool_ in
          if let __unwrappedValue = __isEnabled {
            return bridge.create_std__optional_bool_(__unwrappedValue)
          } else {
            return .init()
          }
        }())
        }
      }())
      return 
    } catch {
      let __message = "\(error.localizedDescription)"
      fatalError("Swift errors can currently not be propagated to C++! See https://github.com/swiftlang/swift/issues/75290 (Error: \(__message))")
    }
  }
  
  @inline(__always)
  public func getIsDarkerSystemColorsEnabled() -> bridge.std__optional_bool_ {
    do {
      let __result = try self.__implementation.getIsDarkerSystemColorsEnabled()
      return { () -> bridge.std__optional_bool_ in
        if let __unwrappedValue = __result {
          return bridge.create_std__optional_bool_(__unwrappedValue)
        } else {
          return .init()
        }
      }()
    } catch {
      let __message = "\(error.localizedDescription)"
      fatalError("Swift errors can currently not be propagated to C++! See https://github.com/swiftlang/swift/issues/75290 (Error: \(__message))")
    }
  }
  
  @inline(__always)
  public func addDarkerSystemColorsListener(onChanged: bridge.Func_void_std__optional_bool_) -> Void {
    do {
      try self.__implementation.addDarkerSystemColorsListener(onChanged: { () -> ((Bool?) -> Void) in
        let __sharedClosure = bridge.share_Func_void_std__optional_bool_(onChanged)
        return { (__isEnabled: Bool?) -> Void in
          __sharedClosure.pointee.call({ () -> bridge.std__optional_bool_ in
          if let __unwrappedValue = __isEnabled {
            return bridge.create_std__optional_bool_(__unwrappedValue)
          } else {
            return .init()
          }
        }())
        }
      }())
      return 
    } catch {
      let __message = "\(error.localizedDescription)"
      fatalError("Swift errors can currently not be propagated to C++! See https://github.com/swiftlang/swift/issues/75290 (Error: \(__message))")
    }
  }
  
  @inline(__always)
  public func getIsMonoAudioEnabled() -> bridge.std__optional_bool_ {
    do {
      let __result = try self.__implementation.getIsMonoAudioEnabled()
      return { () -> bridge.std__optional_bool_ in
        if let __unwrappedValue = __result {
          return bridge.create_std__optional_bool_(__unwrappedValue)
        } else {
          return .init()
        }
      }()
    } catch {
      let __message = "\(error.localizedDescription)"
      fatalError("Swift errors can currently not be propagated to C++! See https://github.com/swiftlang/swift/issues/75290 (Error: \(__message))")
    }
  }
  
  @inline(__always)
  public func addMonoAudioListener(onChanged: bridge.Func_void_std__optional_bool_) -> Void {
    do {
      try self.__implementation.addMonoAudioListener(onChanged: { () -> ((Bool?) -> Void) in
        let __sharedClosure = bridge.share_Func_void_std__optional_bool_(onChanged)
        return { (__isEnabled: Bool?) -> Void in
          __sharedClosure.pointee.call({ () -> bridge.std__optional_bool_ in
          if let __unwrappedValue = __isEnabled {
            return bridge.create_std__optional_bool_(__unwrappedValue)
          } else {
            return .init()
          }
        }())
        }
      }())
      return 
    } catch {
      let __message = "\(error.localizedDescription)"
      fatalError("Swift errors can currently not be propagated to C++! See https://github.com/swiftlang/swift/issues/75290 (Error: \(__message))")
    }
  }
  
  @inline(__always)
  public func getIsShakeToUndoEnabled() -> bridge.std__optional_bool_ {
    do {
      let __result = try self.__implementation.getIsShakeToUndoEnabled()
      return { () -> bridge.std__optional_bool_ in
        if let __unwrappedValue = __result {
          return bridge.create_std__optional_bool_(__unwrappedValue)
        } else {
          return .init()
        }
      }()
    } catch {
      let __message = "\(error.localizedDescription)"
      fatalError("Swift errors can currently not be propagated to C++! See https://github.com/swiftlang/swift/issues/75290 (Error: \(__message))")
    }
  }
  
  @inline(__always)
  public func addShakeToUndoListener(onChanged: bridge.Func_void_std__optional_bool_) -> Void {
    do {
      try self.__implementation.addShakeToUndoListener(onChanged: { () -> ((Bool?) -> Void) in
        let __sharedClosure = bridge.share_Func_void_std__optional_bool_(onChanged)
        return { (__isEnabled: Bool?) -> Void in
          __sharedClosure.pointee.call({ () -> bridge.std__optional_bool_ in
          if let __unwrappedValue = __isEnabled {
            return bridge.create_std__optional_bool_(__unwrappedValue)
          } else {
            return .init()
          }
        }())
        }
      }())
      return 
    } catch {
      let __message = "\(error.localizedDescription)"
      fatalError("Swift errors can currently not be propagated to C++! See https://github.com/swiftlang/swift/issues/75290 (Error: \(__message))")
    }
  }
  
  @inline(__always)
  public func getIsSpeakScreenEnabled() -> bridge.std__optional_bool_ {
    do {
      let __result = try self.__implementation.getIsSpeakScreenEnabled()
      return { () -> bridge.std__optional_bool_ in
        if let __unwrappedValue = __result {
          return bridge.create_std__optional_bool_(__unwrappedValue)
        } else {
          return .init()
        }
      }()
    } catch {
      let __message = "\(error.localizedDescription)"
      fatalError("Swift errors can currently not be propagated to C++! See https://github.com/swiftlang/swift/issues/75290 (Error: \(__message))")
    }
  }
  
  @inline(__always)
  public func addSpeakScreenListener(onChanged: bridge.Func_void_std__optional_bool_) -> Void {
    do {
      try self.__implementation.addSpeakScreenListener(onChanged: { () -> ((Bool?) -> Void) in
        let __sharedClosure = bridge.share_Func_void_std__optional_bool_(onChanged)
        return { (__isEnabled: Bool?) -> Void in
          __sharedClosure.pointee.call({ () -> bridge.std__optional_bool_ in
          if let __unwrappedValue = __isEnabled {
            return bridge.create_std__optional_bool_(__unwrappedValue)
          } else {
            return .init()
          }
        }())
        }
      }())
      return 
    } catch {
      let __message = "\(error.localizedDescription)"
      fatalError("Swift errors can currently not be propagated to C++! See https://github.com/swiftlang/swift/issues/75290 (Error: \(__message))")
    }
  }
  
  @inline(__always)
  public func getIsSpeakSelectionEnabled() -> bridge.std__optional_bool_ {
    do {
      let __result = try self.__implementation.getIsSpeakSelectionEnabled()
      return { () -> bridge.std__optional_bool_ in
        if let __unwrappedValue = __result {
          return bridge.create_std__optional_bool_(__unwrappedValue)
        } else {
          return .init()
        }
      }()
    } catch {
      let __message = "\(error.localizedDescription)"
      fatalError("Swift errors can currently not be propagated to C++! See https://github.com/swiftlang/swift/issues/75290 (Error: \(__message))")
    }
  }
  
  @inline(__always)
  public func addSpeakSelectionListener(onChanged: bridge.Func_void_std__optional_bool_) -> Void {
    do {
      try self.__implementation.addSpeakSelectionListener(onChanged: { () -> ((Bool?) -> Void) in
        let __sharedClosure = bridge.share_Func_void_std__optional_bool_(onChanged)
        return { (__isEnabled: Bool?) -> Void in
          __sharedClosure.pointee.call({ () -> bridge.std__optional_bool_ in
          if let __unwrappedValue = __isEnabled {
            return bridge.create_std__optional_bool_(__unwrappedValue)
          } else {
            return .init()
          }
        }())
        }
      }())
      return 
    } catch {
      let __message = "\(error.localizedDescription)"
      fatalError("Swift errors can currently not be propagated to C++! See https://github.com/swiftlang/swift/issues/75290 (Error: \(__message))")
    }
  }
  
  @inline(__always)
  public func getIsOnOffSwitchLabelsEnabled() -> bridge.std__optional_bool_ {
    do {
      let __result = try self.__implementation.getIsOnOffSwitchLabelsEnabled()
      return { () -> bridge.std__optional_bool_ in
        if let __unwrappedValue = __result {
          return bridge.create_std__optional_bool_(__unwrappedValue)
        } else {
          return .init()
        }
      }()
    } catch {
      let __message = "\(error.localizedDescription)"
      fatalError("Swift errors can currently not be propagated to C++! See https://github.com/swiftlang/swift/issues/75290 (Error: \(__message))")
    }
  }
  
  @inline(__always)
  public func addOnOffSwitchLabelsListener(onChanged: bridge.Func_void_std__optional_bool_) -> Void {
    do {
      try self.__implementation.addOnOffSwitchLabelsListener(onChanged: { () -> ((Bool?) -> Void) in
        let __sharedClosure = bridge.share_Func_void_std__optional_bool_(onChanged)
        return { (__isEnabled: Bool?) -> Void in
          __sharedClosure.pointee.call({ () -> bridge.std__optional_bool_ in
          if let __unwrappedValue = __isEnabled {
            return bridge.create_std__optional_bool_(__unwrappedValue)
          } else {
            return .init()
          }
        }())
        }
      }())
      return 
    } catch {
      let __message = "\(error.localizedDescription)"
      fatalError("Swift errors can currently not be propagated to C++! See https://github.com/swiftlang/swift/issues/75290 (Error: \(__message))")
    }
  }
}
