Class GuiPlatform
What the desktop and Android apps tell the shared user interface about their platform.
Implements
Inherited Members
Namespace: Uniform.Chat.Avalonia
Assembly: Uniform.Chat.Avalonia.dll
Syntax
public sealed record GuiPlatform : IEquatable<GuiPlatform>
Properties
| Edit this page View SourceApplicationName
Application name, which names the data and settings folders, e.g. Uniform.Chat.Desktop.
Declaration
public required string ApplicationName { get; init; }
Property Value
| Type | Description |
|---|---|
| string |
Audio
Open the platform's microphone and speaker, given whether to use the loudspeaker rather than an earpiece; null where there is no audio.
Declaration
public Func<bool, IAudioDevices>? Audio { get; init; }
Property Value
| Type | Description |
|---|---|
| Func<bool, IAudioDevices> |
Camera
Opens the camera with its VP8 encoder, for calls answered with video; null where there is none.
Declaration
public Func<IVideoCamera>? Camera { get; init; }
Property Value
| Type | Description |
|---|---|
| Func<IVideoCamera> |
ConfigureServices
Changes to the engine's services, e.g. a test HTTP handler.
Declaration
public Action<IServiceCollection>? ConfigureServices { get; init; }
Property Value
| Type | Description |
|---|---|
| Action<IServiceCollection> |
DeviceName
Display name of the device created at sign-in, e.g. Uniform Chat on Linux.
Declaration
public required string DeviceName { get; init; }
Property Value
| Type | Description |
|---|---|
| string |
HasEarpiece
Whether the platform has an earpiece, so that the loudspeaker is a choice, as on phones.
Declaration
public bool HasEarpiece { get; init; }
Property Value
| Type | Description |
|---|---|
| bool |
HttpHandler
HTTP handler for requests outside the engine, such as creating an account; null for the default. Tests route them to a server in memory.
Declaration
public Func<HttpMessageHandler>? HttpHandler { get; init; }
Property Value
| Type | Description |
|---|---|
| Func<HttpMessageHandler> |
KeepCallAlive
Keep a call with the named peer going while the app is in the background, e.g. a foreground service on Android; dispose the result when the call ends. Null where nothing is needed.
Declaration
public Func<string, IDisposable>? KeepCallAlive { get; init; }
Property Value
| Type | Description |
|---|---|
| Func<string, IDisposable> |
KeepConnected
Keep the engine syncing while the app is in the background or the screen is off, e.g. a foreground service on Android, which otherwise cuts the app's network; dispose the result when signed out. Null where nothing is needed.
Declaration
public Func<IDisposable>? KeepConnected { get; init; }
Property Value
| Type | Description |
|---|---|
| Func<IDisposable> |
NotificationsAllowed
Return whether the app may show notifications now; null where it always may.
Declaration
public Func<bool>? NotificationsAllowed { get; init; }
Property Value
| Type | Description |
|---|---|
| Func<bool> |
Notifier
System notifications, or null where the platform has none yet.
Declaration
public INotifier? Notifier { get; init; }
Property Value
| Type | Description |
|---|---|
| INotifier |
OpenNotificationSettings
Open the system's notification settings of the app, where a refused permission is given; null where there are none.
Declaration
public Action? OpenNotificationSettings { get; init; }
Property Value
| Type | Description |
|---|---|
| Action |
Push
Push messages through a UnifiedPush distributor, which replace KeepConnected while registered; null where the platform has none.
Declaration
public IPushService? Push { get; init; }
Property Value
| Type | Description |
|---|---|
| IPushService |
ReadClipboardFile
Return the image or file on the platform's clipboard, which pasting in the message box sends, e.g. a screenshot copied on Android, whose clipboard holds such things as links Avalonia does not read; null when the clipboard holds none, or where Avalonia's clipboard is enough, as on desktops.
Declaration
public Func<ClipboardFile?>? ReadClipboardFile { get; init; }
Property Value
| Type | Description |
|---|---|
| Func<ClipboardFile> |
RequestCameraAsync
Asks for the camera permission where needed, returning whether granted; null when none is needed.
Declaration
public Func<Task<bool>>? RequestCameraAsync { get; init; }
Property Value
| Type | Description |
|---|---|
| Func<Task<bool>> |
RequestMicrophoneAsync
Ask for permission to record, where the platform needs it; return whether it is granted. Null where none is needed.
Declaration
public Func<Task<bool>>? RequestMicrophoneAsync { get; init; }
Property Value
| Type | Description |
|---|---|
| Func<Task<bool>> |
RequestNotificationsAsync
Ask for permission to show notifications, where the platform needs it, as Android 13 and later do; return whether they may be shown. Null where none is needed.
Declaration
public Func<Task<bool>>? RequestNotificationsAsync { get; init; }
Property Value
| Type | Description |
|---|---|
| Func<Task<bool>> |
Ring
Ring for an incoming call from the named peer, e.g. the ringtone and a full-screen call notification on Android; dispose the result to stop. Null where the platform only notifies.
Declaration
public Func<string, IDisposable>? Ring { get; init; }
Property Value
| Type | Description |
|---|---|
| Func<string, IDisposable> |
RingIsSoundOnly
Whether Ring only plays a sound, as on the desktop, so an incoming call still shows a notification; Android's ring shows one of its own.
Declaration
public bool RingIsSoundOnly { get; init; }
Property Value
| Type | Description |
|---|---|
| bool |
ScreenOffNearEar
Turn the screen off while the phone is held to the ear, so that the cheek does not press buttons; dispose the result to stop. Null where there is no proximity sensor.
Declaration
public Func<IDisposable>? ScreenOffNearEar { get; init; }
Property Value
| Type | Description |
|---|---|
| Func<IDisposable> |
Settings
Extra configuration of the client engine, e.g. Storage:DataDirectory.
Declaration
public IReadOnlyDictionary<string, string?> Settings { get; init; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyDictionary<string, string> |
SinglePane
Whether the screen shows one pane at a time, the room list or a room, as on phones.
Declaration
public bool SinglePane { get; init; }
Property Value
| Type | Description |
|---|---|
| bool |
VideoDecoder
Makes a decoder of a call's video, e.g. Android's hardware decoder; null for the C# one.
Declaration
public Func<IVideoDecoder>? VideoDecoder { get; init; }
Property Value
| Type | Description |
|---|---|
| Func<IVideoDecoder> |
Methods
| Edit this page View SourceDesktop()
Return the platform of the desktop app on this operating system.
Declaration
public static GuiPlatform Desktop()
Returns
| Type | Description |
|---|---|
| GuiPlatform |