mirror of
https://github.com/bitwarden/mobile
synced 2026-01-16 07:23:29 +00:00
PM-3349 PM-3350 MAUI Migration Initial
This commit is contained in:
15
src/Core/Abstractions/IAccountsManager.cs
Normal file
15
src/Core/Abstractions/IAccountsManager.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Bit.App.Models;
|
||||
|
||||
namespace Bit.App.Abstractions
|
||||
{
|
||||
public interface IAccountsManager
|
||||
{
|
||||
void Init(Func<AppOptions> getOptionsFunc, IAccountsManagerHost accountsManagerHost);
|
||||
Task NavigateOnAccountChangeAsync(bool? isAuthed = null);
|
||||
Task StartDefaultNavigationFlowAsync(Action<AppOptions> appOptionsAction);
|
||||
Task LogOutAsync(string userId, bool userInitiated, bool expired);
|
||||
Task PromptToSwitchToExistingAccountAsync(string userId);
|
||||
}
|
||||
}
|
||||
14
src/Core/Abstractions/IAccountsManagerHost.cs
Normal file
14
src/Core/Abstractions/IAccountsManagerHost.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System.Threading.Tasks;
|
||||
using Bit.Core.Enums;
|
||||
|
||||
namespace Bit.App.Abstractions
|
||||
{
|
||||
public interface INavigationParams { }
|
||||
|
||||
public interface IAccountsManagerHost
|
||||
{
|
||||
Task SetPreviousPageInfoAsync();
|
||||
void Navigate(NavigationTarget navTarget, INavigationParams navParams = null);
|
||||
Task UpdateThemeAsync();
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ using Bit.Core.Enums;
|
||||
using Bit.Core.Models.Domain;
|
||||
using Bit.Core.Models.Request;
|
||||
using Bit.Core.Models.Response;
|
||||
using DeviceType = Bit.Core.Enums.DeviceType;
|
||||
|
||||
namespace Bit.Core.Abstractions
|
||||
{
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Threading.Tasks;
|
||||
using Bit.Core.Models.Data;
|
||||
using Bit.Core.Models.Domain;
|
||||
using Bit.Core.Models.View;
|
||||
using CollectionView = Bit.Core.Models.View.CollectionView;
|
||||
|
||||
namespace Bit.Core.Abstractions
|
||||
{
|
||||
|
||||
9
src/Core/Abstractions/IDeepLinkContext.cs
Normal file
9
src/Core/Abstractions/IDeepLinkContext.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using System;
|
||||
|
||||
namespace Bit.App.Abstractions
|
||||
{
|
||||
public interface IDeepLinkContext
|
||||
{
|
||||
bool OnNewUri(Uri uri);
|
||||
}
|
||||
}
|
||||
50
src/Core/Abstractions/IDeviceActionService.cs
Normal file
50
src/Core/Abstractions/IDeviceActionService.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using System.Threading.Tasks;
|
||||
using Bit.App.Utilities.Prompts;
|
||||
using Bit.Core.Enums;
|
||||
using Bit.Core.Models;
|
||||
|
||||
namespace Bit.App.Abstractions
|
||||
{
|
||||
public interface IDeviceActionService
|
||||
{
|
||||
string DeviceUserAgent { get; }
|
||||
Core.Enums.DeviceType DeviceType { get; }
|
||||
int SystemMajorVersion();
|
||||
string SystemModel();
|
||||
string GetBuildNumber();
|
||||
|
||||
void Toast(string text, bool longDuration = false);
|
||||
Task ShowLoadingAsync(string text);
|
||||
Task HideLoadingAsync();
|
||||
Task<string> DisplayPromptAync(string title = null, string description = null, string text = null,
|
||||
string okButtonText = null, string cancelButtonText = null, bool numericKeyboard = false,
|
||||
bool autofocus = true, bool password = false);
|
||||
Task<ValidatablePromptResponse?> DisplayValidatablePromptAsync(ValidatablePromptConfig config);
|
||||
Task<string> DisplayAlertAsync(string title, string message, string cancel, params string[] buttons);
|
||||
Task<string> DisplayActionSheetAsync(string title, string cancel, string destruction, params string[] buttons);
|
||||
|
||||
bool SupportsFaceBiometric();
|
||||
Task<bool> SupportsFaceBiometricAsync();
|
||||
bool SupportsNfc();
|
||||
bool SupportsCamera();
|
||||
bool SupportsFido2();
|
||||
bool SupportsAutofillServices();
|
||||
bool SupportsInlineAutofill();
|
||||
bool SupportsDrawOver();
|
||||
|
||||
bool LaunchApp(string appName);
|
||||
void RateApp();
|
||||
void OpenAccessibilitySettings();
|
||||
void OpenAccessibilityOverlayPermissionSettings();
|
||||
void OpenAutofillSettings();
|
||||
long GetActiveTime();
|
||||
void CloseMainApp();
|
||||
float GetSystemFontSizeScale();
|
||||
Task OnAccountSwitchCompleteAsync();
|
||||
Task SetScreenCaptureAllowedAsync();
|
||||
void OpenAppSettings();
|
||||
void CloseExtensionPopUp();
|
||||
string GetAutofillAccessibilityDescription();
|
||||
string GetAutofillDrawOverDescription();
|
||||
}
|
||||
}
|
||||
22
src/Core/Abstractions/ILocalizeService.cs
Normal file
22
src/Core/Abstractions/ILocalizeService.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Bit.App.Abstractions
|
||||
{
|
||||
public interface ILocalizeService
|
||||
{
|
||||
CultureInfo GetCurrentCultureInfo();
|
||||
|
||||
/// <summary>
|
||||
/// Format date using device locale.
|
||||
/// Needed for iOS as it provides locales unsupported in .Net
|
||||
/// </summary>
|
||||
string GetLocaleShortDate(DateTime? date);
|
||||
|
||||
/// <summary>
|
||||
/// Format time using device locale.
|
||||
/// Needed for iOS as it provides locales unsupported in .Net
|
||||
/// </summary>
|
||||
string GetLocaleShortTime(DateTime? time);
|
||||
}
|
||||
}
|
||||
14
src/Core/Abstractions/IPasswordRepromptService.cs
Normal file
14
src/Core/Abstractions/IPasswordRepromptService.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System.Threading.Tasks;
|
||||
using Bit.Core.Enums;
|
||||
|
||||
namespace Bit.App.Abstractions
|
||||
{
|
||||
public interface IPasswordRepromptService
|
||||
{
|
||||
string[] ProtectedFields { get; }
|
||||
|
||||
Task<bool> PromptAndCheckPasswordIfNeededAsync(CipherRepromptType repromptType = CipherRepromptType.Password);
|
||||
|
||||
Task<(string password, bool valid)> ShowPasswordPromptAndGetItAsync();
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@ namespace Bit.Core.Abstractions
|
||||
/// <summary>
|
||||
/// Gets the device type on the server enum
|
||||
/// </summary>
|
||||
DeviceType GetDevice();
|
||||
Enums.DeviceType GetDevice();
|
||||
string GetDeviceString();
|
||||
ClientType GetClientType();
|
||||
bool IsSelfHost();
|
||||
|
||||
17
src/Core/Abstractions/IPushNotificationListenerService.cs
Normal file
17
src/Core/Abstractions/IPushNotificationListenerService.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System.Threading.Tasks;
|
||||
using Bit.App.Models;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace Bit.App.Abstractions
|
||||
{
|
||||
public interface IPushNotificationListenerService
|
||||
{
|
||||
Task OnMessageAsync(JObject values, string device);
|
||||
Task OnRegisteredAsync(string token, string device);
|
||||
void OnUnregistered(string device);
|
||||
void OnError(string message, string device);
|
||||
Task OnNotificationTapped(BaseNotificationData data);
|
||||
Task OnNotificationDismissed(BaseNotificationData data);
|
||||
bool ShouldShowNotification();
|
||||
}
|
||||
}
|
||||
17
src/Core/Abstractions/IPushNotificationService.cs
Normal file
17
src/Core/Abstractions/IPushNotificationService.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Bit.App.Models;
|
||||
|
||||
namespace Bit.App.Abstractions
|
||||
{
|
||||
public interface IPushNotificationService
|
||||
{
|
||||
bool IsRegisteredForPush { get; }
|
||||
Task<bool> AreNotificationsSettingsEnabledAsync();
|
||||
Task<string> GetTokenAsync();
|
||||
Task RegisterAsync();
|
||||
Task UnregisterAsync();
|
||||
void SendLocalNotification(string title, string message, BaseNotificationData data);
|
||||
void DismissLocalNotification(string notificationId);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user