Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/CloudKit/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ public enum CKErrorCode : long {
/// <summary>To be added.</summary>
AssetNotAvailable = 35,
TemporarilyUnavailable = 36,
ParticipantAlreadyInvited = 37,
}

// NSInteger -> CKModifyRecordsOperation.h
Expand Down Expand Up @@ -321,6 +322,8 @@ public enum CKShareParticipantRole : long {
PrivateUser = 3,
/// <summary>To be added.</summary>
PublicUser = 4,
[MacCatalyst (26, 0), TV (26, 0), Mac (26, 0), iOS (26, 0)]
Administrator = 2,
}

[NoTV, Mac (13, 0), iOS (16, 0), MacCatalyst (16, 0)]
Expand Down Expand Up @@ -394,4 +397,10 @@ public enum CKSyncEnginePendingDatabaseChangeType : long {
DeleteZone,
}

[TV (26, 0), Mac (26, 0), MacCatalyst (26, 0), iOS (26, 0)]
[Native]
public enum CKRecordZoneEncryptionScope : long {
Record,
Zone,
}
}
108 changes: 107 additions & 1 deletion src/cloudkit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
using ObjCRuntime;
using Foundation;
using CoreLocation;
#if !TVOS
#if HAS_CONTACTS
using Contacts;
#else
using CNContact = Foundation.NSObject;
#endif

namespace CloudKit {
Expand Down Expand Up @@ -173,6 +175,35 @@ interface CKShare {

[Export ("removeParticipant:")]
void Remove (CKShareParticipant participant);

[MacCatalyst (18, 0), TV (18, 0), Mac (15, 0), iOS (18, 0)]
[Export ("oneTimeURLForParticipantID:")]
[return: NullAllowed]
NSUrl GetOneTimeUrl (string participantId);

[MacCatalyst (26, 0), TV (26, 0), Mac (26, 0), iOS (26, 0)]
[Export ("requesters", ArgumentSemantic.Copy)]
CKShareAccessRequester [] Requesters { get; }

[MacCatalyst (26, 0), TV (26, 0), Mac (26, 0), iOS (26, 0)]
[Export ("blockedIdentities", ArgumentSemantic.Copy)]
CKShareBlockedIdentity [] BlockedIdentities { get; }

[MacCatalyst (26, 0), TV (26, 0), Mac (26, 0), iOS (26, 0)]
[Export ("allowsAccessRequests")]
bool AllowsAccessRequests { get; set; }

[MacCatalyst (26, 0), TV (26, 0), Mac (26, 0), iOS (26, 0)]
[Export ("denyRequesters:")]
void DenyRequesters (CKShareAccessRequester [] requesters);

[MacCatalyst (26, 0), TV (26, 0), Mac (26, 0), iOS (26, 0)]
[Export ("blockRequesters:")]
void BlockRequesters (CKShareAccessRequester [] requesters);

[MacCatalyst (26, 0), TV (26, 0), Mac (26, 0), iOS (26, 0)]
[Export ("unblockIdentities:")]
void UnblockIdentities (CKShareBlockedIdentity [] blockedIdentities);
}

/// <summary>Constants used by various CloudKit classes.</summary>
Expand Down Expand Up @@ -227,6 +258,19 @@ interface CKShareParticipant : NSSecureCoding, NSCopying {
// This showed up in Xcode 16's b1 headers, but according to the availability attributes it's always been available.
[Export ("participantID", ArgumentSemantic.Copy)]
string ParticipantId { get; }

[MacCatalyst (26, 0), TV (26, 0), Mac (26, 0), iOS (26, 0)]
[Export ("isApprovedRequester")]
bool IsApprovedRequester { get; }

[MacCatalyst (26, 0), TV (26, 0), Mac (26, 0), iOS (26, 0)]
[NullAllowed, Export ("dateAddedToShare", ArgumentSemantic.Copy)]
NSDate DateAddedToShare { get; }

[MacCatalyst (18, 0), TV (18, 0), Mac (15, 0), iOS (18, 0)]
[Static]
[Export ("oneTimeURLParticipant")]
CKShareParticipant GetOneTimeUrlParticipant ();
}

[MacCatalyst (13, 1)]
Expand Down Expand Up @@ -1785,6 +1829,10 @@ interface CKRecordZone : NSSecureCoding, NSCopying {
[TV (15, 0), iOS (15, 0), MacCatalyst (15, 0)]
[NullAllowed, Export ("share", ArgumentSemantic.Copy)]
CKReference Share { get; }

[MacCatalyst (26, 0), TV (26, 0), Mac (26, 0), iOS (26, 0)]
[Export ("encryptionScope", ArgumentSemantic.Assign)]
CKRecordZoneEncryptionScope EncryptionScope { get; set; }
}

[MacCatalyst (13, 1)]
Expand Down Expand Up @@ -2259,6 +2307,14 @@ interface CKAllowedSharingOptions : NSSecureCoding, NSCopying {
[Static]
[Export ("standardOptions", ArgumentSemantic.Strong)]
CKAllowedSharingOptions StandardOptions { get; }

[MacCatalyst (26, 0), NoTV, Mac (26, 0), iOS (26, 0)]
[Export ("allowsParticipantsToInviteOthers")]
bool AllowsParticipantsToInviteOthers { get; set; }

[MacCatalyst (26, 0), NoTV, Mac (26, 0), iOS (26, 0)]
[Export ("allowsAccessRequests")]
bool AllowsAccessRequests { get; set; }
}

[NoTV, Mac (13, 0), iOS (16, 0), MacCatalyst (16, 0)]
Expand Down Expand Up @@ -2766,4 +2822,54 @@ interface CKSyncEnginePendingZoneDelete {
[Export ("initWithZoneID:")]
NativeHandle Constructor (CKRecordZoneID zoneId);
}

[MacCatalyst (26, 0), TV (26, 0), Mac (26, 0), iOS (26, 0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface CKShareAccessRequester : NSSecureCoding, NSCopying {
[Export ("userIdentity", ArgumentSemantic.Copy)]
CKUserIdentity UserIdentity { get; }

[Export ("participantLookupInfo", ArgumentSemantic.Copy)]
CKUserIdentityLookupInfo ParticipantLookupInfo { get; }

[NoTV]
[Export ("contact", ArgumentSemantic.Copy)]
CNContact Contact { get; }
}

[MacCatalyst (26, 0), TV (26, 0), Mac (26, 0), iOS (26, 0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface CKShareBlockedIdentity : NSSecureCoding, NSCopying {
[Export ("userIdentity", ArgumentSemantic.Copy)]
CKUserIdentity UserIdentity { get; }

[NoTV]
[Export ("contact", ArgumentSemantic.Copy)]
CNContact Contact { get; }
}

[MacCatalyst (26, 0), TV (26, 0), Mac (26, 0), iOS (26, 0)]
[BaseType (typeof (CKOperation))]
[DesignatedDefaultCtor]
interface CKShareRequestAccessOperation {

[Export ("initWithShareURLs:")]
NativeHandle Constructor (NSUrl [] shareUrls);

[NullAllowed, Export ("shareURLs", ArgumentSemantic.Copy)]
NSUrl [] ShareUrls { get; set; }

[Export ("perShareAccessRequestCompletionBlock", ArgumentSemantic.Copy)]
[NullAllowed]
CKShareRequestAccessOperationPerShareAccessRequestCompletionHandler PerShareAccessRequestCompletionBlock { get; set; }

[Export ("shareRequestAccessCompletionBlock", ArgumentSemantic.Copy)]
[NullAllowed]
CKShareRequestAccessOperationShareRequestAccessCompletionHandler ShareRequestAccessCompletionBlock { get; set; }
}

delegate void CKShareRequestAccessOperationPerShareAccessRequestCompletionHandler (NSUrl shareUrl, [NullAllowed] NSError error);
delegate void CKShareRequestAccessOperationShareRequestAccessCompletionHandler ([NullAllowed] NSError error);
}

This file was deleted.

36 changes: 0 additions & 36 deletions tests/xtro-sharpie/api-annotations-dotnet/iOS-CloudKit.todo

This file was deleted.

36 changes: 0 additions & 36 deletions tests/xtro-sharpie/api-annotations-dotnet/macOS-CloudKit.todo

This file was deleted.

30 changes: 0 additions & 30 deletions tests/xtro-sharpie/api-annotations-dotnet/tvOS-CloudKit.todo

This file was deleted.