Skip to content
3 changes: 3 additions & 0 deletions src/Foundation/Enum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1180,6 +1180,9 @@ public enum NSStringDrawingOptions : ulong {
OneShot = (1 << 4),
/// <summary>To be added.</summary>
TruncatesLastVisibleLine = (1 << 5),

[iOS (26, 0), TV (26, 0), MacCatalyst (26, 0), Mac (26, 0)]
OptionsResolvesNaturalAlignmentWithBaseWritingDirection = (1L << 9),
}

/// <summary>An enumeration of formats that can be used with numbers.</summary>
Expand Down
29 changes: 29 additions & 0 deletions src/UIKit/UIColor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

using System;
using ObjCRuntime;
using Foundation;
#if !COREBUILD
using CoreGraphics;
#endif
Expand Down Expand Up @@ -253,5 +254,33 @@ public static UIColor FromColor (System.Drawing.Color color)
return new UIColor (color.R/255.0f, color.G/255.0f, color.B/255.0f, color.A/255.0f);
}
#endif

/// <summary>
/// Creates a high dynamic range (HDR) color by applying exposure adjustments to standard dynamic range (SDR) color values.
/// </summary>
/// <param name="red">Red color component, typically in the range [0..1].</param>
/// <param name="green">Green color component, typically in the range [0..1].</param>
/// <param name="blue">Blue color component, typically in the range [0..1].</param>
/// <param name="alpha">Alpha transparency component, typically in the range [0..1].</param>
/// <param name="exposure">Exposure adjustment value. Must be >= 0 for exponential exposure or >= 1 for linear exposure.</param>
/// <param name="isLinearExposure">When true, applies linear exposure scaling. When false, applies exponential exposure scaling.</param>
/// <remarks>
/// <para>The HDR color is computed by processing the input color in linear color space with exposure adjustments.</para>
/// <para>For exponential exposure (isLinearExposure = false): Color components are scaled by 2^exposure, where each unit increase doubles the brightness.</para>
/// <para>For linear exposure (isLinearExposure = true): Color components are scaled directly by the exposure value, where doubling the exposure doubles the brightness.</para>
/// <para>The resulting color's content headroom corresponds to the linearized exposure factor.</para>
/// </remarks>
[SupportedOSPlatform ("ios26.0")]
[SupportedOSPlatform ("maccatalyst26.0")]
[SupportedOSPlatform ("tvos26.0")]
public UIColor (nfloat red, nfloat green, nfloat blue, nfloat alpha, nfloat exposure, bool isLinearExposure)
: base (NSObjectFlag.Empty)
{
if (isLinearExposure) {
InitializeHandle (_InitWithRedGreenBlueAlphaLinearExposure (red, green, blue, alpha, exposure), "initWithRed:green:blue:alpha:linearExposure:");
} else {
InitializeHandle (_InitWithRedGreenBlueAlphaExposure (red, green, blue, alpha, exposure), "initWithRed:green:blue:alpha:exposure:");
}
}
}
}
113 changes: 113 additions & 0 deletions src/UIKit/UIEnums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1811,6 +1811,10 @@ public enum UIViewAnimationOptions : ulong {
/// <summary>Constant that indicates that 30 frames per second are preferred for animations.</summary>
[MacCatalyst (13, 1)]
PreferredFramesPerSecond30 = 7 << 24,

/// <summary>Forces layout updates to flush immediately after animation changes.</summary>
[TV (26, 0), iOS (26, 0), MacCatalyst (26, 0)]
FlushUpdates = 1 << 28,
}

// untyped (and unamed) enum -> UIPrintError.h
Expand Down Expand Up @@ -3905,6 +3909,10 @@ public enum UIWindowSceneSessionRole {
[TV (16, 0), iOS (16, 0), MacCatalyst (16, 0)]
[Field ("UIWindowSceneSessionRoleExternalDisplayNonInteractive")]
ExternalDisplayNonInteractive,

[TV (26, 0), iOS (26, 0), MacCatalyst (26, 0)]
[Field ("UIWindowSceneSessionRoleAssistiveAccessApplication")]
AssistiveAccessApplication,
}

[iOS (13, 0), TV (13, 0)]
Expand Down Expand Up @@ -4018,6 +4026,14 @@ public enum UIMenuIdentifier {
[TV (18, 1), iOS (18, 1), MacCatalyst (18, 1)]
[Field ("UIMenuOpen")]
Open,

[TV (26, 0), iOS (26, 0), MacCatalyst (26, 0)]
[Field ("UIMenuFindPanel")]
FindPanel,

[TV (26, 0), iOS (26, 0), MacCatalyst (26, 0)]
[Field ("UIMenuNewItem")]
NewItem,
}

[iOS (13, 0), TV (13, 0)]
Expand Down Expand Up @@ -4648,6 +4664,8 @@ public enum UISplitViewControllerColumn : long {
Supplementary,
Secondary,
Compact,
[NoTV, iOS (26, 0), MacCatalyst (26, 0)]
Inspector,
}

[TV (14, 0), iOS (14, 0)]
Expand Down Expand Up @@ -4727,6 +4745,10 @@ public enum UIActionIdentifier {

[Field ("UIActionPasteAndSearch")]
PasteAndSearch,

[TV (26, 0), iOS (26, 0), MacCatalyst (26, 0)]
[Field ("UIActionNewFromPasteboard")]
NewFromPasteboard,
}

[NoTV, iOS (15, 0), MacCatalyst (15, 0)]
Expand Down Expand Up @@ -4821,4 +4843,95 @@ public enum UIWindowScenePresentationStyle : ulong {
Standard,
Prominent,
}

[TV (26, 0), iOS (26, 0), MacCatalyst (26, 0)]
[Native]
public enum UIHdrHeadroomUsageLimit : long {
Unspecified = -1,
}

[TV (26, 0), iOS (26, 0), MacCatalyst (26, 0)]
[Native]
public enum UIImageSymbolColorRenderingMode : long {
Automatic = 0,
Flat,
Gradient,
}

[TV (26, 0), iOS (26, 0), MacCatalyst (26, 0)]
[Native]
public enum UIImageSymbolVariableValueMode : long {
Automatic = 0,
Color,
Draw,
}

[TV (26, 0), iOS (26, 0), MacCatalyst (26, 0)]
[Native]
public enum UIMenuElementRepeatBehavior : long {
Automatic = 0,
Repeatable,
NonRepeatable,
}

[TV (26, 0), iOS (26, 0), MacCatalyst (26, 0)]
[Native]
public enum UIMenuSystemElementGroupPreference : long {
Automatic = 0,
Removed,
Included,
}

[TV (26, 0), iOS (26, 0), MacCatalyst (26, 0)]
[Native]
public enum UIMenuSystemFindElementGroupConfigurationStyle : long {
Automatic = 0,
Search,
NonEditableText,
EditableText,
}

[NoTV, iOS (26, 0), MacCatalyst (26, 0)]
[Native]
public enum UISliderStyle : long {
Default,
Thumbless,
}

[TV (26, 0), iOS (26, 0), MacCatalyst (26, 0)]
[Native]
public enum UISplitViewControllerLayoutEnvironment : long {
None,
Expanded,
Collapsed,
}

[NoTV, iOS (26, 0), MacCatalyst (26, 0)]
[Native]
public enum UITabAccessoryEnvironment : long {
Unspecified,
None,
Regular,
Inline,
}

[TV (26, 0), iOS (26, 0), MacCatalyst (26, 0)]
[Native]
public enum UITabBarMinimizeBehavior : long {
Automatic = 0,
[NoTV]
Never,
[NoTV]
OnScrollDown,
[NoTV]
OnScrollUp,
}

[TV (26, 0), iOS (26, 0), MacCatalyst (26, 0)]
[Native]
public enum UIViewLayoutRegionAdaptivityAxis : long {
None,
Horizontal,
Vertical,
}
}
27 changes: 27 additions & 0 deletions src/UIKit/UITextField.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ public UITextFieldEditingEndedEventArgs (UITextFieldDidEndEditingReason reason)
/// <related type="sample" href="https://github.com/xamarin/ios-samples/tree/master/MonoCatalog-MonoDevelop/">monocatalog</related>
public delegate bool UITextFieldCondition (UITextField textField);

/// <param name="textField">To be added.</param>
/// <param name="ranges">To be added.</param>
/// <param name="replacementString">To be added.</param>
/// <summary>A delegate used to respond to changes on the UITextField.</summary>
/// <returns>To be added.</returns>
/// <remarks>To be added.</remarks>
public delegate bool UITextFieldChanges (UITextField textField, NSValue [] ranges, string replacementString);

public partial class UITextField : IUITextInputTraits {

internal virtual Type GetInternalEventDelegateType {
Expand Down Expand Up @@ -182,6 +190,17 @@ public void DidChangeSelection (UITextField textField)
if (handler is not null)
handler (textField, EventArgs.Empty);
}

internal UITextFieldChanges? shouldChangeCharactersInRanges;
[Preserve (Conditional = true)]
[Export ("textField:shouldChangeCharactersInRanges:replacementString:")]
bool ShouldChangeCharacters (UITextField textField, NSValue [] ranges, string replacementString)
{
var handler = shouldChangeCharactersInRanges;
if (handler is not null)
return handler (textField, ranges, replacementString);
return true;
}
}

/// <summary>Raised when editing has ended.</summary>
Expand Down Expand Up @@ -241,6 +260,14 @@ public event EventHandler DidChangeSelection {
remove { EnsureUITextFieldDelegate ().didChangeSelection -= value; }
}

[SupportedOSPlatform ("tvos26.0")]
[SupportedOSPlatform ("ios26.0")]
[SupportedOSPlatform ("maccatalyst26.0")]
public UITextFieldChanges? ShouldChangeCharactersInRanges {
get { return EnsureUITextFieldDelegate ().shouldChangeCharactersInRanges; }
set { EnsureUITextFieldDelegate ().shouldChangeCharactersInRanges = value; }
}

// The following events are already here from the UITextInput protocol, so no need to implement the ones from UITextFieldDelegate:
// * WillPresentEditMenu
// * WillDismissEditMenu
Expand Down
Loading
Loading