Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Foundation] Add support for Xcode 15 beta 7. #19007

Merged
merged 11 commits into from
Oct 17, 2023
8 changes: 8 additions & 0 deletions src/Foundation/Enum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ public enum NSNetServicesStatus : long {
MissingRequiredConfigurationError = -72008,
}

#if XAMCORE_5_0
[NoWatch]
#endif
[Flags]
[Native]
public enum NSNetServiceOptions : ulong {
Expand Down Expand Up @@ -279,6 +282,8 @@ public enum NSDataWritingOptions : ulong {
[Mac (11, 0)]
[MacCatalyst (13, 1)]
FileProtectionCompleteUntilFirstUserAuthentication = 0x40000000,
[iOS (17, 0), NoMac, MacCatalyst (17, 0), TV (17, 0), Watch (10, 0)]
FileProtectionCompleteWhenUserInactive = 0x50000000,
}

public delegate void NSSetEnumerator (NSObject obj, ref bool stop);
Expand Down Expand Up @@ -1380,6 +1385,9 @@ public enum NSFileProtectionType {
CompleteUnlessOpen,
[Field ("NSFileProtectionCompleteUntilFirstUserAuthentication")]
CompleteUntilFirstUserAuthentication,
[Watch (10, 0), TV (17, 0), NoMac, iOS (17, 0), MacCatalyst (17, 0)]
[Field ("NSFileProtectionCompleteWhenUserInactive")]
CompleteWhenUserInactive,
[Field ("NSFileProtectionNone")]
None,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a breaking change

image

Suggested change
[Watch (10, 0), TV (17, 0), NoMac, iOS (17, 0), MacCatalyst (17, 0)]
[Field ("NSFileProtectionCompleteWhenUserInactive")]
CompleteWhenUserInactive,
[Field ("NSFileProtectionNone")]
None,
[Field ("NSFileProtectionNone")]
None,
[Watch (10, 0), TV (17, 0), NoMac, iOS (17, 0), MacCatalyst (17, 0)]
[Field ("NSFileProtectionCompleteWhenUserInactive")]
CompleteWhenUserInactive,

}
Expand Down
205 changes: 205 additions & 0 deletions src/foundation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,73 @@ public enum NSAttributedStringNameKey {

[Field ("NSReplacementIndexAttributeName")]
ReplacementIndex,

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Field ("NSInflectionAgreementArgumentAttributeName")]
InflectionAgreementArgument,

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Field ("NSInflectionAgreementConceptAttributeName")]
InflectionAgreementConcept,

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Field ("NSInflectionReferentConceptAttributeName")]
InflectionReferentConcept,

}

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Native]
public enum NSGrammaticalCase : long {
NotSet = 0,
Nominative,
Accusative,
Dative,
Genitive,
Prepositional,
Ablative,
Adessive,
Allative,
Elative,
Illative,
Essive,
Inessive,
Locative,
Translative,
}

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Native]
public enum NSGrammaticalPronounType : long {
NotSet = 0,
Personal,
Reflexive,
Possessive,
}

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Native]
public enum NSGrammaticalDefiniteness : long {
NotSet = 0,
Indefinite,
Definite,
}

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Native]
public enum NSGrammaticalDetermination : long {
NotSet = 0,
Independent,
Dependent,
}

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Native]
public enum NSGrammaticalPerson : long {
NotSet = 0,
First,
Second,
Third,
}

[NoWatch]
Expand Down Expand Up @@ -4460,6 +4527,10 @@ interface NSError : NSSecureCoding, NSCopying {
[Field ("NSNetServicesErrorDomain")]
NSString NSNetServicesErrorDomain { get; }

[NoWatch]
[Field ("NSNetServicesErrorCode")]
NSString NSNetServicesErrorCode { get; }

[Field ("NSStreamSocketSSLErrorDomain")]
NSString NSStreamSocketSSLErrorDomain { get; }

Expand Down Expand Up @@ -5233,6 +5304,14 @@ interface NSLocale : NSSecureCoding, NSCopying {
[Export ("localizedStringForCalendarIdentifier:")]
[return: NullAllowed]
string GetLocalizedCalendarIdentifier (string calendarIdentifier);

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Export ("languageIdentifier")]
string LanguageIdentifier { get; }

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[NullAllowed, Export ("regionCode")]
string RegionCode { get; }
}

delegate void NSMatchEnumerator (NSTextCheckingResult result, NSMatchingFlags flags, ref bool stop);
Expand Down Expand Up @@ -6183,6 +6262,12 @@ partial interface NSUrl : NSSecureCoding, NSCopying
[Static]
NSUrl _FromStringRelative (string url, NSUrl relative);

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Static]
[Export ("URLWithString:encodingInvalidCharacters:")]
[return: NullAllowed]
NSUrl FromStringEncoded (string url, bool encodingInvalidCharacters);
rolfbjarne marked this conversation as resolved.
Show resolved Hide resolved

[Export ("absoluteString")]
[NullAllowed]
string AbsoluteString { get; }
Expand Down Expand Up @@ -6897,6 +6982,14 @@ partial interface NSUrl : NSSecureCoding, NSCopying
[Field ("NSURLFileProtectionCompleteUntilFirstUserAuthentication")]
NSString FileProtectionCompleteUntilFirstUserAuthentication { get; }

[Watch (10, 0), TV (17, 0), NoMac, iOS (17, 0), MacCatalyst (17, 0)]
[Field ("NSURLFileProtectionCompleteWhenUserInactive")]
NSString FileProtectionCompleteWhenUserInactive { get; }

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Field ("NSURLDirectoryEntryCountKey")]
NSString DirectoryEntryCountKey { get; }

[Watch (7, 0)]
[TV (14, 0)]
[Mac (11, 0)]
Expand Down Expand Up @@ -7096,6 +7189,12 @@ partial interface NSUrlComponents : NSCopying {
[Static, Export ("componentsWithString:")]
NSUrlComponents FromString (string urlString);

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Static]
[Export ("componentsWithString:encodingInvalidCharacters:")]
[return: NullAllowed]
NSUrlComponents FromStringEncoded (string url, bool encodingInvalidCharacters);
rolfbjarne marked this conversation as resolved.
Show resolved Hide resolved

[Export ("URL")]
NSUrl Url { get; }

Expand Down Expand Up @@ -7743,6 +7842,17 @@ partial interface NSUrlSession {
[MacCatalyst (13, 1)]
[Export ("webSocketTaskWithRequest:")]
NSUrlSessionWebSocketTask CreateWebSocketTask (NSUrlRequest request);

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Export ("uploadTaskWithResumeData:")]
mandel-macaque marked this conversation as resolved.
Show resolved Hide resolved
[return: ForcedType]
NSUrlSessionUploadTask CreateUploadTask (NSData resumeData);

[Async (ResultTypeName = "NSUrlSessionUploadTaskResumeRequest")]
[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Export ("uploadTaskWithResumeData:completionHandler:")]
mandel-macaque marked this conversation as resolved.
Show resolved Hide resolved
[return: ForcedType]
NSUrlSessionUploadTask CreateUploadTask (NSData resumeData, Action<NSData, NSUrlResponse, NSError> completionHandler);
}

[MacCatalyst (13, 1)]
Expand Down Expand Up @@ -7930,6 +8040,15 @@ partial interface NSUrlSessionUploadTask {
[Deprecated (PlatformName.MacCatalyst, 13, 1, message: "Use 'NSURLSession.CreateUploadTask' instead.")]
[Export ("init")]
NativeHandle Constructor ();

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Field ("NSURLSessionUploadTaskResumeData")]
NSString ResumeDataKey { get; }

[Async]
[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Export ("cancelByProducingResumeData:")]
void CancelByProducingResumeData (Action<NSData> completionHandler);
}

[MacCatalyst (13, 1)]
Expand Down Expand Up @@ -8196,6 +8315,14 @@ partial interface NSUrlSessionTaskDelegate {
[MacCatalyst (16, 0)]
[Export ("URLSession:didCreateTask:")]
void DidCreateTask (NSUrlSession session, NSUrlSessionTask task);

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Export ("URLSession:task:didReceiveInformationalResponse:")]
void DidReceiveInformationalResponse (NSUrlSession session, NSUrlSessionTask task, NSHttpUrlResponse response);

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Export ("URLSession:task:needNewBodyStreamFromOffset:completionHandler:")]
void NeedNewBodyStream (NSUrlSession session, NSUrlSessionTask task, long offset, Action<NSInputStream> completionHandler);
tj-devel709 marked this conversation as resolved.
Show resolved Hide resolved
}

[MacCatalyst (13, 1)]
Expand Down Expand Up @@ -17874,10 +18001,20 @@ interface NSMorphology : NSCopying, NSSecureCoding {
[Export ("number", ArgumentSemantic.Assign)]
NSGrammaticalNumber Number { get; set; }

[Obsoleted (PlatformName.MacOSX, 14, 0, message: "Use 'NSTermOfAddress' instead.")]
[Obsoleted (PlatformName.iOS, 17, 0, message: "Use 'NSTermOfAddress' instead.")]
mandel-macaque marked this conversation as resolved.
Show resolved Hide resolved
[Obsoleted (PlatformName.MacCatalyst, 17, 0, message: "Use 'NSTermOfAddress' instead.")]
[Obsoleted (PlatformName.TvOS, 17, 0, message: "Use 'NSTermOfAddress' instead.")]
[Obsoleted (PlatformName.WatchOS, 10, 0, message: "Use 'NSTermOfAddress' instead.")]
[Export ("customPronounForLanguage:")]
[return: NullAllowed]
NSMorphologyCustomPronoun GetCustomPronoun (string language);

[Obsoleted (PlatformName.MacOSX, 14, 0, message: "Use 'NSTermOfAddress' instead.")]
[Obsoleted (PlatformName.iOS, 17, 0, message: "Use 'NSTermOfAddress' instead.")]
mandel-macaque marked this conversation as resolved.
Show resolved Hide resolved
[Obsoleted (PlatformName.MacCatalyst, 17, 0, message: "Use 'NSTermOfAddress' instead.")]
[Obsoleted (PlatformName.TvOS, 17, 0, message: "Use 'NSTermOfAddress' instead.")]
[Obsoleted (PlatformName.WatchOS, 10, 0, message: "Use 'NSTermOfAddress' instead.")]
[Export ("setCustomPronoun:forLanguage:error:")]
bool SetCustomPronoun ([NullAllowed] NSMorphologyCustomPronoun features, string language, [NullAllowed] out NSError error);

Expand All @@ -17887,8 +18024,33 @@ interface NSMorphology : NSCopying, NSSecureCoding {
[Static]
[Export ("userMorphology")]
NSMorphology UserMorphology { get; }

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Export ("grammaticalCase", ArgumentSemantic.Assign)]
NSGrammaticalCase GrammaticalCase { get; set; }

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Export ("determination", ArgumentSemantic.Assign)]
NSGrammaticalDetermination Determination { get; set; }

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Export ("grammaticalPerson", ArgumentSemantic.Assign)]
NSGrammaticalPerson GrammaticalPerson { get; set; }

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Export ("pronounType", ArgumentSemantic.Assign)]
NSGrammaticalPronounType PronounType { get; set; }

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Export ("definiteness", ArgumentSemantic.Assign)]
NSGrammaticalDefiniteness Definiteness { get; set; }
}

[Obsoleted (PlatformName.MacOSX, 14, 0, message: "Use 'NSTermOfAddress' instead.")]
[Obsoleted (PlatformName.iOS, 17, 0, message: "Use 'NSTermOfAddress' instead.")]
mandel-macaque marked this conversation as resolved.
Show resolved Hide resolved
[Obsoleted (PlatformName.MacCatalyst, 17, 0, message: "Use 'NSTermOfAddress' instead.")]
[Obsoleted (PlatformName.TvOS, 17, 0, message: "Use 'NSTermOfAddress' instead.")]
[Obsoleted (PlatformName.WatchOS, 10, 0, message: "Use 'NSTermOfAddress' instead.")]
[Watch (8, 0), TV (15, 0), Mac (12, 0), iOS (15, 0), MacCatalyst (15, 0)]
[BaseType (typeof (NSObject))]
interface NSMorphologyCustomPronoun : NSCopying, NSSecureCoding {
Expand Down Expand Up @@ -18033,4 +18195,47 @@ interface NSAttributedStringMarkdownSourcePosition : NSCopying, NSSecureCoding {
NSRange RangeInString (string @string);
}

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface NSTermOfAddress : NSCopying, NSSecureCoding {
[Static]
[Export ("neutral")]
NSTermOfAddress Neutral { get; }

[Static]
[Export ("feminine")]
NSTermOfAddress Feminine { get; }

[Static]
[Export ("masculine")]
NSTermOfAddress Masculine { get; }

[Static]
[Export ("localizedForLanguageIdentifier:withPronouns:")]
NSTermOfAddress GetLocalized (string language, NSMorphologyPronoun [] pronouns);

[NullAllowed, Export ("languageIdentifier")]
string LanguageIdentifier { get; }

[NullAllowed, Export ("pronouns", ArgumentSemantic.Copy)]
NSMorphologyPronoun [] Pronouns { get; }
}

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface NSMorphologyPronoun : NSCopying, NSSecureCoding {
[Export ("initWithPronoun:morphology:dependentMorphology:")]
NativeHandle Constructor (string pronoun, NSMorphology morphology, [NullAllowed] NSMorphology dependentMorphology);

[Export ("pronoun")]
string Pronoun { get; }

[Export ("morphology", ArgumentSemantic.Copy)]
NSMorphology Morphology { get; }

[NullAllowed, Export ("dependentMorphology", ArgumentSemantic.Copy)]
NSMorphology DependentMorphology { get; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@
!missing-field! NSMallocException not bound
!missing-field! NSMaximumKeyValueOperator not bound
!missing-field! NSMinimumKeyValueOperator not bound
!missing-field! NSNetServicesErrorCode not bound
!missing-field! NSObjectInaccessibleException not bound
!missing-field! NSObjectNotAvailableException not bound
!missing-field! NSOldStyleException not bound
Expand Down Expand Up @@ -1351,6 +1350,15 @@
!missing-selector! NSString::initWithValidatedFormat:validFormatSpecifiers:error: not bound
!missing-selector! NSString::initWithValidatedFormat:validFormatSpecifiers:locale:arguments:error: not bound
!missing-selector! NSString::initWithValidatedFormat:validFormatSpecifiers:locale:error: not bound
!missing-selector! NSAttributedString::initWithFormat:options:locale:context: not bound
!missing-selector! NSAttributedString::initWithFormat:options:locale:context:arguments: not bound
!missing-selector! NSAttributedString::initWithFormat:options:locale: not bound
!missing-selector! NSAttributedString::initWithFormat:options:locale:arguments: not bound
!missing-selector! +NSAttributedString::localizedAttributedStringWithFormat:context: not bound
!missing-selector! +NSAttributedString::localizedAttributedStringWithFormat:options:context: not bound
!missing-selector! +NSAttributedString::localizedAttributedStringWithFormat: not bound
!missing-selector! +NSAttributedString::localizedAttributedStringWithFormat:options: not bound
!missing-selector! NSMutableAttributedString::appendLocalizedFormat: not bound

# https://github.com/xamarin/xamarin-macios/issues/15577
!missing-selector! +NSOrderedCollectionChange::changeWithObject:type:index: not bound
Expand Down Expand Up @@ -1382,3 +1390,10 @@
!missing-selector! NSOrderedSet::orderedSetByApplyingDifference: not bound
!missing-type! NSOrderedCollectionChange not bound
!missing-type! NSOrderedCollectionDifference not bound

# we provide a static method instead of the constructor since there are two of them
!missing-selector! NSURL::initWithString:encodingInvalidCharacters: not bound
!missing-selector! NSURLComponents::initWithString:encodingInvalidCharacters: not bound

# it is used in the selectors that support vargs and thefore cannot be used with out bindings
!missing-field! NSInflectionConceptsKey not bound
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@
!missing-selector! NSXPCInterface::setInterface:forSelector:argumentIndex:ofReply: not bound

## does not exists in iOS as a type - but some API refers to it (messy)
!unknown-type! NSPortMessage bound
!unknown-type! NSPortMessage bound

# we provide a static method since we already have a constructor with the same params
!missing-selector! NSURLComponents::initWithString:encodingInvalidCharacters: not bound
Loading
Loading