@@ -891,6 +891,11 @@ public struct VirtualElementCallWidgetOptions {
891
891
* client. (used on ios & android)
892
892
*/
893
893
public var controlledMediaDevices : Bool
894
+ /**
895
+ * Whether and what type of notification Element Call should send, when
896
+ * starting a call.
897
+ */
898
+ public var sendNotificationType : NotificationType ?
894
899
895
900
// Default memberwise initializers are never public by default, so we
896
901
// declare one manually.
@@ -993,7 +998,11 @@ public struct VirtualElementCallWidgetOptions {
993
998
/**
994
999
* - `false`: the webview shows a a list of devices injected by the
995
1000
* client. (used on ios & android)
996
- */controlledMediaDevices: Bool ) {
1001
+ */controlledMediaDevices: Bool ,
1002
+ /**
1003
+ * Whether and what type of notification Element Call should send, when
1004
+ * starting a call.
1005
+ */sendNotificationType: NotificationType ? ) {
997
1006
self . elementCallUrl = elementCallUrl
998
1007
self . widgetId = widgetId
999
1008
self . parentUrl = parentUrl
@@ -1014,6 +1023,7 @@ public struct VirtualElementCallWidgetOptions {
1014
1023
self . sentryDsn = sentryDsn
1015
1024
self . sentryEnvironment = sentryEnvironment
1016
1025
self . controlledMediaDevices = controlledMediaDevices
1026
+ self . sendNotificationType = sendNotificationType
1017
1027
}
1018
1028
}
1019
1029
@@ -1081,6 +1091,9 @@ extension VirtualElementCallWidgetOptions: Equatable, Hashable {
1081
1091
if lhs. controlledMediaDevices != rhs. controlledMediaDevices {
1082
1092
return false
1083
1093
}
1094
+ if lhs. sendNotificationType != rhs. sendNotificationType {
1095
+ return false
1096
+ }
1084
1097
return true
1085
1098
}
1086
1099
@@ -1105,6 +1118,7 @@ extension VirtualElementCallWidgetOptions: Equatable, Hashable {
1105
1118
hasher. combine ( sentryDsn)
1106
1119
hasher. combine ( sentryEnvironment)
1107
1120
hasher. combine ( controlledMediaDevices)
1121
+ hasher. combine ( sendNotificationType)
1108
1122
}
1109
1123
}
1110
1124
@@ -1132,7 +1146,8 @@ public struct FfiConverterTypeVirtualElementCallWidgetOptions: FfiConverterRustB
1132
1146
rageshakeSubmitUrl: FfiConverterOptionString . read ( from: & buf) ,
1133
1147
sentryDsn: FfiConverterOptionString . read ( from: & buf) ,
1134
1148
sentryEnvironment: FfiConverterOptionString . read ( from: & buf) ,
1135
- controlledMediaDevices: FfiConverterBool . read ( from: & buf)
1149
+ controlledMediaDevices: FfiConverterBool . read ( from: & buf) ,
1150
+ sendNotificationType: FfiConverterOptionTypeNotificationType . read ( from: & buf)
1136
1151
)
1137
1152
}
1138
1153
@@ -1157,6 +1172,7 @@ public struct FfiConverterTypeVirtualElementCallWidgetOptions: FfiConverterRustB
1157
1172
FfiConverterOptionString . write ( value. sentryDsn, into: & buf)
1158
1173
FfiConverterOptionString . write ( value. sentryEnvironment, into: & buf)
1159
1174
FfiConverterBool . write ( value. controlledMediaDevices, into: & buf)
1175
+ FfiConverterOptionTypeNotificationType . write ( value. sendNotificationType, into: & buf)
1160
1176
}
1161
1177
}
1162
1178
@@ -1480,6 +1496,70 @@ extension Intent: Equatable, Hashable {}
1480
1496
1481
1497
1482
1498
1499
+ // Note that we don't yet support `indirect` for enums.
1500
+ // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
1501
+ /**
1502
+ * Types of call notifications.
1503
+ */
1504
+
1505
+ public enum NotificationType {
1506
+
1507
+ /**
1508
+ * The receiving client should display a visual notification.
1509
+ */
1510
+ case notification
1511
+ /**
1512
+ * The receiving client should ring with an audible sound.
1513
+ */
1514
+ case ring
1515
+ }
1516
+
1517
+
1518
+ public struct FfiConverterTypeNotificationType : FfiConverterRustBuffer {
1519
+ typealias SwiftType = NotificationType
1520
+
1521
+ public static func read( from buf: inout ( data: Data , offset: Data . Index ) ) throws -> NotificationType {
1522
+ let variant : Int32 = try readInt ( & buf)
1523
+ switch variant {
1524
+
1525
+ case 1 : return . notification
1526
+
1527
+ case 2 : return . ring
1528
+
1529
+ default : throw UniffiInternalError . unexpectedEnumCase
1530
+ }
1531
+ }
1532
+
1533
+ public static func write( _ value: NotificationType , into buf: inout [ UInt8 ] ) {
1534
+ switch value {
1535
+
1536
+
1537
+ case . notification:
1538
+ writeInt ( & buf, Int32 ( 1 ) )
1539
+
1540
+
1541
+ case . ring:
1542
+ writeInt ( & buf, Int32 ( 2 ) )
1543
+
1544
+ }
1545
+ }
1546
+ }
1547
+
1548
+
1549
+ public func FfiConverterTypeNotificationType_lift( _ buf: RustBuffer ) throws -> NotificationType {
1550
+ return try FfiConverterTypeNotificationType . lift ( buf)
1551
+ }
1552
+
1553
+ public func FfiConverterTypeNotificationType_lower( _ value: NotificationType ) -> RustBuffer {
1554
+ return FfiConverterTypeNotificationType . lower ( value)
1555
+ }
1556
+
1557
+
1558
+
1559
+ extension NotificationType : Equatable , Hashable { }
1560
+
1561
+
1562
+
1483
1563
// Note that we don't yet support `indirect` for enums.
1484
1564
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
1485
1565
/**
@@ -2007,6 +2087,27 @@ fileprivate struct FfiConverterOptionTypeIntent: FfiConverterRustBuffer {
2007
2087
}
2008
2088
}
2009
2089
2090
+ fileprivate struct FfiConverterOptionTypeNotificationType : FfiConverterRustBuffer {
2091
+ typealias SwiftType = NotificationType ?
2092
+
2093
+ public static func write( _ value: SwiftType , into buf: inout [ UInt8 ] ) {
2094
+ guard let value = value else {
2095
+ writeInt ( & buf, Int8 ( 0 ) )
2096
+ return
2097
+ }
2098
+ writeInt ( & buf, Int8 ( 1 ) )
2099
+ FfiConverterTypeNotificationType . write ( value, into: & buf)
2100
+ }
2101
+
2102
+ public static func read( from buf: inout ( data: Data , offset: Data . Index ) ) throws -> SwiftType {
2103
+ switch try readInt ( & buf) as Int8 {
2104
+ case 0 : return nil
2105
+ case 1 : return try FfiConverterTypeNotificationType . read ( from: & buf)
2106
+ default : throw UniffiInternalError . unexpectedOptionalTag
2107
+ }
2108
+ }
2109
+ }
2110
+
2010
2111
private enum InitializationResult {
2011
2112
case ok
2012
2113
case contractVersionMismatch
0 commit comments