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

import NitroModules

/// See ``HybridReadiumViewSpec``
public protocol HybridReadiumViewSpec_protocol: HybridObject, HybridView {
  // Properties
  var file: ReadiumFile? { get set }
  var preferences: Preferences? { get set }
  var decorations: [DecorationGroup]? { get set }
  var selectionActions: [SelectionAction]? { get set }
  var onLocationChange: ((_ locator: Locator) -> Void)? { get set }
  var onPublicationReady: ((_ event: PublicationReadyEvent) -> Void)? { get set }
  var onDecorationActivated: ((_ event: DecorationActivatedEvent) -> Void)? { get set }
  var onSelectionChange: ((_ event: SelectionEvent) -> Void)? { get set }
  var onSelectionAction: ((_ event: SelectionActionEvent) -> Void)? { get set }

  // Methods
  func goTo(locator: Locator) throws -> Void
  func goForward() throws -> Void
  func goBackward() throws -> Void
  func destroy() throws -> Void
}

public extension HybridReadiumViewSpec_protocol {
  /// Default implementation of ``HybridObject.toString``
  func toString() -> String {
    return "[HybridObject ReadiumView]"
  }
}

/// See ``HybridReadiumViewSpec``
open class HybridReadiumViewSpec_base {
  private weak var cxxWrapper: HybridReadiumViewSpec_cxx? = nil
  public init() { }
  public func getCxxWrapper() -> HybridReadiumViewSpec_cxx {
  #if DEBUG
    guard self is any HybridReadiumViewSpec else {
      fatalError("`self` is not a `HybridReadiumViewSpec`! Did you accidentally inherit from `HybridReadiumViewSpec_base` instead of `HybridReadiumViewSpec`?")
    }
  #endif
    if let cxxWrapper = self.cxxWrapper {
      return cxxWrapper
    } else {
      let cxxWrapper = HybridReadiumViewSpec_cxx(self as! any HybridReadiumViewSpec)
      self.cxxWrapper = cxxWrapper
      return cxxWrapper
    }
  }
}

/**
 * A Swift base-protocol representing the ReadiumView HybridObject.
 * Implement this protocol to create Swift-based instances of ReadiumView.
 * ```swift
 * class HybridReadiumView : HybridReadiumViewSpec {
 *   // ...
 * }
 * ```
 */
public typealias HybridReadiumViewSpec = HybridReadiumViewSpec_protocol & HybridReadiumViewSpec_base
