From d482bbb96245e7cd788b1d99b00f96d258444189 Mon Sep 17 00:00:00 2001 From: pkar Date: Sat, 26 Sep 2020 10:42:55 +0200 Subject: [PATCH] feat: PhoneCallHistory common structs --- .../Calls/PhoneCallHistoryEntry.cs | 28 +++++++++++++++++++ .../Calls/PhoneCallHistoryEntryAddress.cs | 23 +++++++++++++++ .../PhoneCallHistoryEntryRawAddressKind.cs | 8 ++++++ .../Calls/PhoneCallHistoryStoreAccessType.cs | 12 ++++++++ .../PhoneCallHistoryEntry.cs | 16 +++++------ .../PhoneCallHistoryEntryAddress.cs | 12 ++++---- .../PhoneCallHistoryEntryRawAddressKind.cs | 8 +++--- .../PhoneCallHistoryStoreAccessType.cs | 10 +++---- 8 files changed, 94 insertions(+), 23 deletions(-) create mode 100644 src/Uno.UWP/ApplicationModel/Calls/PhoneCallHistoryEntry.cs create mode 100644 src/Uno.UWP/ApplicationModel/Calls/PhoneCallHistoryEntryAddress.cs create mode 100644 src/Uno.UWP/ApplicationModel/Calls/PhoneCallHistoryEntryRawAddressKind.cs create mode 100644 src/Uno.UWP/ApplicationModel/Calls/PhoneCallHistoryStoreAccessType.cs diff --git a/src/Uno.UWP/ApplicationModel/Calls/PhoneCallHistoryEntry.cs b/src/Uno.UWP/ApplicationModel/Calls/PhoneCallHistoryEntry.cs new file mode 100644 index 000000000000..7272c7cad33c --- /dev/null +++ b/src/Uno.UWP/ApplicationModel/Calls/PhoneCallHistoryEntry.cs @@ -0,0 +1,28 @@ +using System; + +namespace Windows.ApplicationModel.Calls +{ + // without this fields/methods PhoneCallHistoryEntry has no sense :) + + public partial class PhoneCallHistoryEntry + { + public bool IsMissed { get; set; } + + public bool IsIncoming { get; set; } + + public TimeSpan? Duration { get; set; } + + public DateTimeOffset StartTime { get; set; } + + public PhoneCallHistoryEntryAddress Address { get; set; } + + public bool IsVoicemail { get; set; } + + public PhoneCallHistoryEntry() + { + // constructor defined in UWP: https://docs.microsoft.com/en-us/uwp/api/Windows.ApplicationModel.Calls.PhoneCallHistoryEntry + // nothing to do, but will be required in future to set SourceIdKind + } + + } +} diff --git a/src/Uno.UWP/ApplicationModel/Calls/PhoneCallHistoryEntryAddress.cs b/src/Uno.UWP/ApplicationModel/Calls/PhoneCallHistoryEntryAddress.cs new file mode 100644 index 000000000000..5737d9c88876 --- /dev/null +++ b/src/Uno.UWP/ApplicationModel/Calls/PhoneCallHistoryEntryAddress.cs @@ -0,0 +1,23 @@ +namespace Windows.ApplicationModel.Calls +{ + public partial class PhoneCallHistoryEntryAddress + { + // without this fields/methods PhoneCallHistoryEntryAddress has no sense :) + + public PhoneCallHistoryEntryRawAddressKind RawAddressKind { get; set; } + + public string RawAddress { get; set; } + public string DisplayName { get; set; } + + public PhoneCallHistoryEntryAddress(string rawAddress, PhoneCallHistoryEntryRawAddressKind rawAddressKind) + { + RawAddressKind = rawAddressKind; + RawAddress = rawAddress; + } + public PhoneCallHistoryEntryAddress() + { + RawAddressKind = PhoneCallHistoryEntryRawAddressKind.Custom; + } + + } +} diff --git a/src/Uno.UWP/ApplicationModel/Calls/PhoneCallHistoryEntryRawAddressKind.cs b/src/Uno.UWP/ApplicationModel/Calls/PhoneCallHistoryEntryRawAddressKind.cs new file mode 100644 index 000000000000..9ea09e4f78f3 --- /dev/null +++ b/src/Uno.UWP/ApplicationModel/Calls/PhoneCallHistoryEntryRawAddressKind.cs @@ -0,0 +1,8 @@ +namespace Windows.ApplicationModel.Calls +{ + public enum PhoneCallHistoryEntryRawAddressKind + { + PhoneNumber, + Custom, + } +} diff --git a/src/Uno.UWP/ApplicationModel/Calls/PhoneCallHistoryStoreAccessType.cs b/src/Uno.UWP/ApplicationModel/Calls/PhoneCallHistoryStoreAccessType.cs new file mode 100644 index 000000000000..1fddb778dd9f --- /dev/null +++ b/src/Uno.UWP/ApplicationModel/Calls/PhoneCallHistoryStoreAccessType.cs @@ -0,0 +1,12 @@ +namespace Windows.ApplicationModel.Calls +{ + public enum PhoneCallHistoryStoreAccessType + { + // option without support - limited to app + [global::Uno.NotImplemented] + AppEntriesReadWrite, + + AllEntriesLimitedReadWrite = 1, + AllEntriesReadWrite = 2 + } +} diff --git a/src/Uno.UWP/Generated/3.0.0.0/Windows.ApplicationModel.Calls/PhoneCallHistoryEntry.cs b/src/Uno.UWP/Generated/3.0.0.0/Windows.ApplicationModel.Calls/PhoneCallHistoryEntry.cs index 4d68a7da2021..d1f6ff112927 100644 --- a/src/Uno.UWP/Generated/3.0.0.0/Windows.ApplicationModel.Calls/PhoneCallHistoryEntry.cs +++ b/src/Uno.UWP/Generated/3.0.0.0/Windows.ApplicationModel.Calls/PhoneCallHistoryEntry.cs @@ -2,7 +2,7 @@ #pragma warning disable 114 // new keyword hiding namespace Windows.ApplicationModel.Calls { - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false [global::Uno.NotImplemented] #endif public partial class PhoneCallHistoryEntry @@ -21,7 +21,7 @@ public partial class PhoneCallHistoryEntry } } #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false [global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")] public bool IsMissed { @@ -35,7 +35,7 @@ public bool IsMissed } } #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false [global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")] public bool IsIncoming { @@ -77,7 +77,7 @@ public bool IsSeen } } #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false [global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")] public global::System.TimeSpan? Duration { @@ -119,7 +119,7 @@ public bool IsSuppressed } } #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false [global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")] public global::System.DateTimeOffset StartTime { @@ -147,7 +147,7 @@ public bool IsSuppressed } } #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false [global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")] public global::Windows.ApplicationModel.Calls.PhoneCallHistoryEntryAddress Address { @@ -217,7 +217,7 @@ public bool IsRinging } } #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false [global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")] public bool IsVoicemail { @@ -251,7 +251,7 @@ public string SourceDisplayName } } #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false [global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")] public PhoneCallHistoryEntry() { diff --git a/src/Uno.UWP/Generated/3.0.0.0/Windows.ApplicationModel.Calls/PhoneCallHistoryEntryAddress.cs b/src/Uno.UWP/Generated/3.0.0.0/Windows.ApplicationModel.Calls/PhoneCallHistoryEntryAddress.cs index 2695d3db7148..5906c051e883 100644 --- a/src/Uno.UWP/Generated/3.0.0.0/Windows.ApplicationModel.Calls/PhoneCallHistoryEntryAddress.cs +++ b/src/Uno.UWP/Generated/3.0.0.0/Windows.ApplicationModel.Calls/PhoneCallHistoryEntryAddress.cs @@ -2,12 +2,12 @@ #pragma warning disable 114 // new keyword hiding namespace Windows.ApplicationModel.Calls { - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false [global::Uno.NotImplemented] #endif public partial class PhoneCallHistoryEntryAddress { - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false [global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")] public global::Windows.ApplicationModel.Calls.PhoneCallHistoryEntryRawAddressKind RawAddressKind { @@ -21,7 +21,7 @@ public partial class PhoneCallHistoryEntryAddress } } #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false [global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")] public string RawAddress { @@ -35,7 +35,7 @@ public string RawAddress } } #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false [global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")] public string DisplayName { @@ -63,7 +63,7 @@ public string ContactId } } #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false [global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")] public PhoneCallHistoryEntryAddress( string rawAddress, global::Windows.ApplicationModel.Calls.PhoneCallHistoryEntryRawAddressKind rawAddressKind) { @@ -71,7 +71,7 @@ public PhoneCallHistoryEntryAddress( string rawAddress, global::Windows.Applica } #endif // Forced skipping of method Windows.ApplicationModel.Calls.PhoneCallHistoryEntryAddress.PhoneCallHistoryEntryAddress(string, Windows.ApplicationModel.Calls.PhoneCallHistoryEntryRawAddressKind) - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false [global::Uno.NotImplemented("__ANDROID__", "__IOS__", "NET461", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")] public PhoneCallHistoryEntryAddress() { diff --git a/src/Uno.UWP/Generated/3.0.0.0/Windows.ApplicationModel.Calls/PhoneCallHistoryEntryRawAddressKind.cs b/src/Uno.UWP/Generated/3.0.0.0/Windows.ApplicationModel.Calls/PhoneCallHistoryEntryRawAddressKind.cs index c8d5a2788da9..a01e423937b8 100644 --- a/src/Uno.UWP/Generated/3.0.0.0/Windows.ApplicationModel.Calls/PhoneCallHistoryEntryRawAddressKind.cs +++ b/src/Uno.UWP/Generated/3.0.0.0/Windows.ApplicationModel.Calls/PhoneCallHistoryEntryRawAddressKind.cs @@ -2,16 +2,16 @@ #pragma warning disable 114 // new keyword hiding namespace Windows.ApplicationModel.Calls { - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false + #if false [global::Uno.NotImplemented] #endif public enum PhoneCallHistoryEntryRawAddressKind { - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false PhoneNumber, #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false Custom, #endif } diff --git a/src/Uno.UWP/Generated/3.0.0.0/Windows.ApplicationModel.Calls/PhoneCallHistoryStoreAccessType.cs b/src/Uno.UWP/Generated/3.0.0.0/Windows.ApplicationModel.Calls/PhoneCallHistoryStoreAccessType.cs index 5ed3a55f6593..c30a3cd0f016 100644 --- a/src/Uno.UWP/Generated/3.0.0.0/Windows.ApplicationModel.Calls/PhoneCallHistoryStoreAccessType.cs +++ b/src/Uno.UWP/Generated/3.0.0.0/Windows.ApplicationModel.Calls/PhoneCallHistoryStoreAccessType.cs @@ -2,19 +2,19 @@ #pragma warning disable 114 // new keyword hiding namespace Windows.ApplicationModel.Calls { - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false + #if false [global::Uno.NotImplemented] #endif public enum PhoneCallHistoryStoreAccessType { - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false AppEntriesReadWrite, #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false AllEntriesLimitedReadWrite, #endif - #if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ + #if false AllEntriesReadWrite, #endif }