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
51 changes: 51 additions & 0 deletions src/foundation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18800,6 +18800,57 @@ interface NSPredicate : NSSecureCoding, NSCopying {
[MacCatalyst (13, 1)]
[Export ("allowEvaluation")]
void AllowEvaluation ();

/// <summary>Validates this predicate using the specified validator and, if valid, allows it to be evaluated.</summary>
/// <param name="validator">The <see cref="INSPredicateValidating" /> object used to validate the predicate before allowing evaluation.</param>
/// <param name="error">When this method returns <see langword="false" />, contains an <see cref="NSError" /> describing the validation failure; otherwise, <see langword="null" />.</param>
/// <returns><see langword="true" /> if the predicate passed validation and is now allowed to be evaluated; otherwise, <see langword="false" />.</returns>
[iOS (26, 4), TV (26, 4), Mac (26, 4), MacCatalyst (26, 4)]
[Export ("allowEvaluationWithValidator:error:")]
bool AllowEvaluation (INSPredicateValidating validator, [NullAllowed] out NSError error);
}

/// <summary>Protocol interface that represents the methods declared by the <see cref="NSPredicateValidating" /> protocol.</summary>
interface INSPredicateValidating { }

/// <summary>Provides custom validation logic for <see cref="NSPredicate" /> and <see cref="NSExpression" /> objects before they are evaluated.</summary>
/// <remarks>
/// <para>Implement this protocol to control which predicates and expressions are considered safe for evaluation. Each visitor method is called during
/// validation, allowing the implementation to inspect and approve or reject individual components of a predicate tree.</para>
/// </remarks>
[iOS (26, 4), TV (26, 4), Mac (26, 4), MacCatalyst (26, 4)]
[Protocol (BackwardsCompatibleCodeGeneration = false), Model]
[BaseType (typeof (NSObject))]
interface NSPredicateValidating {
/// <summary>Validates whether the specified predicate is allowed to be evaluated.</summary>
/// <param name="predicate">The <see cref="NSPredicate" /> to validate.</param>
/// <param name="error">When this method returns <see langword="false" />, contains an <see cref="NSError" /> describing why the predicate was rejected; otherwise, <see langword="null" />.</param>
/// <returns><see langword="true" /> if the predicate is valid and allowed; otherwise, <see langword="false" />.</returns>
[Export ("visitPredicate:error:")]
bool VisitPredicate (NSPredicate predicate, [NullAllowed] out NSError error);

/// <summary>Validates whether the specified expression is allowed to be evaluated.</summary>
/// <param name="expression">The <see cref="NSExpression" /> to validate.</param>
/// <param name="error">When this method returns <see langword="false" />, contains an <see cref="NSError" /> describing why the expression was rejected; otherwise, <see langword="null" />.</param>
/// <returns><see langword="true" /> if the expression is valid and allowed; otherwise, <see langword="false" />.</returns>
[Export ("visitExpression:error:")]
bool VisitExpression (NSExpression expression, [NullAllowed] out NSError error);

/// <summary>Validates whether the specified comparison operator type is allowed to be used in a predicate.</summary>
/// <param name="operatorType">The <see cref="NSPredicateOperatorType" /> to validate.</param>
/// <param name="error">When this method returns <see langword="false" />, contains an <see cref="NSError" /> describing why the operator type was rejected; otherwise, <see langword="null" />.</param>
/// <returns><see langword="true" /> if the operator type is valid and allowed; otherwise, <see langword="false" />.</returns>
[Export ("visitOperatorType:error:")]
bool VisitOperatorType (NSPredicateOperatorType operatorType, [NullAllowed] out NSError error);

/// <summary>Validates whether the specified key path expression is allowed to be evaluated.</summary>
/// <param name="expression">The key path <see cref="NSExpression" /> to validate.</param>
/// <param name="scope">The scope component of the key path, or <see langword="null" /> if no scope is specified.</param>
/// <param name="key">The key component of the key path, or <see langword="null" /> if no key is specified.</param>
/// <param name="error">When this method returns <see langword="false" />, contains an <see cref="NSError" /> describing why the key path expression was rejected; otherwise, <see langword="null" />.</param>
/// <returns><see langword="true" /> if the key path expression is valid and allowed; otherwise, <see langword="false" />.</returns>
[Export ("visitExpressionKeyPath:scope:key:error:")]
bool VisitExpressionKeyPath (NSExpression expression, [NullAllowed] string scope, [NullAllowed] string key, [NullAllowed] out NSError error);
}

/// <summary>Defines an extension method for <see cref="Foundation.NSOrderedSet" /> objects allowing them to be filtered via an <see cref="Foundation.NSPredicate" />.</summary>
Expand Down

This file was deleted.

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

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,9 @@
!missing-protocol-conformance! NSXPCConnection should conform to NSXPCProxyCreating
!missing-selector! NSXPCInterface::interfaceForSelector:argumentIndex:ofReply: not bound
!missing-selector! NSXPCInterface::setInterface:forSelector:argumentIndex:ofReply: not bound

## Methods taking xpc_type_t / xpc_object_t which are unsuported like the rest of the platforms
!missing-selector! NSXPCCoder::decodeXPCObjectOfType:forKey: not bound
!missing-selector! NSXPCCoder::encodeXPCObject:forKey: not bound
!missing-selector! NSXPCInterface::setXPCType:forSelector:argumentIndex:ofReply: not bound
!missing-selector! NSXPCInterface::XPCTypeForSelector:argumentIndex:ofReply: not bound

This file was deleted.

Loading