Files
letro-ios/ElementX/Sources/Screens/CallScreen/CallScreenModels.swift
Stefan Ceriu 89eae00479 Switch license to AGPL (#3237)
* Switch license file to AGPL

* Update file copyright headers

* Update the default project file header
2024-09-06 16:34:30 +03:00

45 lines
1.0 KiB
Swift

//
// Copyright 2022-2024 New Vector Ltd.
//
// SPDX-License-Identifier: AGPL-3.0-only
// Please see LICENSE in the repository root for full details.
//
import AVKit
import Foundation
enum CallScreenViewModelAction {
case pictureInPictureStarted(AVPictureInPictureController)
case pictureInPictureStopped
case dismiss
}
struct CallScreenViewState: BindableState {
let messageHandler: String
let script: String?
var url: URL?
let certificateValidator: CertificateValidatorHookProtocol
var bindings = Bindings()
}
struct Bindings {
var javaScriptMessageHandler: ((Any) -> Void)?
var javaScriptEvaluator: ((String) async throws -> Any)?
var requestPictureInPictureHandler: (() async -> Result<AVPictureInPictureController, CallScreenError>)?
var alertInfo: AlertInfo<UUID>?
}
enum CallScreenViewAction {
case urlChanged(URL?)
case navigateBack
case pictureInPictureWillStop
case endCall
}
enum CallScreenError: Error {
case pictureInPictureNotAvailable
}