diff --git a/src/coredata.cs b/src/coredata.cs index c9e8eea340fa..83313bca74d4 100644 --- a/src/coredata.cs +++ b/src/coredata.cs @@ -232,6 +232,10 @@ interface NSAttributeDescription { [Watch (6, 0), TV (13, 0), Mac (10, 15), iOS (13, 0)] [Export ("preservesValueInHistoryOnDeletion")] bool PreservesValueInHistoryOnDeletion { get; set; } + + [Watch (8, 0), TV (15, 0), Mac (12, 0), iOS (15, 0), MacCatalyst (15,0)] + [Export ("allowsCloudEncryption")] + bool AllowsCloudEncryption { get; set; } } [BaseType (typeof (NSObject))] @@ -1667,14 +1671,26 @@ interface NSPersistentHistoryTransaction : NSCopying [DisableDefaultCtor] // NSInternalInconsistencyException Reason: NSCoreDataCoreSpotlightDelegate requires the use of the initializer initForStoreWithDescription:model: interface NSCoreDataCoreSpotlightDelegate { + + [Notification] + [Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [Field ("NSCoreDataCoreSpotlightDelegateIndexDidUpdateNotification")] + NSString IndexDidUpdateNotification { get; } + + [Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [Export ("initForStoreWithDescription:coordinator:")] + [DesignatedInitializer] + IntPtr Constructor (NSPersistentStoreDescription description, NSPersistentStoreCoordinator psc); + [Export ("domainIdentifier")] string DomainIdentifier { get; } [NullAllowed, Export ("indexName")] string IndexName { get; } + [Deprecated (PlatformName.iOS, 15,0, message: "Use the constructor that takes a NSPersistentStoreCoordinator instead.")] + [Deprecated (PlatformName.MacOSX, 12,0, message: "Use the constructor that takes a NSPersistentStoreCoordinator instead.")] [Export ("initForStoreWithDescription:model:")] - [DesignatedInitializer] IntPtr Constructor (NSPersistentStoreDescription description, NSManagedObjectModel model); [Export ("attributeSetForObject:")] @@ -1686,6 +1702,23 @@ interface NSCoreDataCoreSpotlightDelegate [Export ("searchableIndex:reindexSearchableItemsWithIdentifiers:acknowledgementHandler:")] void ReindexSearchableItems (CSSearchableIndex searchableIndex, string[] identifiers, Action acknowledgementHandler); + + [Async] + [NoWatch, NoTV, Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [Export ("deleteSpotlightIndexWithCompletionHandler:")] + void DeleteSpotlightIndex (Action completionHandler); + + [NoWatch, NoTV, Mac (12, 0), iOS (15, 0), MacCatalyst (15,0)] + [Export ("indexingEnabled")] + bool IndexingEnabled { [Bind ("isIndexingEnabled")] get; } + + [NoWatch, NoTV, Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [Export ("startSpotlightIndexing")] + void StartSpotlightIndexing (); + + [NoWatch, NoTV, Mac (12,0), iOS (15,0),MacCatalyst (15,0)] + [Export ("stopSpotlightIndexing")] + void StopSpotlightIndexing (); } #endif @@ -2640,6 +2673,21 @@ interface NSDerivedAttributeDescription : NSSecureCoding { NSExpression DerivationExpression { get; set; } } + [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + delegate void NSPersistentCloudKitContainerShareManagedObjectsHandler (NSSet sharedObjectIds, CKShare share, CKContainer container, NSError error); + + [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + delegate void NSPersistentCloudKitContainerFetchParticipantsMatchingLookupInfosHandler (NSArray fetchedParticipants, NSError error); + + [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + delegate void NSPersistentCloudKitContainerPersistUpdatedShareHandler (CKShare persistedShare, NSError error); + + [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + delegate void NSPersistentCloudKitContainerPurgeObjectsAndRecordsInZoneHandler (CKRecordZoneID purgedZoneId, NSError error); + + [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + delegate void NSPersistentCloudKitContainerAcceptShareInvitationsHandler (NSArray acceptedShareMetadatas, NSError error); + [Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)] [BaseType (typeof(NSPersistentContainer))] [DisableDefaultCtor] @@ -2677,6 +2725,43 @@ interface NSPersistentCloudKitContainer { [Watch (7,0), TV (14,0), Mac (11,0), iOS (14,0)] [Export ("canModifyManagedObjectsInStore:")] bool CanModifyManagedObjects (NSPersistentStore store); + + // NSPersistentCloudKitContainer_Sharing + [Async (ResultTypeName = "NSPersistentCloudKitContainerAcceptShareInvitationsResult")] + [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [Export ("acceptShareInvitationsFromMetadata:intoPersistentStore:completion:")] + void AcceptShareInvitations (CKShareMetadata[] metadata, NSPersistentStore persistentStore, [NullAllowed] NSPersistentCloudKitContainerAcceptShareInvitationsHandler handler); + + [Async (ResultTypeName = "NSPersistentCloudKitContainerPurgeObjectsAndRecordsInZone")] + [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [Export ("purgeObjectsAndRecordsInZoneWithID:inPersistentStore:completion:")] + void PurgeObjectsAndRecordsInZone (CKRecordZoneID zoneId, [NullAllowed] NSPersistentStore persistentStore, [NullAllowed] NSPersistentCloudKitContainerPurgeObjectsAndRecordsInZoneHandler handler); + + [Async (ResultTypeName = "NSPersistentCloudKitContainerPersistUpdatedShareResult")] + [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [Export ("persistUpdatedShare:inPersistentStore:completion:")] + void PersistUpdatedShare (CKShare share, NSPersistentStore persistentStore, [NullAllowed] NSPersistentCloudKitContainerPersistUpdatedShareHandler handler); + + [Async (ResultTypeName = "NSPersistentCloudKitContainerFetchParticipantsMatchingLookupInfosResult")] + [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [Export ("fetchParticipantsMatchingLookupInfos:intoPersistentStore:completion:")] + void FetchParticipantsMatchingLookupInfos (CKUserIdentityLookupInfo[] lookupInfos, NSPersistentStore persistentStore, NSPersistentCloudKitContainerFetchParticipantsMatchingLookupInfosHandler handler); + + [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [Export ("fetchSharesMatchingObjectIDs:error:")] + [return: NullAllowed] + NSDictionary FetchSharesMatchingObjectIds (NSManagedObjectID[] objectIDs, [NullAllowed] out NSError error); + + [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [Export ("fetchSharesInPersistentStore:error:")] + [return: NullAllowed] + CKShare[] FetchSharesInPersistentStore ([NullAllowed] NSPersistentStore persistentStore, [NullAllowed] out NSError error); + + [Async (ResultTypeName = "NSPersistentCloudKitContainerShareManagedObjectsResult")] + [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] + [Export ("shareManagedObjects:toShare:completion:")] + void ShareManagedObjects (NSManagedObject[] managedObjects, [NullAllowed] CKShare share, NSPersistentCloudKitContainerShareManagedObjectsHandler handler); + } [Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)] diff --git a/tests/xtro-sharpie/MacCatalyst-CoreData.ignore b/tests/xtro-sharpie/MacCatalyst-CoreData.ignore index 853810a59ab6..3778c323c941 100644 --- a/tests/xtro-sharpie/MacCatalyst-CoreData.ignore +++ b/tests/xtro-sharpie/MacCatalyst-CoreData.ignore @@ -1,2 +1,16 @@ # NSInternalInconsistencyException Reason: -init results in undefined behavior for NSBatchInsertRequest !missing-selector! NSBatchInsertRequest::init not bound + +# ignored as well in macOS +!missing-field! NSBinaryExternalRecordType not bound +!missing-field! NSEntityNameInPathKey not bound +!missing-field! NSExternalRecordExtensionOption not bound +!missing-field! NSExternalRecordsDirectoryOption not bound +!missing-field! NSExternalRecordsFileFormatOption not bound +!missing-field! NSModelPathKey not bound +!missing-field! NSObjectURIKey not bound +!missing-field! NSStorePathKey not bound +!missing-field! NSStoreUUIDInPathKey not bound +!missing-field! NSValidateXMLStoreOption not bound +!missing-field! NSXMLExternalRecordType not bound +!missing-field! NSXMLStoreType not bound diff --git a/tests/xtro-sharpie/MacCatalyst-CoreData.todo b/tests/xtro-sharpie/MacCatalyst-CoreData.todo deleted file mode 100644 index af15dac4607f..000000000000 --- a/tests/xtro-sharpie/MacCatalyst-CoreData.todo +++ /dev/null @@ -1,34 +0,0 @@ -!missing-field! NSBinaryExternalRecordType not bound -!missing-field! NSEntityNameInPathKey not bound -!missing-field! NSExternalRecordExtensionOption not bound -!missing-field! NSExternalRecordsDirectoryOption not bound -!missing-field! NSExternalRecordsFileFormatOption not bound -!missing-field! NSModelPathKey not bound -!missing-field! NSObjectURIKey not bound -!missing-field! NSStorePathKey not bound -!missing-field! NSStoreUUIDInPathKey not bound -!missing-field! NSValidateXMLStoreOption not bound -!missing-field! NSXMLExternalRecordType not bound -!missing-field! NSXMLStoreType not bound -!missing-protocol-member! NSFetchedResultsControllerDelegate::controller:didChangeContentWithDifference: not found -!missing-protocol-member! NSFetchedResultsControllerDelegate::controller:didChangeContentWithSnapshot: not found -!missing-selector! +NSPersistentStoreCoordinator::elementsDerivedFromExternalRecordURL: not bound -!missing-selector! +NSPersistentStoreCoordinator::metadataForPersistentStoreWithURL:error: not bound -!missing-selector! NSPersistentStoreCoordinator::importStoreWithIdentifier:fromExternalRecordsDirectory:toURL:options:withType:error: not bound -## appended from unclassified file -!extra-designated-initializer! NSCoreDataCoreSpotlightDelegate::initForStoreWithDescription:model: is incorrectly decorated with an [DesignatedInitializer] attribute -!missing-field! NSCoreDataCoreSpotlightDelegateIndexDidUpdateNotification not bound -!missing-selector! NSAttributeDescription::allowsCloudEncryption not bound -!missing-selector! NSAttributeDescription::setAllowsCloudEncryption: not bound -!missing-selector! NSCoreDataCoreSpotlightDelegate::deleteSpotlightIndexWithCompletionHandler: not bound -!missing-selector! NSCoreDataCoreSpotlightDelegate::initForStoreWithDescription:coordinator: not bound -!missing-selector! NSCoreDataCoreSpotlightDelegate::isIndexingEnabled not bound -!missing-selector! NSCoreDataCoreSpotlightDelegate::startSpotlightIndexing not bound -!missing-selector! NSCoreDataCoreSpotlightDelegate::stopSpotlightIndexing not bound -!missing-selector! NSPersistentCloudKitContainer::acceptShareInvitationsFromMetadata:intoPersistentStore:completion: not bound -!missing-selector! NSPersistentCloudKitContainer::fetchParticipantsMatchingLookupInfos:intoPersistentStore:completion: not bound -!missing-selector! NSPersistentCloudKitContainer::fetchSharesInPersistentStore:error: not bound -!missing-selector! NSPersistentCloudKitContainer::fetchSharesMatchingObjectIDs:error: not bound -!missing-selector! NSPersistentCloudKitContainer::persistUpdatedShare:inPersistentStore:completion: not bound -!missing-selector! NSPersistentCloudKitContainer::purgeObjectsAndRecordsInZoneWithID:inPersistentStore:completion: not bound -!missing-selector! NSPersistentCloudKitContainer::shareManagedObjects:toShare:completion: not bound diff --git a/tests/xtro-sharpie/common-CoreData.ignore b/tests/xtro-sharpie/common-CoreData.ignore index 97ee4ac47cb1..4f2d6a85b27a 100644 --- a/tests/xtro-sharpie/common-CoreData.ignore +++ b/tests/xtro-sharpie/common-CoreData.ignore @@ -40,3 +40,11 @@ # by-ref argument, cannot be null !extra-null-allowed! 'System.Boolean CoreData.NSManagedObject::ValidateValue(Foundation.NSObject&,System.String,Foundation.NSError&)' has a extraneous [NullAllowed] on parameter #0 + +# waiting for changes in foundation which are not trivial +!missing-protocol-member! NSFetchedResultsControllerDelegate::controller:didChangeContentWithDifference: not found +!missing-protocol-member! NSFetchedResultsControllerDelegate::controller:didChangeContentWithSnapshot: not found + +!missing-selector! +NSPersistentStoreCoordinator::elementsDerivedFromExternalRecordURL: not bound +!missing-selector! +NSPersistentStoreCoordinator::metadataForPersistentStoreWithURL:error: not bound +!missing-selector! NSPersistentStoreCoordinator::importStoreWithIdentifier:fromExternalRecordsDirectory:toURL:options:withType:error: not bound diff --git a/tests/xtro-sharpie/iOS-CoreData.ignore b/tests/xtro-sharpie/iOS-CoreData.ignore deleted file mode 100644 index 75d802a34b0a..000000000000 --- a/tests/xtro-sharpie/iOS-CoreData.ignore +++ /dev/null @@ -1,3 +0,0 @@ -# ignored due to missing types due to https://github.com/xamarin/xamarin-macios/issues/6567 -!missing-protocol-member! NSFetchedResultsControllerDelegate::controller:didChangeContentWithDifference: not found -!missing-protocol-member! NSFetchedResultsControllerDelegate::controller:didChangeContentWithSnapshot: not found diff --git a/tests/xtro-sharpie/iOS-CoreData.todo b/tests/xtro-sharpie/iOS-CoreData.todo deleted file mode 100644 index 59e35afa874f..000000000000 --- a/tests/xtro-sharpie/iOS-CoreData.todo +++ /dev/null @@ -1,17 +0,0 @@ -!deprecated-attribute-missing! NSCoreDataCoreSpotlightDelegate::initForStoreWithDescription:model: missing a [Deprecated] attribute -!extra-designated-initializer! NSCoreDataCoreSpotlightDelegate::initForStoreWithDescription:model: is incorrectly decorated with an [DesignatedInitializer] attribute -!missing-field! NSCoreDataCoreSpotlightDelegateIndexDidUpdateNotification not bound -!missing-selector! NSAttributeDescription::allowsCloudEncryption not bound -!missing-selector! NSAttributeDescription::setAllowsCloudEncryption: not bound -!missing-selector! NSCoreDataCoreSpotlightDelegate::deleteSpotlightIndexWithCompletionHandler: not bound -!missing-selector! NSCoreDataCoreSpotlightDelegate::initForStoreWithDescription:coordinator: not bound -!missing-selector! NSCoreDataCoreSpotlightDelegate::isIndexingEnabled not bound -!missing-selector! NSCoreDataCoreSpotlightDelegate::startSpotlightIndexing not bound -!missing-selector! NSCoreDataCoreSpotlightDelegate::stopSpotlightIndexing not bound -!missing-selector! NSPersistentCloudKitContainer::acceptShareInvitationsFromMetadata:intoPersistentStore:completion: not bound -!missing-selector! NSPersistentCloudKitContainer::fetchParticipantsMatchingLookupInfos:intoPersistentStore:completion: not bound -!missing-selector! NSPersistentCloudKitContainer::fetchSharesInPersistentStore:error: not bound -!missing-selector! NSPersistentCloudKitContainer::fetchSharesMatchingObjectIDs:error: not bound -!missing-selector! NSPersistentCloudKitContainer::persistUpdatedShare:inPersistentStore:completion: not bound -!missing-selector! NSPersistentCloudKitContainer::purgeObjectsAndRecordsInZoneWithID:inPersistentStore:completion: not bound -!missing-selector! NSPersistentCloudKitContainer::shareManagedObjects:toShare:completion: not bound diff --git a/tests/xtro-sharpie/macOS-CoreData.ignore b/tests/xtro-sharpie/macOS-CoreData.ignore index 7eb2ece4be28..5e0a0918bd03 100644 --- a/tests/xtro-sharpie/macOS-CoreData.ignore +++ b/tests/xtro-sharpie/macOS-CoreData.ignore @@ -11,7 +11,6 @@ !missing-protocol! NSFetchedResultsControllerDelegate not bound !missing-protocol! NSFetchedResultsSectionInfo not bound !missing-selector! +NSFetchedResultsController::deleteCacheWithName: not bound -!missing-selector! +NSPersistentStoreCoordinator::elementsDerivedFromExternalRecordURL: not bound !missing-selector! NSFetchedResultsController::cacheName not bound !missing-selector! NSFetchedResultsController::delegate not bound !missing-selector! NSFetchedResultsController::fetchedObjects not bound @@ -27,5 +26,4 @@ !missing-selector! NSFetchedResultsController::sectionNameKeyPath not bound !missing-selector! NSFetchedResultsController::sections not bound !missing-selector! NSFetchedResultsController::setDelegate: not bound -!missing-selector! NSPersistentStoreCoordinator::importStoreWithIdentifier:fromExternalRecordsDirectory:toURL:options:withType:error: not bound !missing-type! NSFetchedResultsController not bound diff --git a/tests/xtro-sharpie/macOS-CoreData.todo b/tests/xtro-sharpie/macOS-CoreData.todo deleted file mode 100644 index 164293eb6c05..000000000000 --- a/tests/xtro-sharpie/macOS-CoreData.todo +++ /dev/null @@ -1,16 +0,0 @@ -!extra-designated-initializer! NSCoreDataCoreSpotlightDelegate::initForStoreWithDescription:model: is incorrectly decorated with an [DesignatedInitializer] attribute -!missing-field! NSCoreDataCoreSpotlightDelegateIndexDidUpdateNotification not bound -!missing-selector! NSAttributeDescription::allowsCloudEncryption not bound -!missing-selector! NSAttributeDescription::setAllowsCloudEncryption: not bound -!missing-selector! NSCoreDataCoreSpotlightDelegate::deleteSpotlightIndexWithCompletionHandler: not bound -!missing-selector! NSCoreDataCoreSpotlightDelegate::initForStoreWithDescription:coordinator: not bound -!missing-selector! NSCoreDataCoreSpotlightDelegate::isIndexingEnabled not bound -!missing-selector! NSCoreDataCoreSpotlightDelegate::startSpotlightIndexing not bound -!missing-selector! NSCoreDataCoreSpotlightDelegate::stopSpotlightIndexing not bound -!missing-selector! NSPersistentCloudKitContainer::acceptShareInvitationsFromMetadata:intoPersistentStore:completion: not bound -!missing-selector! NSPersistentCloudKitContainer::fetchParticipantsMatchingLookupInfos:intoPersistentStore:completion: not bound -!missing-selector! NSPersistentCloudKitContainer::fetchSharesInPersistentStore:error: not bound -!missing-selector! NSPersistentCloudKitContainer::fetchSharesMatchingObjectIDs:error: not bound -!missing-selector! NSPersistentCloudKitContainer::persistUpdatedShare:inPersistentStore:completion: not bound -!missing-selector! NSPersistentCloudKitContainer::purgeObjectsAndRecordsInZoneWithID:inPersistentStore:completion: not bound -!missing-selector! NSPersistentCloudKitContainer::shareManagedObjects:toShare:completion: not bound diff --git a/tests/xtro-sharpie/tvOS-CoreData.ignore b/tests/xtro-sharpie/tvOS-CoreData.ignore deleted file mode 100644 index 75d802a34b0a..000000000000 --- a/tests/xtro-sharpie/tvOS-CoreData.ignore +++ /dev/null @@ -1,3 +0,0 @@ -# ignored due to missing types due to https://github.com/xamarin/xamarin-macios/issues/6567 -!missing-protocol-member! NSFetchedResultsControllerDelegate::controller:didChangeContentWithDifference: not found -!missing-protocol-member! NSFetchedResultsControllerDelegate::controller:didChangeContentWithSnapshot: not found diff --git a/tests/xtro-sharpie/tvOS-CoreData.todo b/tests/xtro-sharpie/tvOS-CoreData.todo deleted file mode 100644 index b685a37d7746..000000000000 --- a/tests/xtro-sharpie/tvOS-CoreData.todo +++ /dev/null @@ -1,9 +0,0 @@ -!missing-selector! NSAttributeDescription::allowsCloudEncryption not bound -!missing-selector! NSAttributeDescription::setAllowsCloudEncryption: not bound -!missing-selector! NSPersistentCloudKitContainer::acceptShareInvitationsFromMetadata:intoPersistentStore:completion: not bound -!missing-selector! NSPersistentCloudKitContainer::fetchParticipantsMatchingLookupInfos:intoPersistentStore:completion: not bound -!missing-selector! NSPersistentCloudKitContainer::fetchSharesInPersistentStore:error: not bound -!missing-selector! NSPersistentCloudKitContainer::fetchSharesMatchingObjectIDs:error: not bound -!missing-selector! NSPersistentCloudKitContainer::persistUpdatedShare:inPersistentStore:completion: not bound -!missing-selector! NSPersistentCloudKitContainer::purgeObjectsAndRecordsInZoneWithID:inPersistentStore:completion: not bound -!missing-selector! NSPersistentCloudKitContainer::shareManagedObjects:toShare:completion: not bound diff --git a/tests/xtro-sharpie/watchOS-CoreData.ignore b/tests/xtro-sharpie/watchOS-CoreData.ignore deleted file mode 100644 index 75d802a34b0a..000000000000 --- a/tests/xtro-sharpie/watchOS-CoreData.ignore +++ /dev/null @@ -1,3 +0,0 @@ -# ignored due to missing types due to https://github.com/xamarin/xamarin-macios/issues/6567 -!missing-protocol-member! NSFetchedResultsControllerDelegate::controller:didChangeContentWithDifference: not found -!missing-protocol-member! NSFetchedResultsControllerDelegate::controller:didChangeContentWithSnapshot: not found diff --git a/tests/xtro-sharpie/watchOS-CoreData.todo b/tests/xtro-sharpie/watchOS-CoreData.todo deleted file mode 100644 index b685a37d7746..000000000000 --- a/tests/xtro-sharpie/watchOS-CoreData.todo +++ /dev/null @@ -1,9 +0,0 @@ -!missing-selector! NSAttributeDescription::allowsCloudEncryption not bound -!missing-selector! NSAttributeDescription::setAllowsCloudEncryption: not bound -!missing-selector! NSPersistentCloudKitContainer::acceptShareInvitationsFromMetadata:intoPersistentStore:completion: not bound -!missing-selector! NSPersistentCloudKitContainer::fetchParticipantsMatchingLookupInfos:intoPersistentStore:completion: not bound -!missing-selector! NSPersistentCloudKitContainer::fetchSharesInPersistentStore:error: not bound -!missing-selector! NSPersistentCloudKitContainer::fetchSharesMatchingObjectIDs:error: not bound -!missing-selector! NSPersistentCloudKitContainer::persistUpdatedShare:inPersistentStore:completion: not bound -!missing-selector! NSPersistentCloudKitContainer::purgeObjectsAndRecordsInZoneWithID:inPersistentStore:completion: not bound -!missing-selector! NSPersistentCloudKitContainer::shareManagedObjects:toShare:completion: not bound