diff --git a/src/Photos/Enums.cs b/src/Photos/Enums.cs index 4acc88fe3b..a246a8a7d8 100644 --- a/src/Photos/Enums.cs +++ b/src/Photos/Enums.cs @@ -182,6 +182,8 @@ namespace Photos SmartAlbumLongExposures = 215, [iOS (13,0)][TV(13,0)][Mac (10,15)] SmartAlbumUnableToUpload = 216, + [iOS (15,0), TV (15,0), Mac (12,0), MacCatalyst (15,0)] + SmartAlbumRAW = 217, Any = Int64.MaxValue @@ -351,12 +353,15 @@ namespace Photos Auxiliary = 3, } + [NoMacCatalyst] [Mac (10,12)] [NoiOS][NoTV] [Native] [ErrorDomain ("PHLivePhotoEditingErrorDomain")] public enum PHLivePhotoEditingError : long { + [Deprecated (PlatformName.MacOSX, 10, 15, message: "Use 'PHPhotosError.InternalError' instead.")] Unknown, + [Deprecated (PlatformName.MacOSX, 10, 15, message: "Use 'PHPhotosError.UserCancelled' instead.")] Aborted, } @@ -378,12 +383,26 @@ namespace Photos [TV (13,0), Mac (10,15), iOS (13,0)] [Native] public enum PHPhotosError : long { +#if !XAMCORE_4_0 + [Deprecated (PlatformName.MacOSX, 12, 0, message: "Use 'InternalError' instead.")] Invalid = -1, +#endif + InternalError = -1, UserCancelled = 3072, LibraryVolumeOffline = 3114, RelinquishingLibraryBundleToWriter = 3142, SwitchingSystemPhotoLibrary = 3143, NetworkAccessRequired = 3164, + IdentifierNotFound = 3201, + MultipleIdentifiersFound = 3202, + ChangeNotSupported = 3300, + OperationInterrupted = 3301, + InvalidResource = 3302, + MissingResource = 3303, + NotEnoughSpace = 3305, + RequestNotSupportedForAsset = 3306, + AccessRestricted = 3310, + AccessUserDenied = 3311, } [TV (14,0), Mac (11,0), iOS (14,0)] diff --git a/src/photos.cs b/src/photos.cs index f82d15572f..bfa713d9c8 100644 --- a/src/photos.cs +++ b/src/photos.cs @@ -146,9 +146,15 @@ namespace Photos [Export ("playbackStyle", ArgumentSemantic.Assign)] PHAssetPlaybackStyle PlaybackStyle { get; } + [NoMacCatalyst] + [Deprecated (PlatformName.MacOSX, 12, 0, message: "Use 'PHPhotosError.IdentifierNotFound' instead.")] [NoTV][NoiOS] [Field ("PHLocalIdentifierNotFound")] NSString LocalIdentifierNotFound { get; } + + [TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [NullAllowed, Export ("adjustmentFormatIdentifier")] + string AdjustmentFormatIdentifier { get; } } [iOS (8,0)] @@ -1162,22 +1168,38 @@ namespace Photos [TV (13,0), Mac (10,15), iOS (13,0)] [Export ("unregisterAvailabilityObserver:")] void Unregister (IPHPhotoLibraryAvailabilityObserver observer); + + [TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [Field ("PHLocalIdentifiersErrorKey")] + NSString LocalIdentifiersErrorKey { get; } } [Mac (10,13)] - [NoTV][NoiOS] + [TV (15,0), iOS (15,0), MacCatalyst (15,0)] [Category] - [Unavailable (PlatformName.MacCatalyst)] - [Advice ("This API is not available when using UIKit on macOS.")] [BaseType (typeof (PHPhotoLibrary))] interface PHPhotoLibrary_CloudIdentifiers { + [Mac (12,0)] + [Export ("localIdentifierMappingsForCloudIdentifiers:")] + NSDictionary GetLocalIdentifierMappings (PHCloudIdentifier[] cloudIdentifiers); + + [Mac (12,0)] + [Export ("cloudIdentifierMappingsForLocalIdentifiers:")] + NSDictionary GetCloudIdentifierMappings (string[] localIdentifiers); + + [NoTV][NoiOS][NoMacCatalyst] + [Deprecated (PlatformName.MacOSX, 12, 0, message: "Use 'localIdentifierMappingsForCloudIdentifiers:' instead.")] [Export ("localIdentifiersForCloudIdentifiers:")] string[] GetLocalIdentifiers (PHCloudIdentifier[] cloudIdentifiers); + [NoTV][NoiOS][NoMacCatalyst] + [Deprecated (PlatformName.MacOSX, 12, 0, message: "Use 'cloudIdentifierMappingsForCloudIdentifiers:' instead.")] [Export ("cloudIdentifiersForLocalIdentifiers:")] PHCloudIdentifier[] GetCloudIdentifiers (string[] localIdentifiers); + [NoTV][NoiOS][NoMacCatalyst] + [Deprecated (PlatformName.MacOSX, 12, 0, message: "Use 'PHPhotosError.IdentifierNotFound' instead.")] [Field ("PHLocalIdentifierNotFound")] NSString LocalIdentifierNotFound { get; } } @@ -1406,13 +1428,14 @@ namespace Photos } [Mac (10,13)] - [NoiOS][NoTV] - [Unavailable (PlatformName.MacCatalyst)] - [Advice ("This API is not available when using UIKit on macOS.")] + [TV (15,0)] + [iOS (15,0)] [BaseType (typeof (NSObject))] [DisableDefaultCtor] interface PHCloudIdentifier : NSSecureCoding { + [Deprecated (PlatformName.MacOSX, 12, 0, message: "Use 'PHPhotosError.IdentifierNotFound' instead.")] + [NoTV, NoiOS, NoMacCatalyst] [Static] [Export ("notFoundIdentifier")] PHCloudIdentifier NotFoundIdentifier { get; } @@ -1423,4 +1446,28 @@ namespace Photos [Export ("initWithStringValue:")] IntPtr Constructor (string stringValue); } + + [TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [BaseType (typeof (NSObject))] + [DisableDefaultCtor] + interface PHCloudIdentifierMapping + { + [NullAllowed, Export ("cloudIdentifier")] + PHCloudIdentifier CloudIdentifier { get; } + + [NullAllowed, Export ("error")] + NSError Error { get; } + } + + [TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [BaseType (typeof (NSObject))] + [DisableDefaultCtor] + interface PHLocalIdentifierMapping + { + [NullAllowed, Export ("localIdentifier")] + string LocalIdentifier { get; } + + [NullAllowed, Export ("error")] + NSError Error { get; } + } } diff --git a/tests/introspection/iOS/iOSApiProtocolTest.cs b/tests/introspection/iOS/iOSApiProtocolTest.cs index 95222162b6..9b454b5d1f 100644 --- a/tests/introspection/iOS/iOSApiProtocolTest.cs +++ b/tests/introspection/iOS/iOSApiProtocolTest.cs @@ -761,6 +761,8 @@ namespace Introspection { return true; #endif // Xcode 13 + case "PHCloudIdentifier": + case "PHCloudIdentifierMapping": case "NSEntityMapping": case "NSMappingModel": case "NSMergePolicy": diff --git a/tests/xtro-sharpie/MacCatalyst-Photos.ignore b/tests/xtro-sharpie/MacCatalyst-Photos.ignore new file mode 100644 index 0000000000..b8b61c81f5 --- /dev/null +++ b/tests/xtro-sharpie/MacCatalyst-Photos.ignore @@ -0,0 +1,23 @@ +# deprecated and not used by catalyst +!missing-enum! PHLivePhotoEditingErrorCode not bound +!missing-field! PHLivePhotoEditingErrorDomain not bound +!missing-field! PHLocalIdentifierNotFound not bound +!missing-selector! +PHAsset::fetchAssetsWithALAssetURLs:options: not bound +!missing-selector! +PHCloudIdentifier::notFoundIdentifier not bound +!missing-selector! PHAsset::isSyncFailureHidden not bound +!missing-selector! PHPhotoLibrary::cloudIdentifiersForLocalIdentifiers: not bound +!missing-selector! PHPhotoLibrary::localIdentifiersForPHPhotoLibrary: not bound + +# apis not available on catalyst +!missing-selector! PHProject::hasProjectPreview not bound +!missing-selector! PHProject::projectExtensionData not bound +!missing-selector! PHProjectChangeRequest::initWithProject: not bound +!missing-selector! PHProjectChangeRequest::projectExtensionData not bound +!missing-selector! PHProjectChangeRequest::removeAssets: not bound +!missing-selector! PHProjectChangeRequest::setKeyAsset: not bound +!missing-selector! PHProjectChangeRequest::setProjectExtensionData: not bound +!missing-selector! PHProjectChangeRequest::setProjectPreviewImage: not bound +!missing-selector! PHProjectChangeRequest::setTitle: not bound +!missing-selector! PHProjectChangeRequest::title not bound +!missing-type! PHProject not bound +!missing-type! PHProjectChangeRequest not bound diff --git a/tests/xtro-sharpie/MacCatalyst-Photos.todo b/tests/xtro-sharpie/MacCatalyst-Photos.todo deleted file mode 100644 index d5803ca67a..0000000000 --- a/tests/xtro-sharpie/MacCatalyst-Photos.todo +++ /dev/null @@ -1,45 +0,0 @@ -!missing-enum! PHLivePhotoEditingErrorCode not bound -!missing-field! PHLivePhotoEditingErrorDomain not bound -!missing-field! PHLocalIdentifierNotFound not bound -!missing-selector! +PHAsset::fetchAssetsWithALAssetURLs:options: not bound -!missing-selector! +PHCloudIdentifier::notFoundIdentifier not bound -!missing-selector! PHAsset::isSyncFailureHidden not bound -!missing-selector! PHCloudIdentifier::initWithStringValue: not bound -!missing-selector! PHCloudIdentifier::stringValue not bound -!missing-selector! PHPhotoLibrary::cloudIdentifiersForLocalIdentifiers: not bound -!missing-selector! PHPhotoLibrary::localIdentifiersForPHPhotoLibrary: not bound -!missing-selector! PHProject::hasProjectPreview not bound -!missing-selector! PHProject::projectExtensionData not bound -!missing-selector! PHProjectChangeRequest::initWithProject: not bound -!missing-selector! PHProjectChangeRequest::projectExtensionData not bound -!missing-selector! PHProjectChangeRequest::removeAssets: not bound -!missing-selector! PHProjectChangeRequest::setKeyAsset: not bound -!missing-selector! PHProjectChangeRequest::setProjectExtensionData: not bound -!missing-selector! PHProjectChangeRequest::setProjectPreviewImage: not bound -!missing-selector! PHProjectChangeRequest::setTitle: not bound -!missing-selector! PHProjectChangeRequest::title not bound -!missing-type! PHCloudIdentifier not bound -!missing-type! PHProject not bound -!missing-type! PHProjectChangeRequest not bound -## appended from unclassified file -!missing-enum-value! PHAssetCollectionSubtype native value PHAssetCollectionSubtypeSmartAlbumRAW = 217 not bound -!missing-enum-value! PHPhotosError native value PHPhotosErrorAccessRestricted = 3310 not bound -!missing-enum-value! PHPhotosError native value PHPhotosErrorAccessUserDenied = 3311 not bound -!missing-enum-value! PHPhotosError native value PHPhotosErrorChangeNotSupported = 3300 not bound -!missing-enum-value! PHPhotosError native value PHPhotosErrorIdentifierNotFound = 3201 not bound -!missing-enum-value! PHPhotosError native value PHPhotosErrorInvalidResource = 3302 not bound -!missing-enum-value! PHPhotosError native value PHPhotosErrorMissingResource = 3303 not bound -!missing-enum-value! PHPhotosError native value PHPhotosErrorMultipleIdentifiersFound = 3202 not bound -!missing-enum-value! PHPhotosError native value PHPhotosErrorNotEnoughSpace = 3305 not bound -!missing-enum-value! PHPhotosError native value PHPhotosErrorOperationInterrupted = 3301 not bound -!missing-enum-value! PHPhotosError native value PHPhotosErrorRequestNotSupportedForAsset = 3306 not bound -!missing-field! PHLocalIdentifiersErrorKey not bound -!missing-selector! PHAsset::adjustmentFormatIdentifier not bound -!missing-selector! PHCloudIdentifierMapping::cloudIdentifier not bound -!missing-selector! PHCloudIdentifierMapping::error not bound -!missing-selector! PHLocalIdentifierMapping::error not bound -!missing-selector! PHLocalIdentifierMapping::localIdentifier not bound -!missing-selector! PHPhotoLibrary::cloudIdentifierMappingsForLocalIdentifiers: not bound -!missing-selector! PHPhotoLibrary::localIdentifierMappingsForPHPhotoLibrary: not bound -!missing-type! PHCloudIdentifierMapping not bound -!missing-type! PHLocalIdentifierMapping not bound diff --git a/tests/xtro-sharpie/iOS-Photos.todo b/tests/xtro-sharpie/iOS-Photos.todo deleted file mode 100644 index 5f06bdf15d..0000000000 --- a/tests/xtro-sharpie/iOS-Photos.todo +++ /dev/null @@ -1,24 +0,0 @@ -!missing-enum-value! PHAssetCollectionSubtype native value PHAssetCollectionSubtypeSmartAlbumRAW = 217 not bound -!missing-enum-value! PHPhotosError native value PHPhotosErrorAccessRestricted = 3310 not bound -!missing-enum-value! PHPhotosError native value PHPhotosErrorAccessUserDenied = 3311 not bound -!missing-enum-value! PHPhotosError native value PHPhotosErrorChangeNotSupported = 3300 not bound -!missing-enum-value! PHPhotosError native value PHPhotosErrorIdentifierNotFound = 3201 not bound -!missing-enum-value! PHPhotosError native value PHPhotosErrorInvalidResource = 3302 not bound -!missing-enum-value! PHPhotosError native value PHPhotosErrorMissingResource = 3303 not bound -!missing-enum-value! PHPhotosError native value PHPhotosErrorMultipleIdentifiersFound = 3202 not bound -!missing-enum-value! PHPhotosError native value PHPhotosErrorNotEnoughSpace = 3305 not bound -!missing-enum-value! PHPhotosError native value PHPhotosErrorOperationInterrupted = 3301 not bound -!missing-enum-value! PHPhotosError native value PHPhotosErrorRequestNotSupportedForAsset = 3306 not bound -!missing-field! PHLocalIdentifiersErrorKey not bound -!missing-selector! PHAsset::adjustmentFormatIdentifier not bound -!missing-selector! PHCloudIdentifier::initWithStringValue: not bound -!missing-selector! PHCloudIdentifier::stringValue not bound -!missing-selector! PHCloudIdentifierMapping::cloudIdentifier not bound -!missing-selector! PHCloudIdentifierMapping::error not bound -!missing-selector! PHLocalIdentifierMapping::error not bound -!missing-selector! PHLocalIdentifierMapping::localIdentifier not bound -!missing-selector! PHPhotoLibrary::cloudIdentifierMappingsForLocalIdentifiers: not bound -!missing-selector! PHPhotoLibrary::localIdentifierMappingsForPHPhotoLibrary: not bound -!missing-type! PHCloudIdentifier not bound -!missing-type! PHCloudIdentifierMapping not bound -!missing-type! PHLocalIdentifierMapping not bound diff --git a/tests/xtro-sharpie/macOS-Photos.todo b/tests/xtro-sharpie/macOS-Photos.todo deleted file mode 100644 index 6a3dbccbeb..0000000000 --- a/tests/xtro-sharpie/macOS-Photos.todo +++ /dev/null @@ -1,21 +0,0 @@ -!missing-enum-value! PHAssetCollectionSubtype native value PHAssetCollectionSubtypeSmartAlbumRAW = 217 not bound -!missing-enum-value! PHPhotosError native value PHPhotosErrorAccessRestricted = 3310 not bound -!missing-enum-value! PHPhotosError native value PHPhotosErrorAccessUserDenied = 3311 not bound -!missing-enum-value! PHPhotosError native value PHPhotosErrorChangeNotSupported = 3300 not bound -!missing-enum-value! PHPhotosError native value PHPhotosErrorIdentifierNotFound = 3201 not bound -!missing-enum-value! PHPhotosError native value PHPhotosErrorInvalidResource = 3302 not bound -!missing-enum-value! PHPhotosError native value PHPhotosErrorMissingResource = 3303 not bound -!missing-enum-value! PHPhotosError native value PHPhotosErrorMultipleIdentifiersFound = 3202 not bound -!missing-enum-value! PHPhotosError native value PHPhotosErrorNotEnoughSpace = 3305 not bound -!missing-enum-value! PHPhotosError native value PHPhotosErrorOperationInterrupted = 3301 not bound -!missing-enum-value! PHPhotosError native value PHPhotosErrorRequestNotSupportedForAsset = 3306 not bound -!missing-field! PHLocalIdentifiersErrorKey not bound -!missing-selector! PHAsset::adjustmentFormatIdentifier not bound -!missing-selector! PHCloudIdentifierMapping::cloudIdentifier not bound -!missing-selector! PHCloudIdentifierMapping::error not bound -!missing-selector! PHLocalIdentifierMapping::error not bound -!missing-selector! PHLocalIdentifierMapping::localIdentifier not bound -!missing-selector! PHPhotoLibrary::cloudIdentifierMappingsForLocalIdentifiers: not bound -!missing-selector! PHPhotoLibrary::localIdentifierMappingsForPHPhotoLibrary: not bound -!missing-type! PHCloudIdentifierMapping not bound -!missing-type! PHLocalIdentifierMapping not bound diff --git a/tests/xtro-sharpie/tvOS-Photos.todo b/tests/xtro-sharpie/tvOS-Photos.todo deleted file mode 100644 index 5f06bdf15d..0000000000 --- a/tests/xtro-sharpie/tvOS-Photos.todo +++ /dev/null @@ -1,24 +0,0 @@ -!missing-enum-value! PHAssetCollectionSubtype native value PHAssetCollectionSubtypeSmartAlbumRAW = 217 not bound -!missing-enum-value! PHPhotosError native value PHPhotosErrorAccessRestricted = 3310 not bound -!missing-enum-value! PHPhotosError native value PHPhotosErrorAccessUserDenied = 3311 not bound -!missing-enum-value! PHPhotosError native value PHPhotosErrorChangeNotSupported = 3300 not bound -!missing-enum-value! PHPhotosError native value PHPhotosErrorIdentifierNotFound = 3201 not bound -!missing-enum-value! PHPhotosError native value PHPhotosErrorInvalidResource = 3302 not bound -!missing-enum-value! PHPhotosError native value PHPhotosErrorMissingResource = 3303 not bound -!missing-enum-value! PHPhotosError native value PHPhotosErrorMultipleIdentifiersFound = 3202 not bound -!missing-enum-value! PHPhotosError native value PHPhotosErrorNotEnoughSpace = 3305 not bound -!missing-enum-value! PHPhotosError native value PHPhotosErrorOperationInterrupted = 3301 not bound -!missing-enum-value! PHPhotosError native value PHPhotosErrorRequestNotSupportedForAsset = 3306 not bound -!missing-field! PHLocalIdentifiersErrorKey not bound -!missing-selector! PHAsset::adjustmentFormatIdentifier not bound -!missing-selector! PHCloudIdentifier::initWithStringValue: not bound -!missing-selector! PHCloudIdentifier::stringValue not bound -!missing-selector! PHCloudIdentifierMapping::cloudIdentifier not bound -!missing-selector! PHCloudIdentifierMapping::error not bound -!missing-selector! PHLocalIdentifierMapping::error not bound -!missing-selector! PHLocalIdentifierMapping::localIdentifier not bound -!missing-selector! PHPhotoLibrary::cloudIdentifierMappingsForLocalIdentifiers: not bound -!missing-selector! PHPhotoLibrary::localIdentifierMappingsForPHPhotoLibrary: not bound -!missing-type! PHCloudIdentifier not bound -!missing-type! PHCloudIdentifierMapping not bound -!missing-type! PHLocalIdentifierMapping not bound