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

[DataDetection] Add new framework for Xcode 13 beta 3. #12259

Closed
Closed
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
131 changes: 131 additions & 0 deletions src/datadetection.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
using CoreFoundation;
using ObjCRuntime;
using Foundation;

using System;

namespace DataDetection {

[iOS (15,0), MacCatalyst (15,0)]
[BaseType (typeof(NSObject))]
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
[BaseType (typeof(NSObject))]
[BaseType (typeof (NSObject))]

small

[DisableDefaultCtor]
interface DDDetectedValue
{
[Export ("matchedString")]
string MatchedString { get; }

[Export ("matchedRange")]
NSRange MatchedRange { get; }
}

[iOS (15,0), MacCatalyst (15,0)]
[BaseType (typeof (DDDetectedValue))]
Copy link
Contributor

Choose a reason for hiding this comment

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

base does not have a default ctor
I don't see how having one here would be helpful (since you can't set any of the values)

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

[iOS (15,0), MacCatalyst (15,0)]
[BaseType (typeof (DDDetectedValue))]
Copy link
Contributor

Choose a reason for hiding this comment

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

[DisableDefaultCtor]

[DisableDefaultCtor]
interface DDDetectedValuePhoneNumber
{
[Export ("phoneNumber")]
string PhoneNumber { get; }

[NullAllowed, Export ("label")]
string Label { get; }
}

[iOS (15,0), MacCatalyst (15,0)]
[BaseType (typeof (DDDetectedValue))]
Copy link
Contributor

Choose a reason for hiding this comment

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

[DisableDefaultCtor]

[DisableDefaultCtor]
interface DDDetectedValueEmailAddress
{
[Export ("emailAddress")]
string EmailAddress { get; }

[NullAllowed, Export ("label")]
string Label { get; }
}

[iOS (15,0), MacCatalyst (15,0)]
[BaseType (typeof (DDDetectedValue))]
Copy link
Contributor

Choose a reason for hiding this comment

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

[DisableDefaultCtor]

[DisableDefaultCtor]
interface DDDetectedValuePostalAddress
{
[NullAllowed, Export ("street")]
string Street { get; }

[NullAllowed, Export ("city")]
string City { get; }

[NullAllowed, Export ("state")]
string State { get; }

[NullAllowed, Export ("postalCode")]
string PostalCode { get; }

[NullAllowed, Export ("country")]
string Country { get; }
}

[iOS (15,0), MacCatalyst (15,0)]
[BaseType (typeof (DDDetectedValue))]
Copy link
Contributor

Choose a reason for hiding this comment

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

[DisableDefaultCtor]

[DisableDefaultCtor]
interface DDDetectedValueCalendarEvent
{
[Export ("allDay")]
bool AllDay { [Bind ("isAllDay")] get; }

[NullAllowed, Export ("startDate")]
NSDate StartDate { get; }

[NullAllowed, Export ("startTimeZone")]
NSTimeZone StartTimeZone { get; }

[NullAllowed, Export ("endDate")]
NSDate EndDate { get; }

[NullAllowed, Export ("endTimeZone")]
NSTimeZone EndTimeZone { get; }
}

[iOS (15,0), MacCatalyst (15,0)]
[BaseType (typeof (DDDetectedValue))]
Copy link
Contributor

Choose a reason for hiding this comment

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

[DisableDefaultCtor]

[DisableDefaultCtor]
interface DDDetectedValueShipmentTrackingNumber
{
[Export ("carrier")]
string Carrier { get; }

[Export ("trackingNumber")]
string TrackingNumber { get; }
}

[iOS (15,0), MacCatalyst (15,0)]
[BaseType (typeof (DDDetectedValue))]
Copy link
Contributor

Choose a reason for hiding this comment

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

[DisableDefaultCtor]

[DisableDefaultCtor]
interface DDDetectedValueFlightNumber
{
[Export ("airline")]
string Airline { get; }

[Export ("flightNumber")]
string FlightNumber { get; }
}

[iOS (15,0), MacCatalyst (15,0)]
[BaseType (typeof (DDDetectedValue))]
Copy link
Contributor

Choose a reason for hiding this comment

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

[DisableDefaultCtor]

[DisableDefaultCtor]
interface DDDetectedValueMoneyAmount
{
[Export ("currency")]
string Currency { get; }

[Export ("amount")]
double Amount { get; }
}
}
1 change: 1 addition & 0 deletions src/frameworks.sources
Original file line number Diff line number Diff line change
Expand Up @@ -2058,6 +2058,7 @@ IOS_FRAMEWORKS = \
CoreSpotlight \
CoreTelephony \
CoreText \
DataDetection \
Copy link
Member

Choose a reason for hiding this comment

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

You need to add the framework to MACCATALYST_FRAMEWORKS too if you want these bindings in Mac Catalyst (like your availability attributes seem to indicate).

DeviceCheck \
EventKit \
EventKitUI \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# framework not present
!missing-selector! DDDetectedValue::matchedRange not bound
!missing-selector! DDDetectedValue::matchedString not bound
!missing-selector! DDDetectedValueCalendarEvent::endDate not bound
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# framework not present
!missing-selector! DDDetectedValue::matchedRange not bound
!missing-selector! DDDetectedValue::matchedString not bound
!missing-selector! DDDetectedValueCalendarEvent::endDate not bound
Expand Down
32 changes: 0 additions & 32 deletions tests/xtro-sharpie/tvOS-DataDetection.todo

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# framework not present
!missing-selector! DDDetectedValue::matchedRange not bound
!missing-selector! DDDetectedValue::matchedString not bound
!missing-selector! DDDetectedValueCalendarEvent::endDate not bound
Expand Down
32 changes: 0 additions & 32 deletions tests/xtro-sharpie/watchOS-DataDetection.todo

This file was deleted.

1 change: 1 addition & 0 deletions tools/common/Frameworks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ public static Frameworks CreateiOSFrameworks (bool is_simulator_build)
{ "CoreLocationUI", "CoreLocationUI", 15,0 },

{ "Chip", "CHIP", new Version (15, 0), NotAvailableInSimulator /* no headers in beta 2 */ },
{ "DataDetection", "DataDetection", 15,0 },
{ "Phase", "PHASE", new Version (15,0), NotAvailableInSimulator /* no headers in beta 2 */ },

// the above MUST be kept in sync with simlauncher
Expand Down
1 change: 1 addition & 0 deletions tools/mtouch/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ SIMLAUNCHER_FRAMEWORKS = \
-weak_framework AdServices \
\
-weak_framework CoreLocationUI \
-weak_framework DataDetection \

# keep the above list of weak_framework
# 1. grouped by iOS versions;
Expand Down