Files
letro-ios/ElementX/Sources/Services/ElementCall/ElementCallWidgetDriverProtocol.swift
Doug 1d29d4de8a Remove GenericCallLinkCoordinator, merging it into CallScreen. (#3181)
* Remove incorrect message send call and fix typo.

* Add overlay coordinator presentation to the NavigationRootCoordinator.

* Remove GenericCallLinkCoordinator, merging it into CallScreen.

This will allow for picture in picture on call links when available.
2024-08-19 17:21:25 +01:00

46 lines
1.6 KiB
Swift

//
// Copyright 2023 New Vector Ltd
//
// 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.
//
import Combine
import SwiftUI
enum ElementCallWidgetDriverError: Error {
case roomInvalid
case failedBuildingCallURL
case failedBuildingWidgetSettings
case failedBuildingWidgetDriver
case failedParsingCallURL
case driverNotSetup
}
enum ElementCallWidgetDriverAction {
case callEnded
case mediaStateChanged(audioEnabled: Bool, videoEnabled: Bool)
}
// sourcery: AutoMockable
protocol ElementCallWidgetDriverProtocol {
var widgetID: String { get }
var messagePublisher: PassthroughSubject<String, Never> { get }
var actions: AnyPublisher<ElementCallWidgetDriverAction, Never> { get }
func start(baseURL: URL, clientID: String, colorScheme: ColorScheme) async -> Result<URL, ElementCallWidgetDriverError>
/// Passes a message from the Widget to the SDK to handle, returning a Bool that represents whether or not the widget driver is still running.
func handleMessage(_ message: String) async -> Result<Bool, ElementCallWidgetDriverError>
}