From aefd2abcf74491b7bc8b9e8e15e5389ddd6b4551 Mon Sep 17 00:00:00 2001 From: Timothy Risi Date: Mon, 19 Jun 2017 23:02:15 -0800 Subject: [PATCH 1/8] [Foundation] Update for xcode9 --- src/Foundation/Enum.cs | 47 +- src/Foundation/NSMetadataItem.cs | 1019 +++++++++++++++ src/Foundation/NSProgress.cs | 30 + src/foundation.cs | 1134 ++++++++++++++++- src/frameworks.sources | 1 + src/generator.cs | 2 + src/mapkit.cs | 6 +- src/uikit.cs | 21 +- tests/introspection/ApiProtocolTest.cs | 4 + tests/introspection/ApiTypoTest.cs | 1 + tests/introspection/Mac/MacApiCtorInitTest.cs | 2 + 11 files changed, 2234 insertions(+), 33 deletions(-) create mode 100644 src/Foundation/NSProgress.cs diff --git a/src/Foundation/Enum.cs b/src/Foundation/Enum.cs index 7f40aca05851..375e873f813f 100644 --- a/src/Foundation/Enum.cs +++ b/src/Foundation/Enum.cs @@ -363,6 +363,8 @@ public enum NSCocoaError : int { CoderReadCorruptError = 4864, CoderValueNotFoundError = 4865, + [Mac (10,13), iOS (11,0), Watch (4,0), TV (11,0)] + CoderInvalidValueError = 4866, CoderErrorMinimum = 4864, CoderErrorMaximum = 4991, @@ -722,7 +724,8 @@ public enum NSJsonReadingOptions : nuint_compat_int { [Flags] [Native] public enum NSJsonWritingOptions : nuint_compat_int { - PrettyPrinted = 1 + PrettyPrinted = 1, + SortedKeys = (1 << 1), } [Native] @@ -1235,6 +1238,7 @@ public enum NSIso8601DateFormatOptions : nuint { DashSeparatorInDate = 1 << 8, ColonSeparatorInTime = 1 << 9, ColonSeparatorInTimeZone = 1 << 10, + FractionalSeconds = 1 << 11, FullDate = Year | Month | Day | DashSeparatorInDate, FullTime = Time | ColonSeparatorInTime | TimeZone | ColonSeparatorInTimeZone, InternetDateTime = FullDate | FullTime, @@ -1258,4 +1262,45 @@ public enum NSMeasurementFormatterUnitOptions : nuint { TemperatureWithoutUnit = (1 << 2) } + + [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)] + [Native] + public enum NSItemProviderRepresentationVisibility : nint { + All = 0, + Team = 1, + Group = 2, + OwnProcess = 3, + } + + [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)] + [Native] + public enum NSItemProviderFileOptions : nint { + OpenInPlace = 1, + } + + [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)] + [Native] + public enum NSLinguisticTaggerUnit : nint { + Word, + Sentence, + Paragraph, + Document, + } + + [NoWatch, NoTV, NoMac, iOS (11, 0)] + [Native] + public enum NSUrlSessionMultipathServiceType : nint { + None = 0, + Handover = 1, + Interactive = 2, + Aggregate = 3, + } + + [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)] + [Native] + public enum NSUrlSessionDelayedRequestDisposition : nint { + ContinueLoading = 0, + UseNewRequest = 1, + Cancel = 2, + } } diff --git a/src/Foundation/NSMetadataItem.cs b/src/Foundation/NSMetadataItem.cs index 72de9c50220d..e6f2d2887337 100644 --- a/src/Foundation/NSMetadataItem.cs +++ b/src/Foundation/NSMetadataItem.cs @@ -24,6 +24,16 @@ double GetDouble (NSString key) return n == null ? 0 : n.DoubleValue; } + nint GetNInt (NSString key) + { + var n = Runtime.GetNSObject (GetHandle (key)); +#if XAMCORE_2_0 + return n?.NIntValue ?? 0; +#else + return n?.IntValue ?? 0; +#endif + } + // same order as NSMetadataAttributes.h public NSString FileSystemName { @@ -177,5 +187,1014 @@ public NSUrl UbiquitousItemUrlInLocalContainer { return Runtime.GetNSObject (GetHandle (NSMetadataQuery.UbiquitousItemURLInLocalContainerKey)); } } + +#if MONOMAC + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string [] Keywords { + get { + return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.KeywordsKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string Title { + get { + return (string)Runtime.GetNSObject (GetHandle (NSMetadataQuery.TitleKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string [] Authors { + get { + return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.AuthorsKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string [] Editors { + get { + return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.EditorsKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string [] Participants { + get { + return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.ParticipantsKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string [] Projects { + get { + return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.ProjectsKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public NSDate DownloadedDate { + get { + return Runtime.GetNSObject (GetHandle (NSMetadataQuery.DownloadedDateKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string [] WhereFroms { + get { + return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.WhereFromsKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string Comment { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.CommentKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string Copyright { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.CopyrightKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public NSDate LastUsedDate { + get { + return Runtime.GetNSObject (GetHandle (NSMetadataQuery.LastUsedDateKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public NSDate ContentCreationDate { + get { + return Runtime.GetNSObject (GetHandle (NSMetadataQuery.ContentCreationDateKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public NSDate ContentModificationDate { + get { + return Runtime.GetNSObject (GetHandle (NSMetadataQuery.ContentModificationDateKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public NSDate DateAdded { + get { + return Runtime.GetNSObject (GetHandle (NSMetadataQuery.DateAddedKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public double DurationSeconds { + get { + return GetDouble (NSMetadataQuery.DurationSecondsKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string [] ContactKeywords { + get { + return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.ContactKeywordsKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string Version { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.VersionKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public nint PixelHeight { + get { + return GetNInt (NSMetadataQuery.PixelHeightKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public nint PixelWidth { + get { + return GetNInt (NSMetadataQuery.PixelWidthKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public nint PixelCount { + get { + return GetNInt (NSMetadataQuery.PixelCountKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string ColorSpace { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.ColorSpaceKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public nint BitsPerSample { + get { + return GetNInt (NSMetadataQuery.BitsPerSampleKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public bool FlashOnOff { + get { + return GetBool (NSMetadataQuery.FlashOnOffKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public double FocalLength { + get { + return GetDouble (NSMetadataQuery.FocalLengthKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string AcquisitionMake { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.AcquisitionMakeKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string AcquisitionModel { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.AcquisitionModelKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public double IsoSpeed { + get { + return GetDouble (NSMetadataQuery.IsoSpeedKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public nint Orientation { + get { + return GetNInt (NSMetadataQuery.OrientationKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string [] LayerNames { + get { + return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.LayerNamesKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public double WhiteBalance { + get { + return GetDouble (NSMetadataQuery.WhiteBalanceKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public double Aperture { + get { + return GetDouble (NSMetadataQuery.ApertureKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string ProfileName { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.ProfileNameKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public nint ResolutionWidthDpi { + get { + return GetNInt (NSMetadataQuery.ResolutionWidthDpiKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public nint ResolutionHeightDpi { + get { + return GetNInt (NSMetadataQuery.ResolutionHeightDpiKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public nint ExposureMode { + get { + return GetNInt (NSMetadataQuery.ExposureModeKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public double ExposureTimeSeconds { + get { + return GetDouble (NSMetadataQuery.ExposureTimeSecondsKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string ExifVersion { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.ExifVersionKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string CameraOwner { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.CameraOwnerKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public nint FocalLength35mmKey { + get { + return GetNInt (NSMetadataQuery.FocalLength35mmKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string LensModel { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.LensModelKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string ExifGpsVersion { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.ExifGpsVersionKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public double AltitudeKey { + get { + return GetDouble (NSMetadataQuery.AltitudeKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public double Latitude { + get { + return GetDouble (NSMetadataQuery.LatitudeKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public double Longitude { + get { + return GetDouble (NSMetadataQuery.LongitudeKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public double Speed { + get { + return GetDouble (NSMetadataQuery.SpeedKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public NSDate Timestamp { + get { + return Runtime.GetNSObject (GetHandle (NSMetadataQuery.TimestampKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public double GpsTrack { + get { + return GetDouble (NSMetadataQuery.GpsTrackKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public double ImageDirection { + get { + return GetDouble (NSMetadataQuery.ImageDirectionKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string NamedLocation { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.NamedLocationKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string GpsStatus { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.GpsStatusKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string GpsMeasureMode { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.GpsMeasureModeKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public double GpsDop { + get { + return GetDouble (NSMetadataQuery.GpsDopKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string GpsMapDatum { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.GpsMapDatumKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public double GpsDestLatitude { + get { + return GetDouble (NSMetadataQuery.GpsDestLatitudeKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public double GpsDestLongitude { + get { + return GetDouble (NSMetadataQuery.GpsDestLongitudeKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public double GpsDestBearing { + get { + return GetDouble (NSMetadataQuery.GpsDestBearingKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public double GpsDestDistance { + get { + return GetDouble (NSMetadataQuery.GpsDestDistanceKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string GpsProcessingMethod { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.GpsProcessingMethodKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string GpsAreaInformation { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.GpsAreaInformationKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public NSDate GpsDateStamp { + get { + return Runtime.GetNSObject (GetHandle (NSMetadataQuery.GpsDateStampKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public double GpsDifferental { + get { + return GetDouble (NSMetadataQuery.GpsDifferentalKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string [] Codecs { + get { + return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.CodecsKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string [] MediaTypes { + get { + return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.MediaTypesKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public bool Streamable { + get { + return GetBool (NSMetadataQuery.StreamableKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public nint TotalBitRate { + get { + return GetNInt (NSMetadataQuery.TotalBitRateKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public nint VideoBitRate { + get { + return GetNInt (NSMetadataQuery.VideoBitRateKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public nint AudioBitRate { + get { + return GetNInt (NSMetadataQuery.AudioBitRateKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string DeliveryType { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.DeliveryTypeKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string Album { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.AlbumKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public bool HasAlphaChannel { + get { + return GetBool (NSMetadataQuery.HasAlphaChannelKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public bool RedEyeOnOff { + get { + return GetBool (NSMetadataQuery.RedEyeOnOffKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string MeteringMode { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.MeteringModeKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public double MaxApertureKey { + get { + return GetDouble (NSMetadataQuery.MaxApertureKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public nint FNumber { + get { + return GetNInt (NSMetadataQuery.FNumberKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string ExposureProgram { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.ExposureProgramKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string ExposureTimeString { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.ExposureTimeStringKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string Headline { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.HeadlineKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string Instructions { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.InstructionsKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string City { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.CityKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string StateOrProvince { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.StateOrProvinceKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string Country { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.CountryKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string TextContent { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.TextContentKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public nint AudioSampleRate { + get { + return GetNInt (NSMetadataQuery.AudioSampleRateKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public nint AudioChannelCount { + get { + return GetNInt (NSMetadataQuery.AudioChannelCountKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public double TempoKey { + get { + return GetDouble (NSMetadataQuery.TempoKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string KeySignature { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.KeySignatureKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string TimeSignature { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.TimeSignatureKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string AudioEncodingApplication { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.AudioEncodingApplicationKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string Composer { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.ComposerKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string Lyricist { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.LyricistKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public nint AudioTrackNumber { + get { + return GetNInt (NSMetadataQuery.AudioTrackNumberKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public NSDate RecordingDate { + get { + return Runtime.GetNSObject (GetHandle (NSMetadataQuery.RecordingDateKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string MusicalGenre { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.MusicalGenreKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public bool IsGeneralMidiSequence { + get { + return GetBool (NSMetadataQuery.IsGeneralMidiSequenceKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public nint RecordingYear { + get { + return GetNInt (NSMetadataQuery.RecordingYearKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string [] Organizations { + get { + return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.OrganizationsKey)); } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string [] Languages { + get { + return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.LanguagesKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string Rights { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.RightsKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string [] Publishers { + get { + return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.PublishersKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string [] Contributors { + get { + return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.ContributorsKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string [] Coverage { + get { + return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.CoverageKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string Subject { + get { + return Runtime.GetNSObject (GetHandle (NSMetadataQuery.SubjectKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string Theme { + get { + return Runtime.GetNSObject (GetHandle (NSMetadataQuery.ThemeKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string Description { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.DescriptionKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string Identifier { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.IdentifierKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string [] Audiences { + get { + return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.AudiencesKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public nint NumberOfPages { + get { + return GetNInt (NSMetadataQuery.NumberOfPagesKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public double PageWidth { + get { + return GetDouble (NSMetadataQuery.PageWidthKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public double PageHeight { + get { + return GetDouble (NSMetadataQuery.PageHeightKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string SecurityMethod { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.SecurityMethodKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string Creator { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.CreatorKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string [] EncodingApplications { + get { + return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.EncodingApplicationsKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public NSDate DueDate { + get { + return Runtime.GetNSObject (GetHandle (NSMetadataQuery.DueDateKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public double StarRatingKey { + get { + return GetDouble (NSMetadataQuery.StarRatingKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string [] PhoneNumbers { + get { + return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.PhoneNumbersKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string [] EmailAddresses { + get { + return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.EmailAddressesKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string [] InstantMessageAddresses { + get { + return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.InstantMessageAddressesKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string Kind { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.KindKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string [] Recipients { + get { + return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.RecipientsKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string FinderComment { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.FinderCommentKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string [] Fonts { + get { + return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.FontsKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string AppleLoopsRoot { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.AppleLoopsRootKeyKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string AppleLoopsKeyFilterType { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.AppleLoopsKeyFilterTypeKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string AppleLoopsLoopMode { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.AppleLoopsLoopModeKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string [] AppleLoopDescriptors { + get { + return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.AppleLoopDescriptorsKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string MusicalInstrumentCategory { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.MusicalInstrumentCategoryKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string MusicalInstrumentName { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.MusicalInstrumentNameKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string CFBundleIdentifier { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.CFBundleIdentifierKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string Information { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.InformationKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string Director { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.DirectorKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string Producer { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.ProducerKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string Genre { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.GenreKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string [] Performers { + get { + return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.PerformersKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string OriginalFormat { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.OriginalFormatKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string OriginalSource { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.OriginalSourceKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string [] AuthorEmailAddresses { + get { + return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.AuthorEmailAddressesKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string [] RecipientEmailAddresses { + get { + return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.RecipientEmailAddressesKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string [] AuthorAddresses { + get { + return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.AuthorAddressesKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string [] RecipientAddresses { + get { + return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.RecipientAddressesKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public bool IsLikelyJunk { + get { + return GetBool (NSMetadataQuery.IsLikelyJunkKey); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string [] ExecutableArchitectures { + get { + return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.ExecutableArchitecturesKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string ExecutablePlatform { + get { + return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.ExecutablePlatformKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public string [] ApplicationCategories { + get { + return NSArray.StringArrayFromHandle (GetHandle (NSMetadataQuery.ApplicationCategoriesKey)); + } + } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + public bool IsApplicationManaged { + get { + return GetBool (NSMetadataQuery.IsApplicationManagedKey); + } + } +#endif } } diff --git a/src/Foundation/NSProgress.cs b/src/Foundation/NSProgress.cs new file mode 100644 index 000000000000..3bde6c98c808 --- /dev/null +++ b/src/Foundation/NSProgress.cs @@ -0,0 +1,30 @@ +#if !COREBUILD && XAMCORE_2_0 +using System; +using XamCore.Foundation; +using XamCore.ObjCRuntime; + +namespace XamCore.Foundation { + public partial class NSProgress { + //Manual bindings until BindAs support is merged + public nint? EstimatedTimeRemaining { + get { return _EstimatedTimeRemaining == null ? null : (nint?)_EstimatedTimeRemaining.NIntValue; } + set { _EstimatedTimeRemaining = value != null ? new NSNumber (value.Value) : null; } + } + + public nint? Throughput { + get { return _Throughput == null ? null : (nint?)_Throughput.NIntValue; } + set { _Throughput = value != null ? new NSNumber (value.Value) : null; } + } + + public nint? FileTotalCount { + get { return _FileTotalCount == null ? null : (nint?)_FileTotalCount.NIntValue; } + set { _FileTotalCount = value != null ? new NSNumber (value.Value) : null; } + } + + public nint? FileCompletedCount { + get { return _FileCompletedCount == null ? null : (nint?)_FileCompletedCount.NIntValue; } + set { _FileCompletedCount = value != null ? new NSNumber (value.Value) : null; } + } + } +} +#endif diff --git a/src/foundation.cs b/src/foundation.cs index 8c328808d0b9..e9a23608a2ec 100644 --- a/src/foundation.cs +++ b/src/foundation.cs @@ -159,6 +159,16 @@ interface NSArray : NSSecureCoding, NSMutableCopying, INSFastEnumeration { [Export ("removeObserver:fromObjectsAtIndexes:forKeyPath:")] void RemoveObserver (NSObject observer, NSIndexSet indexes, string keyPath); + + [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Export ("writeToURL:error:")] + bool Write (NSUrl url, out NSError error); + + [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Static] + [Export ("arrayWithContentsOfURL:error:")] + [return: NullAllowed] + NSArray FromUrl (NSUrl url, out NSError error); } #if MONOMAC @@ -240,16 +250,29 @@ partial interface NSAttributedString : NSCoding, NSMutableCopying, NSSecureCodin [Wrap ("this (data, options == null ? null : options.Dictionary, out resultDocumentAttributes, ref error)")] IntPtr Constructor (NSData data, NSAttributedStringDocumentAttributes options, out NSDictionary resultDocumentAttributes, ref NSError error); - // From the NSItemProviderReading protocol, a special constructor. - [Export ("initWithItemProviderData:typeIdentifier:error:")] - [iOS (11,0), NoWatch, NoTV, Mac(10,13)] - IntPtr Constructor (NSData providerData, string typeIdentifier, out NSError outError); - // From the NSItemProviderReading protocol, a static method. [Static] [Export ("readableTypeIdentifiersForItemProvider", ArgumentSemantic.Copy)] [iOS (11,0), NoWatch, NoTV, Mac(10,13)] string[] ReadableTypeIdentifiersForItemProvider { get; } + + [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Static] + [Export ("objectWithItemProviderData:typeIdentifier:error:")] + [return: NullAllowed] + INSItemProviderReading GetObject (NSData data, string typeIdentifier, [NullAllowed] out NSError outError); + + // From the NSItemProviderWriting protocol, a static method. + [NoWatch, NoTV, Mac (10,13), iOS (11,0)] + [Static] + [Export ("writableTypeIdentifiersForItemProvider", ArgumentSemantic.Copy)] + string[] WritableTypeIdentifiers { get; } + + // From the NSItemProviderWriting protocol, a static method. + [NoWatch, NoTV, Mac (10,13), NoiOS] + [Static] + [Export ("itemProviderVisibilityForRepresentationWithTypeIdentifier:")] + NSItemProviderRepresentationVisibility GetItemProviderVisibility (string typeIdentifier); [Since (7,0)] [Export ("dataFromRange:documentAttributes:error:")] @@ -1729,7 +1752,11 @@ interface NSDateFormatter { [iOS (8,0), Mac (10,10)] [Export ("setLocalizedDateFormatFromTemplate:")] - void SetLocalizedDateFormatFromTemplate (string dateFormatTemplate); + void SetLocalizedDateFormat (string dateFormatTemplate); + + [Watch (2, 0), TV (9, 0), Mac (10, 10), iOS (8, 0)] + [Export ("formattingContext", ArgumentSemantic.Assign)] + NSFormattingContext FormattingContext { get; set; } } [iOS (8,0)][Mac(10,10)] @@ -1782,6 +1809,10 @@ interface NSDateComponentsFormatter { [Export ("getObjectValue:forString:errorDescription:")] bool GetObjectValue (out NSObject obj, string str, out string error); + + [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)] + [NullAllowed, Export ("referenceDate", ArgumentSemantic.Copy)] + NSDate ReferenceDate { get; set; } } [iOS (8,0)][Mac(10,10)] @@ -2571,6 +2602,620 @@ interface NSMetadataQuery { [iOS(8,0),Mac(10,10)] [Field ("NSMetadataUbiquitousItemURLInLocalContainerKey")] NSString UbiquitousItemURLInLocalContainerKey { get; } + +#if MONOMAC + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemKeywordsKey")] + NSString KeywordsKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemTitleKey")] + NSString TitleKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemAuthorsKey")] + NSString AuthorsKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemEditorsKey")] + NSString EditorsKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemParticipantsKey")] + NSString ParticipantsKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemProjectsKey")] + NSString ProjectsKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemDownloadedDateKey")] + NSString DownloadedDateKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemWhereFromsKey")] + NSString WhereFromsKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemCommentKey")] + NSString CommentKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemCopyrightKey")] + NSString CopyrightKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemLastUsedDateKey")] + NSString LastUsedDateKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemContentCreationDateKey")] + NSString ContentCreationDateKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemContentModificationDateKey")] + NSString ContentModificationDateKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemDateAddedKey")] + NSString DateAddedKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemDurationSecondsKey")] + NSString DurationSecondsKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemContactKeywordsKey")] + NSString ContactKeywordsKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemVersionKey")] + NSString VersionKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemPixelHeightKey")] + NSString PixelHeightKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemPixelWidthKey")] + NSString PixelWidthKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemPixelCountKey")] + NSString PixelCountKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemColorSpaceKey")] + NSString ColorSpaceKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemBitsPerSampleKey")] + NSString BitsPerSampleKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemFlashOnOffKey")] + NSString FlashOnOffKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemFocalLengthKey")] + NSString FocalLengthKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemAcquisitionMakeKey")] + NSString AcquisitionMakeKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemAcquisitionModelKey")] + NSString AcquisitionModelKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemISOSpeedKey")] + NSString IsoSpeedKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemOrientationKey")] + NSString OrientationKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemLayerNamesKey")] + NSString LayerNamesKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemWhiteBalanceKey")] + NSString WhiteBalanceKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemApertureKey")] + NSString ApertureKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemProfileNameKey")] + NSString ProfileNameKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemResolutionWidthDPIKey")] + NSString ResolutionWidthDpiKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemResolutionHeightDPIKey")] + NSString ResolutionHeightDpiKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemExposureModeKey")] + NSString ExposureModeKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemExposureTimeSecondsKey")] + NSString ExposureTimeSecondsKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemEXIFVersionKey")] + NSString ExifVersionKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemCameraOwnerKey")] + NSString CameraOwnerKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemFocalLength35mmKey")] + NSString FocalLength35mmKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemLensModelKey")] + NSString LensModelKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemEXIFGPSVersionKey")] + NSString ExifGpsVersionKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemAltitudeKey")] + NSString AltitudeKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemLatitudeKey")] + NSString LatitudeKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemLongitudeKey")] + NSString LongitudeKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemSpeedKey")] + NSString SpeedKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemTimestampKey")] + NSString TimestampKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemGPSTrackKey")] + NSString GpsTrackKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemImageDirectionKey")] + NSString ImageDirectionKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemNamedLocationKey")] + NSString NamedLocationKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemGPSStatusKey")] + NSString GpsStatusKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemGPSMeasureModeKey")] + NSString GpsMeasureModeKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemGPSDOPKey")] + NSString GpsDopKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemGPSMapDatumKey")] + NSString GpsMapDatumKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemGPSDestLatitudeKey")] + NSString GpsDestLatitudeKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemGPSDestLongitudeKey")] + NSString GpsDestLongitudeKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemGPSDestBearingKey")] + NSString GpsDestBearingKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemGPSDestDistanceKey")] + NSString GpsDestDistanceKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemGPSProcessingMethodKey")] + NSString GpsProcessingMethodKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemGPSAreaInformationKey")] + NSString GpsAreaInformationKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemGPSDateStampKey")] + NSString GpsDateStampKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemGPSDifferentalKey")] + NSString GpsDifferentalKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemCodecsKey")] + NSString CodecsKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemMediaTypesKey")] + NSString MediaTypesKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemStreamableKey")] + NSString StreamableKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemTotalBitRateKey")] + NSString TotalBitRateKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemVideoBitRateKey")] + NSString VideoBitRateKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemAudioBitRateKey")] + NSString AudioBitRateKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemDeliveryTypeKey")] + NSString DeliveryTypeKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemAlbumKey")] + NSString AlbumKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemHasAlphaChannelKey")] + NSString HasAlphaChannelKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemRedEyeOnOffKey")] + NSString RedEyeOnOffKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemMeteringModeKey")] + NSString MeteringModeKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemMaxApertureKey")] + NSString MaxApertureKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemFNumberKey")] + NSString FNumberKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemExposureProgramKey")] + NSString ExposureProgramKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemExposureTimeStringKey")] + NSString ExposureTimeStringKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemHeadlineKey")] + NSString HeadlineKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemInstructionsKey")] + NSString InstructionsKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemCityKey")] + NSString CityKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemStateOrProvinceKey")] + NSString StateOrProvinceKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemCountryKey")] + NSString CountryKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemTextContentKey")] + NSString TextContentKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemAudioSampleRateKey")] + NSString AudioSampleRateKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemAudioChannelCountKey")] + NSString AudioChannelCountKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemTempoKey")] + NSString TempoKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemKeySignatureKey")] + NSString KeySignatureKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemTimeSignatureKey")] + NSString TimeSignatureKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemAudioEncodingApplicationKey")] + NSString AudioEncodingApplicationKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemComposerKey")] + NSString ComposerKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemLyricistKey")] + NSString LyricistKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemAudioTrackNumberKey")] + NSString AudioTrackNumberKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemRecordingDateKey")] + NSString RecordingDateKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemMusicalGenreKey")] + NSString MusicalGenreKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemIsGeneralMIDISequenceKey")] + NSString IsGeneralMidiSequenceKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemRecordingYearKey")] + NSString RecordingYearKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemOrganizationsKey")] + NSString OrganizationsKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemLanguagesKey")] + NSString LanguagesKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemRightsKey")] + NSString RightsKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemPublishersKey")] + NSString PublishersKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemContributorsKey")] + NSString ContributorsKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemCoverageKey")] + NSString CoverageKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemSubjectKey")] + NSString SubjectKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemThemeKey")] + NSString ThemeKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemDescriptionKey")] + NSString DescriptionKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemIdentifierKey")] + NSString IdentifierKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemAudiencesKey")] + NSString AudiencesKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemNumberOfPagesKey")] + NSString NumberOfPagesKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemPageWidthKey")] + NSString PageWidthKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemPageHeightKey")] + NSString PageHeightKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemSecurityMethodKey")] + NSString SecurityMethodKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemCreatorKey")] + NSString CreatorKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemEncodingApplicationsKey")] + NSString EncodingApplicationsKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemDueDateKey")] + NSString DueDateKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemStarRatingKey")] + NSString StarRatingKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemPhoneNumbersKey")] + NSString PhoneNumbersKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemEmailAddressesKey")] + NSString EmailAddressesKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemInstantMessageAddressesKey")] + NSString InstantMessageAddressesKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemKindKey")] + NSString KindKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemRecipientsKey")] + NSString RecipientsKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemFinderCommentKey")] + NSString FinderCommentKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemFontsKey")] + NSString FontsKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemAppleLoopsRootKeyKey")] + NSString AppleLoopsRootKeyKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemAppleLoopsKeyFilterTypeKey")] + NSString AppleLoopsKeyFilterTypeKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemAppleLoopsLoopModeKey")] + NSString AppleLoopsLoopModeKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemAppleLoopDescriptorsKey")] + NSString AppleLoopDescriptorsKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemMusicalInstrumentCategoryKey")] + NSString MusicalInstrumentCategoryKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemMusicalInstrumentNameKey")] + NSString MusicalInstrumentNameKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemCFBundleIdentifierKey")] + NSString CFBundleIdentifierKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemInformationKey")] + NSString InformationKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemDirectorKey")] + NSString DirectorKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemProducerKey")] + NSString ProducerKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemGenreKey")] + NSString GenreKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemPerformersKey")] + NSString PerformersKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemOriginalFormatKey")] + NSString OriginalFormatKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemOriginalSourceKey")] + NSString OriginalSourceKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemAuthorEmailAddressesKey")] + NSString AuthorEmailAddressesKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemRecipientEmailAddressesKey")] + NSString RecipientEmailAddressesKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemAuthorAddressesKey")] + NSString AuthorAddressesKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemRecipientAddressesKey")] + NSString RecipientAddressesKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemIsLikelyJunkKey")] + NSString IsLikelyJunkKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemExecutableArchitecturesKey")] + NSString ExecutableArchitecturesKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemExecutablePlatformKey")] + NSString ExecutablePlatformKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemApplicationCategoriesKey")] + NSString ApplicationCategoriesKey { get; } + + [NoWatch, NoTV, NoiOS, Mac (10, 9)] + [Field ("NSMetadataItemIsApplicationManagedKey")] + NSString IsApplicationManagedKey { get; } +#endif + + [NoWatch, NoTV, Mac (10, 12), iOS (10, 0)] + [Field ("NSMetadataUbiquitousItemIsSharedKey")] + NSString UbiquitousItemIsSharedKey { get; } + + [NoWatch, NoTV, Mac (10, 12), iOS (10, 0)] + [Field ("NSMetadataUbiquitousSharedItemCurrentUserRoleKey")] + NSString UbiquitousSharedItemCurrentUserRoleKey { get; } + + [NoWatch, NoTV, Mac (10, 12), iOS (10, 0)] + [Field ("NSMetadataUbiquitousSharedItemCurrentUserPermissionsKey")] + NSString UbiquitousSharedItemCurrentUserPermissionsKey { get; } + + [NoWatch, NoTV, Mac (10, 12), iOS (10, 0)] + [Field ("NSMetadataUbiquitousSharedItemOwnerNameComponentsKey")] + NSString UbiquitousSharedItemOwnerNameComponentsKey { get; } + + [NoWatch, NoTV, Mac (10, 12), iOS (10, 0)] + [Field ("NSMetadataUbiquitousSharedItemMostRecentEditorNameComponentsKey")] + NSString UbiquitousSharedItemMostRecentEditorNameComponentsKey { get; } + + [NoWatch, NoTV, Mac (10, 12), iOS (10, 0)] + [Field ("NSMetadataUbiquitousSharedItemRoleOwner")] + NSString UbiquitousSharedItemRoleOwner { get; } + + [NoWatch, NoTV, Mac (10, 12), iOS (10, 0)] + [Field ("NSMetadataUbiquitousSharedItemRoleParticipant")] + NSString UbiquitousSharedItemRoleParticipant { get; } + + [NoWatch, NoTV, Mac (10, 12), iOS (10, 0)] + [Field ("NSMetadataUbiquitousSharedItemPermissionsReadOnly")] + NSString UbiquitousSharedItemPermissionsReadOnly { get; } + + [NoWatch, NoTV, Mac (10, 12), iOS (10, 0)] + [Field ("NSMetadataUbiquitousSharedItemPermissionsReadWrite")] + NSString UbiquitousSharedItemPermissionsReadWrite { get; } [Since (7,0), Mavericks] [NullAllowed] // by default this property is null @@ -2978,6 +3623,16 @@ interface NSDictionary : NSSecureCoding, NSMutableCopying { [Export ("initWithContentsOfURL:")] IntPtr Constructor (NSUrl url); + + [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Export ("initWithContentsOfURL:error:")] + IntPtr Constructor (NSUrl url, out NSError error); + + [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Static] + [Export ("dictionaryWithContentsOfURL:error:")] + [return: NullAllowed] + NSDictionary FromUrl (NSUrl url, out NSError error); [Export ("count")] nuint Count { get; } @@ -3173,6 +3828,14 @@ interface NSError : NSSecureCoding, NSCopying { [Field ("NSFilePathErrorKey")] NSString FilePathErrorKey { get; } + [iOS (9,0)][Mac (10,11)] + [Field ("NSDebugDescriptionErrorKey")] + NSString DebugDescriptionErrorKey { get; } + + [iOS (11,0), Mac (10,13), Watch (4,0), TV (11,0)] + [Field ("NSLocalizedFailureErrorKey")] + NSString LocalizedFailureErrorKey { get; } + [iOS (9,0)][Mac (10,11)] [Static] [Export ("setUserInfoValueProviderForDomain:provider:")] @@ -3518,8 +4181,58 @@ interface NSLinguisticTagger { [NullAllowed] // by default this property is null [Export ("string", ArgumentSemantic.Retain)] string AnalysisString { get; set; } + + [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Export ("tagsInRange:unit:scheme:options:tokenRanges:")] + string[] GetTags (NSRange range, NSLinguisticTaggerUnit unit, string scheme, NSLinguisticTaggerOptions options, [NullAllowed] out NSValue[] tokenRanges); + + [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Export ("enumerateTagsInRange:unit:scheme:options:usingBlock:")] + void EnumerateTags (NSRange range, NSLinguisticTaggerUnit unit, string scheme, NSLinguisticTaggerOptions options, LinguisticTagEnumerator enumerator); + + [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Export ("tagAtIndex:unit:scheme:tokenRange:")] + [return: NullAllowed] + string GetTag (nuint charIndex, NSLinguisticTaggerUnit unit, string scheme, [NullAllowed] ref NSRange tokenRange); + + [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Export ("tokenRangeAtIndex:unit:")] + NSRange GetTokenRange (nuint charIndex, NSLinguisticTaggerUnit unit); + + [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Static] + [Export ("availableTagSchemesForUnit:language:")] + string[] GetAvailableTagSchemes (NSLinguisticTaggerUnit unit, string language); + + [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)] + [NullAllowed, Export ("dominantLanguage")] + string DominantLanguage { get; } + + [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Static] + [Export ("dominantLanguageForString:")] + [return: NullAllowed] + string GetDominantLanguage (string str); + + [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Static] + [Export ("tagForString:atIndex:unit:scheme:orthography:tokenRange:")] + [return: NullAllowed] + string GetTag (string str, nuint charIndex, NSLinguisticTaggerUnit unit, string scheme, [NullAllowed] NSOrthography orthography, [NullAllowed] ref NSRange tokenRange); + + [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Static] + [Export ("tagsForString:range:unit:scheme:options:orthography:tokenRanges:")] + string[] GetTags (string str, NSRange range, NSLinguisticTaggerUnit unit, string scheme, NSLinguisticTaggerOptions options, [NullAllowed] NSOrthography orthography, [NullAllowed] out NSValue[] tokenRanges); + + [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Static] + [Export ("enumerateTagsForString:range:unit:scheme:options:orthography:usingBlock:")] + void EnumerateTags (string str, NSRange range, NSLinguisticTaggerUnit unit, string scheme, NSLinguisticTaggerOptions options, [NullAllowed] NSOrthography orthography, LinguisticTagEnumerator enumerator); } + delegate void LinguisticTagEnumerator (string tag, NSRange tokenRange, bool stop); + [Since (5,0)] [Static] interface NSLinguisticTag { @@ -3903,6 +4616,7 @@ interface NSRunLoop { [Field ("NSRunLoopCommonModes")] NSString NSRunLoopCommonModes { get; } + [Availability (Deprecated = Platform.Mac_10_13, Message = "Use 'NSXpcConnection' instead.")] [NoiOS, NoWatch, NoTV] [Field ("NSConnectionReplyMode")] NSString NSRunLoopConnectionReplyMode { get; } @@ -4301,7 +5015,7 @@ interface NSUuid : NSSecureCoding, NSCopying { string AsString (); } - [iOS (8,0)][Mac (10,10, onlyOn64 : true)] // .objc_class_name_NSUserActivity", referenced from '' not found + [iOS (8,0)][Mac (10,10, onlyOn64 : true), Watch (2,0), TV (9,0)] // .objc_class_name_NSUserActivity", referenced from '' not found [BaseType (typeof (NSObject))] [DisableDefaultCtor] // xcode 8 beta 4 marks it as API_DEPRECATED partial interface NSUserActivity { @@ -4354,31 +5068,31 @@ partial interface NSUserActivity { [Async (ResultTypeName="NSUserActivityContinuation")] void GetContinuationStreams (Action completionHandler); - [Mac(10,11), iOS (9,0)] + [Mac(10,11), iOS (9,0), Watch (3,0), TV (10,0)] [Export ("requiredUserInfoKeys", ArgumentSemantic.Copy)] NSSet RequiredUserInfoKeys { get; set; } - [Mac(10,11), iOS (9,0)] + [Mac(10,11), iOS (9,0), Watch (3,0), TV (10,0)] [Export ("expirationDate", ArgumentSemantic.Copy)] NSDate ExpirationDate { get; set; } - [Mac(10,11), iOS (9,0)] + [Mac(10,11), iOS (9,0), Watch (3,0), TV (10,0)] [Export ("keywords", ArgumentSemantic.Copy)] NSSet Keywords { get; set; } - [Mac(10,11), iOS (9,0)] + [Mac(10,11), iOS (9,0), Watch (3,0), TV (10,0)] [Export ("resignCurrent")] void ResignCurrent (); - [Mac(10,11), iOS (9,0)] + [Mac(10,11), iOS (9,0), Watch (3,0), TV (10,0)] [Export ("eligibleForHandoff")] bool EligibleForHandoff { [Bind ("isEligibleForHandoff")] get; set; } - [Mac(10,11), iOS (9,0)] + [Mac(10,11), iOS (9,0), Watch (3,0), TV (10,0)] [Export ("eligibleForSearch")] bool EligibleForSearch { [Bind ("isEligibleForSearch")] get; set; } - [Mac(10,11), iOS (9,0)] + [Mac(10,11), iOS (9,0), Watch (3,0), TV (10,0)] [Export ("eligibleForPublicIndexing")] bool EligibleForPublicIndexing { [Bind ("isEligibleForPublicIndexing")] get; set; } @@ -4389,6 +5103,9 @@ partial interface NSUserActivity { CSSearchableItemAttributeSet ContentAttributeSet { get; set; } #endif + [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)] + [NullAllowed, Export ("referrerURL", ArgumentSemantic.Copy)] + NSUrl ReferrerUrl { get; set; } } [iOS (8,0)][Mac (10,10, onlyOn64 : true)] // same as NSUserActivity @@ -4398,7 +5115,7 @@ partial interface NSUserActivityType { NSString BrowsingWeb { get; } } - [iOS (8,0)][Mac (10,10, onlyOn64 : true)] // same as NSUserActivity + [iOS (8,0)][Mac (10,10, onlyOn64 : true), Watch (3,0), TV (9,0)] // same as NSUserActivity [Protocol, Model] [BaseType (typeof (NSObject))] partial interface NSUserActivityDelegate { @@ -4582,6 +5299,9 @@ interface NSUserDefaults { partial interface NSUrl : NSSecureCoding, NSCopying #if MONOMAC , NSPasteboardReading, NSPasteboardWriting +#endif +#if !WATCH && !TVOS + , NSItemProviderWriting #endif { [Export ("initWithScheme:host:path:")] @@ -5025,6 +5745,46 @@ partial interface NSUrl : NSSecureCoding, NSCopying [Field ("NSURLVolumeLocalizedNameKey")] NSString VolumeLocalizedNameKey { get; } + [Watch (3, 0), TV (10, 0), Mac (10, 12), iOS (10, 0)] + [Field ("NSURLVolumeIsEncryptedKey")] + NSString VolumeIsEncryptedKey { get; } + + [Watch (3, 0), TV (10, 0), Mac (10, 12), iOS (10, 0)] + [Field ("NSURLVolumeIsRootFileSystemKey")] + NSString VolumeIsRootFileSystemKey { get; } + + [Watch (3, 0), TV (10, 0), Mac (10, 12), iOS (10, 0)] + [Field ("NSURLVolumeSupportsCompressionKey")] + NSString VolumeSupportsCompressionKey { get; } + + [Watch (3, 0), TV (10, 0), Mac (10, 12), iOS (10, 0)] + [Field ("NSURLVolumeSupportsFileCloningKey")] + NSString VolumeSupportsFileCloningKey { get; } + + [Watch (3, 0), TV (10, 0), Mac (10, 12), iOS (10, 0)] + [Field ("NSURLVolumeSupportsSwapRenamingKey")] + NSString VolumeSupportsSwapRenamingKey { get; } + + [Watch (3, 0), TV (10, 0), Mac (10, 12), iOS (10, 0)] + [Field ("NSURLVolumeSupportsExclusiveRenamingKey")] + NSString VolumeSupportsExclusiveRenamingKey { get; } + + [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)] + [Field ("NSURLVolumeSupportsImmutableFilesKey")] + NSString VolumeSupportsImmutableFilesKey { get; } + + [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)] + [Field ("NSURLVolumeSupportsAccessPermissionsKey")] + NSString VolumeSupportsAccessPermissionsKey { get; } + + [NoWatch, NoTV, Mac (10, 13), iOS (11, 0)] + [Field ("NSURLVolumeAvailableCapacityForImportantUsageKey")] + NSString VolumeAvailableCapacityForImportantUsageKey { get; } + + [NoWatch, NoTV, Mac (10, 13), iOS (11, 0)] + [Field ("NSURLVolumeAvailableCapacityForOpportunisticUsageKey")] + NSString VolumeAvailableCapacityForOpportunisticUsageKey { get; } + [Since (5,0)] [Field ("NSURLIsUbiquitousItemKey")] NSString IsUbiquitousItemKey { get; } @@ -5057,6 +5817,42 @@ partial interface NSUrl : NSSecureCoding, NSCopying [Field ("NSURLUbiquitousItemPercentUploadedKey")] NSString UbiquitousItemPercentUploadedKey { get; } + [NoWatch, NoTV, Mac (10, 12), iOS (10, 0)] + [Field ("NSURLUbiquitousItemIsSharedKey")] + NSString UbiquitousItemIsSharedKey { get; } + + [NoWatch, NoTV, Mac (10, 12), iOS (10, 0)] + [Field ("NSURLUbiquitousSharedItemCurrentUserRoleKey")] + NSString UbiquitousSharedItemCurrentUserRoleKey { get; } + + [NoWatch, NoTV, Mac (10, 12), iOS (10, 0)] + [Field ("NSURLUbiquitousSharedItemCurrentUserPermissionsKey")] + NSString UbiquitousSharedItemCurrentUserPermissionsKey { get; } + + [NoWatch, NoTV, Mac (10, 12), iOS (10, 0)] + [Field ("NSURLUbiquitousSharedItemOwnerNameComponentsKey")] + NSString UbiquitousSharedItemOwnerNameComponentsKey { get; } + + [NoWatch, NoTV, Mac (10, 12), iOS (10, 0)] + [Field ("NSURLUbiquitousSharedItemMostRecentEditorNameComponentsKey")] + NSString UbiquitousSharedItemMostRecentEditorNameComponentsKey { get; } + + [NoWatch, NoTV, Mac (10, 12), iOS (10, 0)] + [Field ("NSURLUbiquitousSharedItemRoleOwner")] + NSString UbiquitousSharedItemRoleOwner { get; } + + [NoWatch, NoTV, Mac (10, 12), iOS (10, 0)] + [Field ("NSURLUbiquitousSharedItemRoleParticipant")] + NSString UbiquitousSharedItemRoleParticipant { get; } + + [NoWatch, NoTV, Mac (10, 12), iOS (10, 0)] + [Field ("NSURLUbiquitousSharedItemPermissionsReadOnly")] + NSString UbiquitousSharedItemPermissionsReadOnly { get; } + + [NoWatch, NoTV, Mac (10, 12), iOS (10, 0)] + [Field ("NSURLUbiquitousSharedItemPermissionsReadWrite")] + NSString UbiquitousSharedItemPermissionsReadWrite { get; } + [Since (5,1)] [MountainLion] [Field ("NSURLIsExcludedFromBackupKey")] @@ -5196,6 +5992,22 @@ partial interface NSUrl : NSSecureCoding, NSCopying [Field ("NSURLFileProtectionCompleteUntilFirstUserAuthentication")] NSString FileProtectionCompleteUntilFirstUserAuthentication { get; } #endif + + [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Static] + [Export ("readableTypeIdentifiersForItemProvider", ArgumentSemantic.Copy)] + string[] ReadableTypeIdentifiers { get; } + + [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Static] + [Export ("objectWithItemProviderData:typeIdentifier:error:")] + [return: NullAllowed] + INSItemProviderReading GetObject (NSData data, string typeIdentifier, [NullAllowed] out NSError outError); + + [NoWatch, NoTV, Mac (10,13), iOS (11,0)] + [Static] + [Export ("writableTypeIdentifiersForItemProvider", ArgumentSemantic.Copy)] + string[] WritableTypeIdentifiers { get; } } @@ -5420,6 +6232,10 @@ partial interface NSUrlComponents : NSCopying { [iOS (9,0), Mac(10,11)] [Export ("rangeOfFragment"), Mac(10,11)] NSRange RangeOfFragment { get; } + + [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)] + [NullAllowed, Export ("percentEncodedQueryItems", ArgumentSemantic.Copy)] + NSUrlQueryItem[] PercentEncodedQueryItems { get; set; } } [BaseType (typeof (NSObject), Name="NSURLAuthenticationChallenge")] @@ -6039,8 +6855,11 @@ interface NSUrlSessionStreamTask [Since (7,0)] [Availability (Introduced = Platform.Mac_10_9)] [BaseType (typeof (NSObject), Name="NSURLSessionTask")] - partial interface NSUrlSessionTask : NSCopying { - + partial interface NSUrlSessionTask : NSCopying +#if MONOMAC + , NSProgressReporting +#endif + { [Export ("taskIdentifier")] nuint TaskIdentifier { get; } @@ -6092,6 +6911,33 @@ partial interface NSUrlSessionTask : NSCopying { [Export ("priority")] float Priority { get; set; } /* float, not CGFloat */ #endif + +#if MONOMAC // Introspection fails for iOS + [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)] + [Export ("progress", ArgumentSemantic.Strong)] + NSProgress Progress { get; } +#endif + +//1) ApiSelectorTest.InstanceMethods (Introspection.MacApiSelectorTest.ApiSelectorTest.InstanceMethods) +// 6 errors found in 22990 instance selector validated: +//Selector not found for Foundation.NSUrlSessionTask : countOfBytesClientExpectsToReceive +//Selector not found for Foundation.NSUrlSessionTask : setCountOfBytesClientExpectsToReceive: +//Selector not found for Foundation.NSUrlSessionTask : countOfBytesClientExpectsToSend +//Selector not found for Foundation.NSUrlSessionTask : setCountOfBytesClientExpectsToSend: +//Selector not found for Foundation.NSUrlSessionTask : earliestBeginDate +//Selector not found for Foundation.NSUrlSessionTask : setEarliestBeginDate: + //[Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)] + //[NullAllowed, Export ("earliestBeginDate", ArgumentSemantic.Copy)] + //NSDate EarliestBeginDate { get; set; } + + //[Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)] + //[Export ("countOfBytesClientExpectsToSend")] + //long CountOfBytesClientExpectsToSend { get; set; } + + //[Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)] + //[Export ("countOfBytesClientExpectsToReceive")] + //long CountOfBytesClientExpectsToReceive { get; set; } + } [Static] @@ -6233,6 +7079,14 @@ partial interface NSUrlSessionConfiguration : NSCopying { [iOS (9,0), Mac(10,11)] [Export ("shouldUseExtendedBackgroundIdleMode")] bool ShouldUseExtendedBackgroundIdleMode { get; set; } + + [NoWatch, NoTV, NoMac, iOS (11, 0)] + [Export ("multipathServiceType", ArgumentSemantic.Assign)] + NSUrlSessionMultipathServiceType MultipathServiceType { get; set; } + + [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)] + [Export ("waitsForConnectivity")] + bool WaitsForConnectivity { get; set; } } [Since (7,0)] @@ -6275,6 +7129,14 @@ partial interface NSUrlSessionTaskDelegate { [Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)] [Export ("URLSession:task:didFinishCollectingMetrics:")] void DidFinishCollectingMetrics (NSUrlSession session, NSUrlSessionTask task, NSUrlSessionTaskMetrics metrics); + + [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Export ("URLSession:task:willBeginDelayedRequest:completionHandler:")] + void WillBeginDelayedRequest (NSUrlSession session, NSUrlSessionTask task, NSUrlRequest request, Action completionHandler); + + [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Export ("URLSession:taskIsWaitingForConnectivity:")] + void TaskIsWaitingForConnectivity (NSUrlSession session, NSUrlSessionTask task); } [Since (7,0)] @@ -6962,6 +7824,9 @@ interface NSString2 : NSSecureCoding, NSMutableCopying #if MONOMAC , NSPasteboardReading, NSPasteboardWriting // Documented that it implements NSPasteboard protocols even if header doesn't show it #endif +#if !WATCH && !TVOS + , NSItemProviderWriting +#endif { [Export ("initWithData:encoding:")] IntPtr Constructor (NSData data, NSStringEncoding encoding); @@ -7220,6 +8085,22 @@ interface NSString2 : NSSecureCoding, NSMutableCopying [Export ("paragraphRangeForRange:")] NSRange GetParagraphRange (NSRange range); + + [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Static] + [Export ("readableTypeIdentifiersForItemProvider", ArgumentSemantic.Copy)] + string[] ReadableTypeIdentifiers { get; } + + [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Static] + [Export ("objectWithItemProviderData:typeIdentifier:error:")] + [return: NullAllowed] + INSItemProviderReading GetObject (NSData data, string typeIdentifier, [NullAllowed] out NSError outError); + + [NoWatch, NoTV, Mac (10,13), iOS (11,0)] + [Static] + [Export ("writableTypeIdentifiersForItemProvider", ArgumentSemantic.Copy)] + string[] WritableTypeIdentifiers { get; } } [StrongDictionary ("NSString")] @@ -7268,6 +8149,12 @@ interface NSMutableString : NSCoding { [Export ("replaceCharactersInRange:withString:")] void ReplaceCharactersInRange (NSRange range, NSString aString); + + // From the NSItemProviderWriting protocol, a static method. + [NoWatch, NoTV, Mac (10,13), iOS (11,0)] + [Static] + [Export ("writableTypeIdentifiersForItemProvider", ArgumentSemantic.Copy)] + string[] WritableTypeIdentifiers { get; } } [Category, BaseType (typeof (NSString))] @@ -8807,7 +9694,66 @@ partial interface NSItemProvider : NSCopying { [Export ("registerCloudKitShare:container:")] void RegisterCloudKitShare (CKShare share, CKContainer container); #endif + [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Export ("registerDataRepresentationForTypeIdentifier:visibility:loadHandler:")] + void RegisterDataRepresentation (string typeIdentifier, NSItemProviderRepresentationVisibility visibility, RegisterDataRepresentationLoadHandler loadHandler); + + [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Export ("registerFileRepresentationForTypeIdentifier:fileOptions:visibility:loadHandler:")] + void RegisterFileRepresentation (string typeIdentifier, NSItemProviderFileOptions fileOptions, NSItemProviderRepresentationVisibility visibility, RegisterFileRepresentationLoadHandler loadHandler); + + [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Export ("registeredTypeIdentifiersWithFileOptions:")] + string[] GetRegisteredTypeIdentifiers (NSItemProviderFileOptions fileOptions); + + [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Export ("hasRepresentationConformingToTypeIdentifier:fileOptions:")] + bool HasConformingRepresentation (string typeIdentifier, NSItemProviderFileOptions fileOptions); + + [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Async, Export ("loadDataRepresentationForTypeIdentifier:completionHandler:")] + NSProgress LoadDataRepresentation (string typeIdentifier, Action completionHandler); + + [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Async, Export ("loadFileRepresentationForTypeIdentifier:completionHandler:")] + NSProgress LoadFileRepresentation (string typeIdentifier, Action completionHandler); + + [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Async (ResultTypeName = "LoadInPlaceResult"), Export ("loadInPlaceFileRepresentationForTypeIdentifier:completionHandler:")] + NSProgress LoadInPlaceFileRepresentation (string typeIdentifier, LoadInPlaceFileRepresentationHandler completionHandler); + + [NoWatch, NoTV, NoMac, iOS (11, 0)] + [NullAllowed, Export ("suggestedName")] + string SuggestedName { get; set; } + + [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Export ("initWithObject:")] + IntPtr Constructor (INSItemProviderWriting @object); + + [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Export ("registerObject:visibility:")] + void RegisterObject (INSItemProviderWriting @object, NSItemProviderRepresentationVisibility visibility); + + [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Export ("registerObjectOfClass:visibility:loadHandler:")] + void RegisterObject (Class aClass, NSItemProviderRepresentationVisibility visibility, RegisterObjectRepresentationLoadHandler loadHandler); + + [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Export ("canLoadObjectOfClass:")] + bool CanLoadObjectOfClass (Class aClass); + + [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Async, Export ("loadObjectOfClass:completionHandler:")] + NSProgress LoadObjectOfClass (Class aClass, Action completionHandler); } + + delegate NSProgress RegisterFileRepresentationLoadHandler ([BlockCallback] RegisterFileRepresentationCompletionHandler completionHandler); + delegate void RegisterFileRepresentationCompletionHandler (NSUrl fileUrl, bool coordinated, NSError error); + delegate void ItemProviderDataCompletionHandler (NSData data, NSError error); + delegate NSProgress RegisterDataRepresentationLoadHandler ([BlockCallback] ItemProviderDataCompletionHandler completionHandler); + delegate void LoadInPlaceFileRepresentationHandler (NSUrl fileUrl, bool isInPlace, NSError error); + delegate NSProgress RegisterObjectRepresentationLoadHandler ([BlockCallback] RegisterObjectRepresentationCompletionHandler completionHandler); + delegate void RegisterObjectRepresentationCompletionHandler (NSItemProviderWriting @object, NSError error); interface INSItemProviderReading {} @@ -8827,15 +9773,44 @@ interface NSItemProviderReading //[Export ("readableTypeIdentifiersForItemProvider", ArgumentSemantic.Copy)] //string[] ReadableTypeIdentifiersForItemProvider { get; } + //[Static] + //[Export ("objectWithItemProviderData:typeIdentifier:error:")] + //[return: NullAllowed] + //INSItemProviderReading GetObject (NSData data, string typeIdentifier, [NullAllowed] out NSError outError); + } + + interface INSItemProviderWriting {} + + [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Protocol, Model] + [BaseType (typeof(NSObject))] + interface NSItemProviderWriting + { // - // This is a constructor that various classes must implement - // NSAttributedString, UIColor and UIImage need to have this constructor - // for user-defined implementations of this interface, we are going to - // need to something special + // This static method has to be implemented on each class that implements + // this, this is not a capability that exists in C#. + // We are inlining these on each class that implements NSItemProviderWriting + // for the sake of the method being callable from C#, for user code, the + // user needs to manually [Export] the selector on a static method, like + // they do for the "layer" property on CALayer subclasses. // - //[Abstract] - //[Export ("initWithItemProviderData:typeIdentifier:error:")] - //INSItemProviderReading CreateFrom (NSData providerData, string typeIdentifier, [NullAllowed] NSError outError); + //[Static, Abstract] + //[Export ("writableTypeIdentifiersForItemProvider", ArgumentSemantic.Copy)] + //string[] WritableTypeIdentifiersForItemProvider { get; } + + //[Static] + //[Export ("itemProviderVisibilityForRepresentationWithTypeIdentifier:")] + //NSItemProviderRepresentationVisibility GetItemProviderVisibility (string typeIdentifier); + + [Export ("writableTypeIdentifiersForItemProvider", ArgumentSemantic.Copy)] + string[] WritableTypeIdentifiersForItemProvider { get; } + + [Export ("itemProviderVisibilityForRepresentationWithTypeIdentifier:")] + NSItemProviderRepresentationVisibility GetItemProviderVisibility (string typeIdentifier); + + [Async, Export ("loadDataWithTypeIdentifier:forItemProviderCompletionHandler:")] + [return: NullAllowed] + NSProgress LoadData (string typeIdentifier, Action completionHandler); } #if XAMCORE_2_0 @@ -9323,6 +10298,7 @@ interface NSNotificationQueue { // init returns NIL [DisableDefaultCtor] partial interface NSValue : NSSecureCoding, NSCopying { + [Availability (Deprecated = Platform.Mac_10_13 | Platform.iOS_11_0 | Platform.TV_11_0 | Platform.Watch_4_0, Message="Potential for buffer overruns. Use 'StoreValueAtAddress (IntPtr, nuint)' instead.")] [Export ("getValue:")] void StoreValueAtAddress (IntPtr value); @@ -10578,6 +11554,45 @@ partial interface NSProgress { [Field ("NSProgressFileIconKey")] NSString FileIconKey { get; } #endif + + [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Async, Export ("performAsCurrentWithPendingUnitCount:usingBlock:")] + void PerformAsCurrent (long unitCount, Action work); + + [Export ("finished")] + bool Finished { [Bind ("isFinished")] get; } + + [Internal] + [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)] + [NullAllowed, Export ("estimatedTimeRemaining", ArgumentSemantic.Copy)] + //[BindAs (typeof (nint?))] + NSNumber _EstimatedTimeRemaining { get; set; } + + [Internal] + [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)] + [NullAllowed, Export ("throughput", ArgumentSemantic.Copy)] + //[BindAs (typeof (nint?))] + NSNumber _Throughput { get; set; } + + [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)] + [NullAllowed, Export ("fileOperationKind")] + string FileOperationKind { get; set; } + + [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)] + [NullAllowed, Export ("fileURL", ArgumentSemantic.Copy)] + NSUrl FileUrl { get; set; } + + [Internal] + [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)] + [NullAllowed, Export ("fileTotalCount", ArgumentSemantic.Copy)] + //[BindAs (typeof (nint?))] + NSNumber _FileTotalCount { get; set; } + + [Internal] + [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)] + [NullAllowed, Export ("fileCompletedCount", ArgumentSemantic.Copy)] + //[BindAs (typeof (nint?))] + NSNumber _FileCompletedCount { get; set; } } interface INSProgressReporting {} @@ -10689,6 +11704,10 @@ interface NSFileCoordinator { [iOS (5,0)][Mac (10,7)] [Export ("purposeIdentifier")] string PurposeIdentifier { get; set; } + + [NoWatch, NoTV, Mac (10,13), iOS (11,0)] + [Export ("itemAtURL:didChangeUbiquityAttributes:")] + void ItemUbiquityAttributesChanged (NSUrl url, NSSet attributes); } [iOS (8,0)][Mac (10,10)] @@ -11044,6 +12063,12 @@ partial interface NSFileManager { [Export ("unmountVolumeAtURL:options:completionHandler:")] void UnmountVolume (NSUrl url, NSFileManagerUnmountOptions mask, Action completionHandler); #endif + +#if !WATCH && !TVOS + [NoWatch, NoTV, Mac (10,13), iOS (11,0)] + [Async, Export ("getFileProviderServicesForItemAtURL:completionHandler:")] + void GetFileProviderServices (NSUrl url, Action, NSError> completionHandler); +#endif } [BaseType(typeof(NSObject))] @@ -11182,6 +12207,14 @@ partial interface NSFilePresenter { [Export ("presentedSubitemAtURL:didResolveConflictVersion:")] void PresentedSubitemResolvedConflictVersion (NSUrl url, NSFileVersion version); + + [NoWatch, NoTV, Mac (10,13), iOS (11,0)] + [Export ("presentedItemDidChangeUbiquityAttributes:")] + void PresentedItemChangedUbiquityAttributes (NSSet attributes); + + [NoWatch, NoTV, Mac (10, 13), iOS (11, 0)] + [Export ("observedPresentedItemUbiquityAttributes", ArgumentSemantic.Strong)] + NSSet PresentedItemObservedUbiquityAttributes { get; } } delegate void NSFileVersionNonlocalVersionsCompletionHandler ([NullAllowed] NSFileVersion[] nonlocalFileVersions, [NullAllowed] NSError error); @@ -11268,6 +12301,10 @@ interface NSFileVersion { [Static] [Export ("removeOtherVersionsOfItemAtURL:error:")] bool RemoveOtherVersions (NSUrl url, out NSError outError); + + [NoWatch, NoTV, Mac (10, 12), iOS (10, 0)] + [NullAllowed, Export ("originatorNameComponents", ArgumentSemantic.Copy)] + NSPersonNameComponents OriginatorNameComponents { get; } } [BaseType (typeof (NSObject))] @@ -11931,6 +12968,10 @@ interface NSTextCheckingResult : NSSecureCoding, NSCopying { [Wrap ("TransitInformationCheckingResult (range, components != null ? components.Dictionary : null)")] NSTextCheckingResult TransitInformationCheckingResult (NSRange range, NSTextCheckingTransitComponents components); + [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Export ("rangeWithName:")] + NSRange GetRange (string name); + } [StrongDictionary ("NSTextChecking")] @@ -12206,6 +13247,7 @@ interface NSUnit : NSCopying, NSSecureCoding { string Symbol { get; } [Export ("initWithSymbol:")] + [DesignatedInitializer] IntPtr Constructor (string symbol); } @@ -12242,6 +13284,11 @@ interface NSUnitConverterLinear : NSSecureCoding { [Abstract] // abstract subclass of NSUnit [DisableDefaultCtor] // there's a designated initializer interface NSDimension : NSSecureCoding { + // Inlined from base type + [Export ("initWithSymbol:")] + [DesignatedInitializer] + IntPtr Constructor (string symbol); + [Export ("converter", ArgumentSemantic.Copy)] NSUnitConverter Converter { get; } @@ -12284,13 +13331,29 @@ interface NSUnitTemperature : NSSecureCoding { NSDimension BaseUnit { get; } } -#if MONOMAC +#if !WATCH && !TVOS + [Mac (10,8), iOS (11,0), NoWatch, NoTV] partial interface NSFileManager { [MountainLion, Export ("trashItemAtURL:resultingItemURL:error:")] bool TrashItem (NSUrl url, out NSUrl resultingItemUrl, out NSError error); + + [NoWatch, NoTV, Mac (10,13), iOS (11,0)] + [Async, Export ("getFileProviderMessageInterfacesForItemAtURL:completionHandler:")] + void GetFileProviderMessageInterfaces (NSUrl url, Action completionHandler); } + [NoWatch, NoTV, Mac (10,13), iOS (11,0)] + [BaseType (typeof(NSObject))] + [DisableDefaultCtor] + interface NSFileProviderService + { + [Export ("name")] + string Name { get; } + } +#endif + +#if MONOMAC partial interface NSFilePresenter { [MountainLion, Export ("primaryPresentedItemURL")] @@ -12493,6 +13556,7 @@ interface NSAffineTransform : NSSecureCoding, NSCopying { CGAffineTransform TransformStruct { get; set; } } + [Availability (Deprecated = Platform.Mac_10_13 | Platform.iOS_11_0 | Platform.Watch_2_0 | Platform.TV_11_0, Message = "Use 'NSXpcConnection' instead.")] [BaseType (typeof (NSObject))] [DisableDefaultCtor] interface NSConnection { @@ -12596,6 +13660,7 @@ interface NSConnection { NSConnectionDelegate Delegate { get; set; } } + [Availability (Deprecated = Platform.Mac_10_13 | Platform.iOS_11_0 | Platform.Watch_2_0 | Platform.TV_11_0, Message = "Use 'NSXpcConnection' instead.")] [BaseType (typeof (NSObject))] [Model] [Protocol] @@ -12619,6 +13684,7 @@ interface NSConnectionDelegate { bool AllowNewConnection (NSConnection newConnection, NSConnection parentConnection); } + [Availability (Deprecated = Platform.Mac_10_13 | Platform.iOS_11_0 | Platform.Watch_2_0 | Platform.TV_11_0, Message = "Use 'NSXpcConnection' instead.")] [BaseType (typeof (NSObject))] [DisableDefaultCtor] interface NSDistantObjectRequest { @@ -14290,6 +15356,22 @@ interface NSMeasurementFormatter : NSSecureCoding { interface NSFileProviderMessageInterface : NSSecureCoding { [Export ("name")] - string Name { get; } + string Name { get; } + } + + [NoWatch, NoTV, Mac (10,13), iOS (11,0)] + [BaseType (typeof(NSObject))] + [DisableDefaultCtor] + interface NSFileProviderMessenger + { + [Export ("initWithInterface:protocol:")] + [DesignatedInitializer] + IntPtr Constructor (NSFileProviderMessageInterface @interface, Protocol protocol); + + [Async, Export ("remoteObjectProxyWithErrorHandler:")] + NSObject GetRemoteObjectProxy (Action errorHandler); + + [Export ("invalidate")] + void Invalidate (); } } diff --git a/src/frameworks.sources b/src/frameworks.sources index d4f440e5a599..cad2f05a78a0 100644 --- a/src/frameworks.sources +++ b/src/frameworks.sources @@ -634,6 +634,7 @@ FOUNDATION_CORE_SOURCES = \ Foundation/NSNumber.mac.cs \ Foundation/NSNumber2.cs \ Foundation/NSObject2.cs \ + Foundation/NSProgress.cs \ Foundation/NSRange.cs \ Foundation/NSString.cs \ Foundation/NSValue.cs \ diff --git a/src/generator.cs b/src/generator.cs index 5f0158ed9e31..641211e628b9 100644 --- a/src/generator.cs +++ b/src/generator.cs @@ -3874,6 +3874,8 @@ void GenerateTypeLowering (MethodInfo mi, bool null_allowed_override, EnumMode e by_ref_processing.AppendLine(); if (mai.Type.GetElementType () == TypeManager.System_String){ by_ref_processing.AppendFormat("{0} = {0}Value != IntPtr.Zero ? NSString.FromHandle ({0}Value) : null;", pi.Name.GetSafeParamName ()); + } else if (pi.ParameterType.GetElementType ().IsArray) { + by_ref_processing.AppendFormat ("{0} = {0}Value != IntPtr.Zero ? NSArray.ArrayFromHandle<{1}> ({0}Value) : null;", pi.Name.GetSafeParamName (), RenderType (mai.Type.GetElementType ().GetElementType ())); } else if (isForced) { by_ref_processing.AppendFormat("{0} = {0}Value != IntPtr.Zero ? Runtime.GetINativeObject<{1}> ({0}Value, {2}) : null;", pi.Name.GetSafeParamName (), RenderType (mai.Type.GetElementType ()), isForcedOwns); } else { diff --git a/src/mapkit.cs b/src/mapkit.cs index ba430a0ba904..f6014aaed144 100644 --- a/src/mapkit.cs +++ b/src/mapkit.cs @@ -283,11 +283,7 @@ interface MKDirectionsRequest { [Since (6,0)] [TV (9,2)] [Mac (10,9, onlyOn64 : true)] - interface MKMapItem -#if IOS_NOT_BOUND_YET // https://bugzilla.xamarin.com/show_bug.cgi?id=58203 - : NSItemProviderReading, NSItemProviderWriting -#endif - { + interface MKMapItem { [Export ("placemark", ArgumentSemantic.Retain)] MKPlacemark Placemark { get; } diff --git a/src/uikit.cs b/src/uikit.cs index c9d26f1fda29..e11a61ecf29c 100644 --- a/src/uikit.cs +++ b/src/uikit.cs @@ -4657,7 +4657,11 @@ interface UICollectionElementKindSectionKey // returns NIL handle causing exceptions in further calls, e.g. ToString // Objective-C exception thrown. Name: NSInvalidArgumentException Reason: *** -CGColor not defined for the UIColor ; need to first convert colorspace. [DisableDefaultCtor] - interface UIColor : NSSecureCoding, NSCopying { + interface UIColor : NSSecureCoding, NSCopying +#if !TVOS && !WATCH + , NSItemProviderWriting +#endif + { [Export ("colorWithWhite:alpha:")][Static] UIColor FromWhiteAlpha (nfloat white, nfloat alpha); @@ -4838,6 +4842,12 @@ [Static] [Export ("brownColor")] [Export ("getRed:green:blue:alpha:")] bool GetRGBA2 (out nfloat red, out nfloat green, out nfloat blue, out nfloat alpha); #endif + + // From the NSItemProviderWriting protocol, a static method. + [NoWatch, NoTV, Mac (10,13), iOS (11,0)] + [Static] + [Export ("writableTypeIdentifiersForItemProvider", ArgumentSemantic.Copy)] + string[] WritableTypeIdentifiers { get; } } #if !WATCH @@ -6909,6 +6919,9 @@ interface UIActivityIndicatorView : NSCoding { interface UIImage : NSSecureCoding #if !WATCH , UIAccessibility, UIAccessibilityIdentification +#if !TVOS + , NSItemProviderWriting +#endif #endif // !WATCH { [ThreadSafe] @@ -7170,6 +7183,12 @@ [Static] [Export ("imageWithCGImage:")][Autorelease] [Export ("imageWithHorizontallyFlippedOrientation")] UIImage GetImageWithHorizontallyFlippedOrientation (); #endif + + // From the NSItemProviderWriting protocol, a static method. + [NoWatch, NoTV, Mac (10,13), iOS (11,0)] + [Static] + [Export ("writableTypeIdentifiersForItemProvider", ArgumentSemantic.Copy)] + string[] WritableTypeIdentifiers { get; } } #if !WATCH diff --git a/tests/introspection/ApiProtocolTest.cs b/tests/introspection/ApiProtocolTest.cs index 2003eaa9ecd7..11560234f9e5 100644 --- a/tests/introspection/ApiProtocolTest.cs +++ b/tests/introspection/ApiProtocolTest.cs @@ -164,6 +164,10 @@ protected virtual bool Skip (Type type, string protocolName) return true; } break; + case "NSProgressReporting": + if (!TestRuntime.CheckXcodeVersion (9, 0)) + return true; + break; } return false; } diff --git a/tests/introspection/ApiTypoTest.cs b/tests/introspection/ApiTypoTest.cs index 1243c294de41..1cc8cfc46cb6 100644 --- a/tests/introspection/ApiTypoTest.cs +++ b/tests/introspection/ApiTypoTest.cs @@ -274,6 +274,7 @@ public virtual bool Skip (MemberInfo methodName, string typo) { "Mtc", // acronym "Mul", "Mult", + "Multipath", "Multipeer", "Muxed", "Nanograms", diff --git a/tests/introspection/Mac/MacApiCtorInitTest.cs b/tests/introspection/Mac/MacApiCtorInitTest.cs index 2060bba86658..fa293083c5b4 100644 --- a/tests/introspection/Mac/MacApiCtorInitTest.cs +++ b/tests/introspection/Mac/MacApiCtorInitTest.cs @@ -270,6 +270,8 @@ protected override void Dispose (NSObject obj, Type type) case "CoreData.NSPersistentStoreCoordinator": case "AppKit.NSColorPanel": case "MonoMac.AppKit.NSColorPanel": + case "Foundation.NSFileProviderService": + case "MonoMac.Foundation.NSFileProviderService": do_not_dispose.Add (obj); break; // 10.11 From 7744503582a4d53ea3505b5f88c564eec1aec803 Mon Sep 17 00:00:00 2001 From: Timothy Risi Date: Wed, 9 Aug 2017 16:51:28 -0800 Subject: [PATCH 2/8] Fix intro failure --- src/foundation.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/foundation.cs b/src/foundation.cs index e9a23608a2ec..c8b3830a4a63 100644 --- a/src/foundation.cs +++ b/src/foundation.cs @@ -256,11 +256,13 @@ partial interface NSAttributedString : NSCoding, NSMutableCopying, NSSecureCodin [iOS (11,0), NoWatch, NoTV, Mac(10,13)] string[] ReadableTypeIdentifiersForItemProvider { get; } +#if !TVOS && !WATCHOS [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] [Static] [Export ("objectWithItemProviderData:typeIdentifier:error:")] [return: NullAllowed] INSItemProviderReading GetObject (NSData data, string typeIdentifier, [NullAllowed] out NSError outError); +#endif // From the NSItemProviderWriting protocol, a static method. [NoWatch, NoTV, Mac (10,13), iOS (11,0)] From 3cd404f8137b9a184a485760caee5bd6f7ddcbe2 Mon Sep 17 00:00:00 2001 From: Timothy Risi Date: Wed, 9 Aug 2017 21:43:25 -0800 Subject: [PATCH 3/8] Add availabilyt attributes to new enum values --- src/Foundation/Enum.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Foundation/Enum.cs b/src/Foundation/Enum.cs index 375e873f813f..52cd5a8e3090 100644 --- a/src/Foundation/Enum.cs +++ b/src/Foundation/Enum.cs @@ -725,6 +725,7 @@ public enum NSJsonReadingOptions : nuint_compat_int { [Native] public enum NSJsonWritingOptions : nuint_compat_int { PrettyPrinted = 1, + [Mac (10,13), iOS (11,0), TV (11,0), Watch (4,0)] SortedKeys = (1 << 1), } @@ -1238,6 +1239,7 @@ public enum NSIso8601DateFormatOptions : nuint { DashSeparatorInDate = 1 << 8, ColonSeparatorInTime = 1 << 9, ColonSeparatorInTimeZone = 1 << 10, + [Mac (10,13), iOS (11,0), TV (11,0), Watch (4,0)] FractionalSeconds = 1 << 11, FullDate = Year | Month | Day | DashSeparatorInDate, FullTime = Time | ColonSeparatorInTime | TimeZone | ColonSeparatorInTimeZone, From a1aa2fefe8db04031f50b625e215e52f6f860bdc Mon Sep 17 00:00:00 2001 From: Timothy Risi Date: Thu, 10 Aug 2017 15:04:56 -0800 Subject: [PATCH 4/8] Update for PR comments --- src/Foundation/NSMetadataItem.cs | 293 ++++++++++-------- src/Foundation/NSProgress.cs | 8 +- src/foundation.cs | 53 ++-- tests/introspection/Mac/MacApiSelectorTest.cs | 9 + tests/introspection/iOS/iOSApiSelectorTest.cs | 9 + .../Foundation/UrlSessionTaskTest.cs | 8 + 6 files changed, 213 insertions(+), 167 deletions(-) diff --git a/src/Foundation/NSMetadataItem.cs b/src/Foundation/NSMetadataItem.cs index e6f2d2887337..f24e19203adc 100644 --- a/src/Foundation/NSMetadataItem.cs +++ b/src/Foundation/NSMetadataItem.cs @@ -18,19 +18,31 @@ bool GetBool (NSString key) return n == null ? false : n.BoolValue; } + bool? GetNullableBool (NSString key) + { + var n = Runtime.GetNSObject (GetHandle (key)); + return n?.BoolValue; + } + double GetDouble (NSString key) { var n = Runtime.GetNSObject (GetHandle (key)); return n == null ? 0 : n.DoubleValue; } - nint GetNInt (NSString key) + double? GetNullableDouble (NSString key) + { + var n = Runtime.GetNSObject (GetHandle (key)); + return n?.DoubleValue; + } + + nint? GetNInt (NSString key) { var n = Runtime.GetNSObject (GetHandle (key)); #if XAMCORE_2_0 - return n?.NIntValue ?? 0; + return n?.NIntValue; #else - return n?.IntValue ?? 0; + return n?.IntValue; #endif } @@ -93,12 +105,14 @@ public NSString[] ContentTypeTree { } } + // XAMCORE_4_0 FIXME return nullable public bool IsUbiquitous { get { return GetBool (NSMetadataQuery.ItemIsUbiquitousKey); } } + // XAMCORE_4_0 FIXME return nullable public bool UbiquitousItemHasUnresolvedConflicts { get { return GetBool (NSMetadataQuery.UbiquitousItemHasUnresolvedConflictsKey); @@ -116,30 +130,35 @@ public NSItemDownloadingStatus DownloadingStatus { } } + // XAMCORE_4_0 FIXME return nullable public bool UbiquitousItemIsDownloading { get { return GetBool (NSMetadataQuery.UbiquitousItemIsDownloadingKey); } } + // XAMCORE_4_0 FIXME return nullable public bool UbiquitousItemIsUploaded { get { return GetBool (NSMetadataQuery.UbiquitousItemIsUploadedKey); } } + // XAMCORE_4_0 FIXME return nullable public bool UbiquitousItemIsUploading { get { return GetBool (NSMetadataQuery.UbiquitousItemIsUploadingKey); } } + // XAMCORE_4_0 FIXME return nullable public double UbiquitousItemPercentDownloaded { get { return GetDouble (NSMetadataQuery.UbiquitousItemPercentDownloadedKey); } } + // XAMCORE_4_0 FIXME return nullable public double UbiquitousItemPercentUploaded { get { return GetDouble (NSMetadataQuery.UbiquitousItemPercentUploadedKey); @@ -160,6 +179,7 @@ public NSError UbiquitousItemUploadingError { } } + // XAMCORE_4_0 FIXME return nullable [iOS (8,0)][Mac (10,10)] public bool UbiquitousItemDownloadRequested { get { @@ -167,6 +187,7 @@ public bool UbiquitousItemDownloadRequested { } } + // XAMCORE_4_0 FIXME return nullable [iOS (8,0)][Mac (10,10)] public bool UbiquitousItemIsExternalDocument { get { @@ -199,7 +220,7 @@ public string [] Keywords { [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string Title { get { - return (string)Runtime.GetNSObject (GetHandle (NSMetadataQuery.TitleKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.TitleKey)); } } @@ -248,14 +269,14 @@ public string [] WhereFroms { [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string Comment { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.CommentKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.CommentKey)); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string Copyright { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.CopyrightKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.CopyrightKey)); } } @@ -288,9 +309,9 @@ public NSDate DateAdded { } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public double DurationSeconds { + public double? DurationSeconds { get { - return GetDouble (NSMetadataQuery.DurationSecondsKey); + return GetNullableDouble (NSMetadataQuery.DurationSecondsKey); } } @@ -304,26 +325,26 @@ public string [] ContactKeywords { [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string Version { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.VersionKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.VersionKey)); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public nint PixelHeight { + public nint? PixelHeight { get { return GetNInt (NSMetadataQuery.PixelHeightKey); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public nint PixelWidth { + public nint? PixelWidth { get { return GetNInt (NSMetadataQuery.PixelWidthKey); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public nint PixelCount { + public nint? PixelCount { get { return GetNInt (NSMetadataQuery.PixelCountKey); } @@ -332,54 +353,54 @@ public nint PixelCount { [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string ColorSpace { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.ColorSpaceKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.ColorSpaceKey)); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public nint BitsPerSample { + public nint? BitsPerSample { get { return GetNInt (NSMetadataQuery.BitsPerSampleKey); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public bool FlashOnOff { + public bool? FlashOnOff { get { - return GetBool (NSMetadataQuery.FlashOnOffKey); + return GetNullableBool (NSMetadataQuery.FlashOnOffKey); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public double FocalLength { + public double? FocalLength { get { - return GetDouble (NSMetadataQuery.FocalLengthKey); + return GetNullableDouble (NSMetadataQuery.FocalLengthKey); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string AcquisitionMake { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.AcquisitionMakeKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.AcquisitionMakeKey)); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string AcquisitionModel { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.AcquisitionModelKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.AcquisitionModelKey)); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public double IsoSpeed { + public double? IsoSpeed { get { - return GetDouble (NSMetadataQuery.IsoSpeedKey); + return GetNullableDouble (NSMetadataQuery.IsoSpeedKey); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public nint Orientation { + public nint? Orientation { get { return GetNInt (NSMetadataQuery.OrientationKey); } @@ -393,70 +414,70 @@ public string [] LayerNames { } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public double WhiteBalance { + public double? WhiteBalance { get { - return GetDouble (NSMetadataQuery.WhiteBalanceKey); + return GetNullableDouble (NSMetadataQuery.WhiteBalanceKey); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public double Aperture { + public double? Aperture { get { - return GetDouble (NSMetadataQuery.ApertureKey); + return GetNullableDouble (NSMetadataQuery.ApertureKey); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string ProfileName { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.ProfileNameKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.ProfileNameKey)); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public nint ResolutionWidthDpi { + public nint? ResolutionWidthDpi { get { return GetNInt (NSMetadataQuery.ResolutionWidthDpiKey); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public nint ResolutionHeightDpi { + public nint? ResolutionHeightDpi { get { return GetNInt (NSMetadataQuery.ResolutionHeightDpiKey); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public nint ExposureMode { + public nint? ExposureMode { get { return GetNInt (NSMetadataQuery.ExposureModeKey); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public double ExposureTimeSeconds { + public double? ExposureTimeSeconds { get { - return GetDouble (NSMetadataQuery.ExposureTimeSecondsKey); + return GetNullableDouble (NSMetadataQuery.ExposureTimeSecondsKey); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string ExifVersion { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.ExifVersionKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.ExifVersionKey)); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string CameraOwner { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.CameraOwnerKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.CameraOwnerKey)); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public nint FocalLength35mmKey { + public nint? FocalLength35mmKey { get { return GetNInt (NSMetadataQuery.FocalLength35mmKey); } @@ -465,42 +486,42 @@ public nint FocalLength35mmKey { [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string LensModel { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.LensModelKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.LensModelKey)); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string ExifGpsVersion { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.ExifGpsVersionKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.ExifGpsVersionKey)); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public double AltitudeKey { + public double? AltitudeKey { get { - return GetDouble (NSMetadataQuery.AltitudeKey); + return GetNullableDouble (NSMetadataQuery.AltitudeKey); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public double Latitude { + public double? Latitude { get { - return GetDouble (NSMetadataQuery.LatitudeKey); + return GetNullableDouble (NSMetadataQuery.LatitudeKey); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public double Longitude { + public double? Longitude { get { - return GetDouble (NSMetadataQuery.LongitudeKey); + return GetNullableDouble (NSMetadataQuery.LongitudeKey); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public double Speed { + public double? Speed { get { - return GetDouble (NSMetadataQuery.SpeedKey); + return GetNullableDouble (NSMetadataQuery.SpeedKey); } } @@ -512,93 +533,93 @@ public NSDate Timestamp { } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public double GpsTrack { + public double? GpsTrack { get { - return GetDouble (NSMetadataQuery.GpsTrackKey); + return GetNullableDouble (NSMetadataQuery.GpsTrackKey); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public double ImageDirection { + public double? ImageDirection { get { - return GetDouble (NSMetadataQuery.ImageDirectionKey); + return GetNullableDouble (NSMetadataQuery.ImageDirectionKey); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string NamedLocation { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.NamedLocationKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.NamedLocationKey)); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string GpsStatus { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.GpsStatusKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.GpsStatusKey)); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string GpsMeasureMode { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.GpsMeasureModeKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.GpsMeasureModeKey)); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public double GpsDop { + public double? GpsDop { get { - return GetDouble (NSMetadataQuery.GpsDopKey); + return GetNullableDouble (NSMetadataQuery.GpsDopKey); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string GpsMapDatum { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.GpsMapDatumKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.GpsMapDatumKey)); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public double GpsDestLatitude { + public double? GpsDestLatitude { get { - return GetDouble (NSMetadataQuery.GpsDestLatitudeKey); + return GetNullableDouble (NSMetadataQuery.GpsDestLatitudeKey); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public double GpsDestLongitude { + public double? GpsDestLongitude { get { - return GetDouble (NSMetadataQuery.GpsDestLongitudeKey); + return GetNullableDouble (NSMetadataQuery.GpsDestLongitudeKey); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public double GpsDestBearing { + public double? GpsDestBearing { get { - return GetDouble (NSMetadataQuery.GpsDestBearingKey); + return GetNullableDouble (NSMetadataQuery.GpsDestBearingKey); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public double GpsDestDistance { + public double? GpsDestDistance { get { - return GetDouble (NSMetadataQuery.GpsDestDistanceKey); + return GetNullableDouble (NSMetadataQuery.GpsDestDistanceKey); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string GpsProcessingMethod { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.GpsProcessingMethodKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.GpsProcessingMethodKey)); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string GpsAreaInformation { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.GpsAreaInformationKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.GpsAreaInformationKey)); } } @@ -610,9 +631,9 @@ public NSDate GpsDateStamp { } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public double GpsDifferental { + public double? GpsDifferental { get { - return GetDouble (NSMetadataQuery.GpsDifferentalKey); + return GetNullableDouble (NSMetadataQuery.GpsDifferentalKey); } } @@ -631,28 +652,28 @@ public string [] MediaTypes { } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public bool Streamable { + public bool? Streamable { get { - return GetBool (NSMetadataQuery.StreamableKey); + return GetNullableBool (NSMetadataQuery.StreamableKey); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public nint TotalBitRate { + public nint? TotalBitRate { get { return GetNInt (NSMetadataQuery.TotalBitRateKey); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public nint VideoBitRate { + public nint? VideoBitRate { get { return GetNInt (NSMetadataQuery.VideoBitRateKey); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public nint AudioBitRate { + public nint? AudioBitRate { get { return GetNInt (NSMetadataQuery.AudioBitRateKey); } @@ -661,47 +682,47 @@ public nint AudioBitRate { [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string DeliveryType { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.DeliveryTypeKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.DeliveryTypeKey)); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string Album { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.AlbumKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.AlbumKey)); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public bool HasAlphaChannel { + public bool? HasAlphaChannel { get { - return GetBool (NSMetadataQuery.HasAlphaChannelKey); + return GetNullableBool (NSMetadataQuery.HasAlphaChannelKey); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public bool RedEyeOnOff { + public bool? RedEyeOnOff { get { - return GetBool (NSMetadataQuery.RedEyeOnOffKey); + return GetNullableBool (NSMetadataQuery.RedEyeOnOffKey); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string MeteringMode { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.MeteringModeKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.MeteringModeKey)); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public double MaxApertureKey { + public double? MaxApertureKey { get { - return GetDouble (NSMetadataQuery.MaxApertureKey); + return GetNullableDouble (NSMetadataQuery.MaxApertureKey); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public nint FNumber { + public nint? FNumber { get { return GetNInt (NSMetadataQuery.FNumberKey); } @@ -710,117 +731,117 @@ public nint FNumber { [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string ExposureProgram { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.ExposureProgramKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.ExposureProgramKey)); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string ExposureTimeString { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.ExposureTimeStringKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.ExposureTimeStringKey)); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string Headline { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.HeadlineKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.HeadlineKey)); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string Instructions { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.InstructionsKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.InstructionsKey)); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string City { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.CityKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.CityKey)); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string StateOrProvince { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.StateOrProvinceKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.StateOrProvinceKey)); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string Country { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.CountryKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.CountryKey)); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string TextContent { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.TextContentKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.TextContentKey)); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public nint AudioSampleRate { + public nint? AudioSampleRate { get { return GetNInt (NSMetadataQuery.AudioSampleRateKey); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public nint AudioChannelCount { + public nint? AudioChannelCount { get { return GetNInt (NSMetadataQuery.AudioChannelCountKey); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public double TempoKey { + public double? TempoKey { get { - return GetDouble (NSMetadataQuery.TempoKey); + return GetNullableDouble (NSMetadataQuery.TempoKey); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string KeySignature { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.KeySignatureKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.KeySignatureKey)); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string TimeSignature { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.TimeSignatureKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.TimeSignatureKey)); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string AudioEncodingApplication { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.AudioEncodingApplicationKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.AudioEncodingApplicationKey)); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string Composer { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.ComposerKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.ComposerKey)); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string Lyricist { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.LyricistKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.LyricistKey)); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public nint AudioTrackNumber { + public nint? AudioTrackNumber { get { return GetNInt (NSMetadataQuery.AudioTrackNumberKey); } @@ -836,19 +857,19 @@ public NSDate RecordingDate { [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string MusicalGenre { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.MusicalGenreKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.MusicalGenreKey)); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public bool IsGeneralMidiSequence { + public bool? IsGeneralMidiSequence { get { - return GetBool (NSMetadataQuery.IsGeneralMidiSequenceKey); + return GetNullableBool (NSMetadataQuery.IsGeneralMidiSequenceKey); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public nint RecordingYear { + public nint? RecordingYear { get { return GetNInt (NSMetadataQuery.RecordingYearKey); } @@ -870,7 +891,7 @@ public string [] Languages { [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string Rights { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.RightsKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.RightsKey)); } } @@ -912,14 +933,14 @@ public string Theme { [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string Description { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.DescriptionKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.DescriptionKey)); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string Identifier { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.IdentifierKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.IdentifierKey)); } } @@ -931,37 +952,37 @@ public string [] Audiences { } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public nint NumberOfPages { + public nint? NumberOfPages { get { return GetNInt (NSMetadataQuery.NumberOfPagesKey); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public double PageWidth { + public double? PageWidth { get { - return GetDouble (NSMetadataQuery.PageWidthKey); + return GetNullableDouble (NSMetadataQuery.PageWidthKey); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public double PageHeight { + public double? PageHeight { get { - return GetDouble (NSMetadataQuery.PageHeightKey); + return GetNullableDouble (NSMetadataQuery.PageHeightKey); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string SecurityMethod { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.SecurityMethodKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.SecurityMethodKey)); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string Creator { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.CreatorKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.CreatorKey)); } } @@ -980,9 +1001,9 @@ public NSDate DueDate { } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public double StarRatingKey { + public double? StarRatingKey { get { - return GetDouble (NSMetadataQuery.StarRatingKey); + return GetNullableDouble (NSMetadataQuery.StarRatingKey); } } @@ -1010,7 +1031,7 @@ public string [] InstantMessageAddresses { [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string Kind { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.KindKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.KindKey)); } } @@ -1024,7 +1045,7 @@ public string [] Recipients { [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string FinderComment { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.FinderCommentKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.FinderCommentKey)); } } @@ -1038,21 +1059,21 @@ public string [] Fonts { [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string AppleLoopsRoot { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.AppleLoopsRootKeyKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.AppleLoopsRootKeyKey)); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string AppleLoopsKeyFilterType { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.AppleLoopsKeyFilterTypeKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.AppleLoopsKeyFilterTypeKey)); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string AppleLoopsLoopMode { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.AppleLoopsLoopModeKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.AppleLoopsLoopModeKey)); } } @@ -1066,49 +1087,49 @@ public string [] AppleLoopDescriptors { [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string MusicalInstrumentCategory { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.MusicalInstrumentCategoryKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.MusicalInstrumentCategoryKey)); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string MusicalInstrumentName { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.MusicalInstrumentNameKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.MusicalInstrumentNameKey)); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string CFBundleIdentifier { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.CFBundleIdentifierKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.CFBundleIdentifierKey)); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string Information { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.InformationKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.InformationKey)); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string Director { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.DirectorKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.DirectorKey)); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string Producer { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.ProducerKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.ProducerKey)); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string Genre { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.GenreKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.GenreKey)); } } @@ -1122,14 +1143,14 @@ public string [] Performers { [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string OriginalFormat { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.OriginalFormatKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.OriginalFormatKey)); } } [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string OriginalSource { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.OriginalSourceKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.OriginalSourceKey)); } } @@ -1162,9 +1183,9 @@ public string [] RecipientAddresses { } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public bool IsLikelyJunk { + public bool? IsLikelyJunk { get { - return GetBool (NSMetadataQuery.IsLikelyJunkKey); + return GetNullableBool (NSMetadataQuery.IsLikelyJunkKey); } } @@ -1178,7 +1199,7 @@ public string [] ExecutableArchitectures { [NoWatch, NoTV, NoiOS, Mac (10, 9)] public string ExecutablePlatform { get { - return (string) Runtime.GetNSObject (GetHandle (NSMetadataQuery.ExecutablePlatformKey)); + return NSString.FromHandle (GetHandle (NSMetadataQuery.ExecutablePlatformKey)); } } @@ -1190,9 +1211,9 @@ public string [] ApplicationCategories { } [NoWatch, NoTV, NoiOS, Mac (10, 9)] - public bool IsApplicationManaged { + public bool? IsApplicationManaged { get { - return GetBool (NSMetadataQuery.IsApplicationManagedKey); + return GetNullableBool (NSMetadataQuery.IsApplicationManagedKey); } } #endif diff --git a/src/Foundation/NSProgress.cs b/src/Foundation/NSProgress.cs index 3bde6c98c808..689e91dc28e3 100644 --- a/src/Foundation/NSProgress.cs +++ b/src/Foundation/NSProgress.cs @@ -7,22 +7,22 @@ namespace XamCore.Foundation { public partial class NSProgress { //Manual bindings until BindAs support is merged public nint? EstimatedTimeRemaining { - get { return _EstimatedTimeRemaining == null ? null : (nint?)_EstimatedTimeRemaining.NIntValue; } + get { return _EstimatedTimeRemaining?.NIntValue; } set { _EstimatedTimeRemaining = value != null ? new NSNumber (value.Value) : null; } } public nint? Throughput { - get { return _Throughput == null ? null : (nint?)_Throughput.NIntValue; } + get { return _Throughput?.NIntValue; } set { _Throughput = value != null ? new NSNumber (value.Value) : null; } } public nint? FileTotalCount { - get { return _FileTotalCount == null ? null : (nint?)_FileTotalCount.NIntValue; } + get { return _FileTotalCount?.NIntValue; } set { _FileTotalCount = value != null ? new NSNumber (value.Value) : null; } } public nint? FileCompletedCount { - get { return _FileCompletedCount == null ? null : (nint?)_FileCompletedCount.NIntValue; } + get { return _FileCompletedCount?.NIntValue; } set { _FileCompletedCount = value != null ? new NSNumber (value.Value) : null; } } } diff --git a/src/foundation.cs b/src/foundation.cs index c8b3830a4a63..2729c42c4e11 100644 --- a/src/foundation.cs +++ b/src/foundation.cs @@ -257,11 +257,11 @@ partial interface NSAttributedString : NSCoding, NSMutableCopying, NSSecureCodin string[] ReadableTypeIdentifiersForItemProvider { get; } #if !TVOS && !WATCHOS - [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [NoWatch, NoTV, Mac (10,13), iOS (11,0)] [Static] [Export ("objectWithItemProviderData:typeIdentifier:error:")] [return: NullAllowed] - INSItemProviderReading GetObject (NSData data, string typeIdentifier, [NullAllowed] out NSError outError); + NSAttributedString FromItemProviderData (NSData itemProviderData, string typeIdentifier, [NullAllowed] out NSError outError); #endif // From the NSItemProviderWriting protocol, a static method. @@ -1754,7 +1754,7 @@ interface NSDateFormatter { [iOS (8,0), Mac (10,10)] [Export ("setLocalizedDateFormatFromTemplate:")] - void SetLocalizedDateFormat (string dateFormatTemplate); + void SetLocalizedDateFormatFromTemplate (string dateFormatTemplate); [Watch (2, 0), TV (9, 0), Mac (10, 10), iOS (8, 0)] [Export ("formattingContext", ArgumentSemantic.Assign)] @@ -6004,7 +6004,7 @@ partial interface NSUrl : NSSecureCoding, NSCopying [Static] [Export ("objectWithItemProviderData:typeIdentifier:error:")] [return: NullAllowed] - INSItemProviderReading GetObject (NSData data, string typeIdentifier, [NullAllowed] out NSError outError); + NSUrl FromItemProviderData (NSData itemProviderData, string typeIdentifier, [NullAllowed] out NSError outError); [NoWatch, NoTV, Mac (10,13), iOS (11,0)] [Static] @@ -6920,25 +6920,17 @@ partial interface NSUrlSessionTask : NSCopying NSProgress Progress { get; } #endif -//1) ApiSelectorTest.InstanceMethods (Introspection.MacApiSelectorTest.ApiSelectorTest.InstanceMethods) -// 6 errors found in 22990 instance selector validated: -//Selector not found for Foundation.NSUrlSessionTask : countOfBytesClientExpectsToReceive -//Selector not found for Foundation.NSUrlSessionTask : setCountOfBytesClientExpectsToReceive: -//Selector not found for Foundation.NSUrlSessionTask : countOfBytesClientExpectsToSend -//Selector not found for Foundation.NSUrlSessionTask : setCountOfBytesClientExpectsToSend: -//Selector not found for Foundation.NSUrlSessionTask : earliestBeginDate -//Selector not found for Foundation.NSUrlSessionTask : setEarliestBeginDate: - //[Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)] - //[NullAllowed, Export ("earliestBeginDate", ArgumentSemantic.Copy)] - //NSDate EarliestBeginDate { get; set; } + [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)] + [NullAllowed, Export ("earliestBeginDate", ArgumentSemantic.Copy)] + NSDate EarliestBeginDate { get; set; } - //[Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)] - //[Export ("countOfBytesClientExpectsToSend")] - //long CountOfBytesClientExpectsToSend { get; set; } + [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)] + [Export ("countOfBytesClientExpectsToSend")] + long CountOfBytesClientExpectsToSend { get; set; } - //[Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)] - //[Export ("countOfBytesClientExpectsToReceive")] - //long CountOfBytesClientExpectsToReceive { get; set; } + [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)] + [Export ("countOfBytesClientExpectsToReceive")] + long CountOfBytesClientExpectsToReceive { get; set; } } @@ -8097,7 +8089,7 @@ interface NSString2 : NSSecureCoding, NSMutableCopying [Static] [Export ("objectWithItemProviderData:typeIdentifier:error:")] [return: NullAllowed] - INSItemProviderReading GetObject (NSData data, string typeIdentifier, [NullAllowed] out NSError outError); + NSString FromItemProviderData (NSData itemProviderData, string typeIdentifier, [NullAllowed] out NSError outError); [NoWatch, NoTV, Mac (10,13), iOS (11,0)] [Static] @@ -9742,11 +9734,19 @@ partial interface NSItemProvider : NSCopying { [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] [Export ("canLoadObjectOfClass:")] - bool CanLoadObjectOfClass (Class aClass); + bool CanLoadObject (Class aClass); + + [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Wrap ("CanLoadObject (new Class (type))")] + bool CanLoadObject (Type type); [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] [Async, Export ("loadObjectOfClass:completionHandler:")] - NSProgress LoadObjectOfClass (Class aClass, Action completionHandler); + NSProgress LoadObject (Class aClass, Action completionHandler); + + [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Async, Wrap ("LoadObject (new Class (type), completionHandler)")] + NSProgress LoadObject (Type type, Action completionHandler); } delegate NSProgress RegisterFileRepresentationLoadHandler ([BlockCallback] RegisterFileRepresentationCompletionHandler completionHandler); @@ -9755,7 +9755,7 @@ partial interface NSItemProvider : NSCopying { delegate NSProgress RegisterDataRepresentationLoadHandler ([BlockCallback] ItemProviderDataCompletionHandler completionHandler); delegate void LoadInPlaceFileRepresentationHandler (NSUrl fileUrl, bool isInPlace, NSError error); delegate NSProgress RegisterObjectRepresentationLoadHandler ([BlockCallback] RegisterObjectRepresentationCompletionHandler completionHandler); - delegate void RegisterObjectRepresentationCompletionHandler (NSItemProviderWriting @object, NSError error); + delegate void RegisterObjectRepresentationCompletionHandler (INSItemProviderWriting @object, NSError error); interface INSItemProviderReading {} @@ -9784,8 +9784,7 @@ interface NSItemProviderReading interface INSItemProviderWriting {} [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] - [Protocol, Model] - [BaseType (typeof(NSObject))] + [Protocol] interface NSItemProviderWriting { // diff --git a/tests/introspection/Mac/MacApiSelectorTest.cs b/tests/introspection/Mac/MacApiSelectorTest.cs index bb589e7d4e32..2d342371b72f 100644 --- a/tests/introspection/Mac/MacApiSelectorTest.cs +++ b/tests/introspection/Mac/MacApiSelectorTest.cs @@ -326,6 +326,15 @@ protected override bool Skip (Type type, string selectorName) if (Mac.CheckSystemVersion (10, 11)) return true; break; + case "earliestBeginDate": + case "setEarliestBeginDate:": + case "countOfBytesClientExpectsToSend": + case "setCountOfBytesClientExpectsToSend:": + case "countOfBytesClientExpectsToReceive": + case "setCountOfBytesClientExpectsToReceive:": + if (Mac.CheckSystemVersion (10, 13)) + return true; + break; } break; case "NSUrlSessionConfiguration": diff --git a/tests/introspection/iOS/iOSApiSelectorTest.cs b/tests/introspection/iOS/iOSApiSelectorTest.cs index 69b393522929..5bbb0682dc6d 100644 --- a/tests/introspection/iOS/iOSApiSelectorTest.cs +++ b/tests/introspection/iOS/iOSApiSelectorTest.cs @@ -183,6 +183,15 @@ protected override bool CheckResponse (bool value, Type actualType, MethodBase m if (TestRuntime.CheckXcodeVersion (7, 0)) return true; break; + case "earliestBeginDate": + case "setEarliestBeginDate:": + case "countOfBytesClientExpectsToSend": + case "setCountOfBytesClientExpectsToSend:": + case "countOfBytesClientExpectsToReceive": + case "setCountOfBytesClientExpectsToReceive:": + if (TestRuntime.CheckXcodeVersion (9, 0)) + return true; + break; } break; case "NSUrlSessionConfiguration": diff --git a/tests/monotouch-test/Foundation/UrlSessionTaskTest.cs b/tests/monotouch-test/Foundation/UrlSessionTaskTest.cs index bc0f145a261f..608aaaf5e4af 100644 --- a/tests/monotouch-test/Foundation/UrlSessionTaskTest.cs +++ b/tests/monotouch-test/Foundation/UrlSessionTaskTest.cs @@ -52,6 +52,14 @@ public void Properties () task.TaskDescription = "descriptive label"; Assert.That ((string)task.TaskDescription, Is.EqualTo ("descriptive label"), "setTaskDescription:"); Assert.That (task.TaskIdentifier, Is.GreaterThanOrEqualTo (0), "taskIdentifier"); + + Console.WriteLine ("Earliest being date: " + task.EarliestBeginDate); + + if (TestRuntime.CheckXcodeVersion (9, 0)) { + Assert.Null (task.EarliestBeginDate, "earliestBeginDate"); + Assert.That (task.CountOfBytesClientExpectsToSend, Is.EqualTo (-1), "countOfBytesClientExpectsToSend"); + Assert.That (task.CountOfBytesClientExpectsToReceive, Is.EqualTo (-1), "countOfBytesClientExpectsToReceive"); + } } } From 33e7fd533566c7e365605aff588d58bf00cee998 Mon Sep 17 00:00:00 2001 From: Timothy Risi Date: Thu, 10 Aug 2017 16:06:02 -0800 Subject: [PATCH 5/8] Ad another Wrap method --- src/foundation.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/foundation.cs b/src/foundation.cs index 2729c42c4e11..1201e97c6d24 100644 --- a/src/foundation.cs +++ b/src/foundation.cs @@ -9732,6 +9732,10 @@ partial interface NSItemProvider : NSCopying { [Export ("registerObjectOfClass:visibility:loadHandler:")] void RegisterObject (Class aClass, NSItemProviderRepresentationVisibility visibility, RegisterObjectRepresentationLoadHandler loadHandler); + [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] + [Wrap ("RegisterObject (new Class (type), visibility, loadHandler)")] + void RegisterObject (Type type, NSItemProviderRepresentationVisibility visibility, RegisterObjectRepresentationLoadHandler loadHandler); + [Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)] [Export ("canLoadObjectOfClass:")] bool CanLoadObject (Class aClass); From 594202a2828de882fc91debcc25de81fc6cc9e53 Mon Sep 17 00:00:00 2001 From: Timothy Risi Date: Fri, 11 Aug 2017 11:32:13 -0800 Subject: [PATCH 6/8] More PR fixes --- src/foundation.cs | 2 -- src/mapkit.cs | 3 ++- tests/introspection/iOS/iOSApiSelectorTest.cs | 1 + tests/monotouch-test/Foundation/UrlSessionTaskTest.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/foundation.cs b/src/foundation.cs index 1201e97c6d24..5b6f644ac533 100644 --- a/src/foundation.cs +++ b/src/foundation.cs @@ -6914,11 +6914,9 @@ partial interface NSUrlSessionTask : NSCopying float Priority { get; set; } /* float, not CGFloat */ #endif -#if MONOMAC // Introspection fails for iOS [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)] [Export ("progress", ArgumentSemantic.Strong)] NSProgress Progress { get; } -#endif [Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)] [NullAllowed, Export ("earliestBeginDate", ArgumentSemantic.Copy)] diff --git a/src/mapkit.cs b/src/mapkit.cs index f6014aaed144..b13e7620f935 100644 --- a/src/mapkit.cs +++ b/src/mapkit.cs @@ -283,7 +283,8 @@ interface MKDirectionsRequest { [Since (6,0)] [TV (9,2)] [Mac (10,9, onlyOn64 : true)] - interface MKMapItem { + interface MKMapItem : NSItemProviderReading, NSItemProviderWriting + { [Export ("placemark", ArgumentSemantic.Retain)] MKPlacemark Placemark { get; } diff --git a/tests/introspection/iOS/iOSApiSelectorTest.cs b/tests/introspection/iOS/iOSApiSelectorTest.cs index 5bbb0682dc6d..d525ac966a6d 100644 --- a/tests/introspection/iOS/iOSApiSelectorTest.cs +++ b/tests/introspection/iOS/iOSApiSelectorTest.cs @@ -189,6 +189,7 @@ protected override bool CheckResponse (bool value, Type actualType, MethodBase m case "setCountOfBytesClientExpectsToSend:": case "countOfBytesClientExpectsToReceive": case "setCountOfBytesClientExpectsToReceive:": + case "progress": if (TestRuntime.CheckXcodeVersion (9, 0)) return true; break; diff --git a/tests/monotouch-test/Foundation/UrlSessionTaskTest.cs b/tests/monotouch-test/Foundation/UrlSessionTaskTest.cs index 608aaaf5e4af..47cc1698de93 100644 --- a/tests/monotouch-test/Foundation/UrlSessionTaskTest.cs +++ b/tests/monotouch-test/Foundation/UrlSessionTaskTest.cs @@ -52,7 +52,7 @@ public void Properties () task.TaskDescription = "descriptive label"; Assert.That ((string)task.TaskDescription, Is.EqualTo ("descriptive label"), "setTaskDescription:"); Assert.That (task.TaskIdentifier, Is.GreaterThanOrEqualTo (0), "taskIdentifier"); - + Assert.NotNull (task.Progress, "progress"); Console.WriteLine ("Earliest being date: " + task.EarliestBeginDate); if (TestRuntime.CheckXcodeVersion (9, 0)) { From 55c8e44a3f1ffa262bdb49bbd68a3dec85d3b638 Mon Sep 17 00:00:00 2001 From: Timothy Risi Date: Fri, 11 Aug 2017 14:33:33 -0800 Subject: [PATCH 7/8] MKMapItem only uses NSItemProviderReading/Writing on iOS --- src/mapkit.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mapkit.cs b/src/mapkit.cs index b13e7620f935..6d533a746b1c 100644 --- a/src/mapkit.cs +++ b/src/mapkit.cs @@ -283,7 +283,10 @@ interface MKDirectionsRequest { [Since (6,0)] [TV (9,2)] [Mac (10,9, onlyOn64 : true)] - interface MKMapItem : NSItemProviderReading, NSItemProviderWriting + interface MKMapItem +#if IOS // #if TARGET_OS_IOS + : NSItemProviderReading, NSItemProviderWriting +#endif { [Export ("placemark", ArgumentSemantic.Retain)] MKPlacemark Placemark { get; } From 0f6a1a9e92f0c447edc5954d9395b155d2b91ba0 Mon Sep 17 00:00:00 2001 From: Timothy Risi Date: Sun, 13 Aug 2017 00:13:46 -0800 Subject: [PATCH 8/8] Move NSUrlSessionTask.Progress test into the Xcode 9 check --- tests/monotouch-test/Foundation/UrlSessionTaskTest.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/monotouch-test/Foundation/UrlSessionTaskTest.cs b/tests/monotouch-test/Foundation/UrlSessionTaskTest.cs index 47cc1698de93..ca276c0c90b1 100644 --- a/tests/monotouch-test/Foundation/UrlSessionTaskTest.cs +++ b/tests/monotouch-test/Foundation/UrlSessionTaskTest.cs @@ -52,13 +52,12 @@ public void Properties () task.TaskDescription = "descriptive label"; Assert.That ((string)task.TaskDescription, Is.EqualTo ("descriptive label"), "setTaskDescription:"); Assert.That (task.TaskIdentifier, Is.GreaterThanOrEqualTo (0), "taskIdentifier"); - Assert.NotNull (task.Progress, "progress"); - Console.WriteLine ("Earliest being date: " + task.EarliestBeginDate); if (TestRuntime.CheckXcodeVersion (9, 0)) { Assert.Null (task.EarliestBeginDate, "earliestBeginDate"); Assert.That (task.CountOfBytesClientExpectsToSend, Is.EqualTo (-1), "countOfBytesClientExpectsToSend"); Assert.That (task.CountOfBytesClientExpectsToReceive, Is.EqualTo (-1), "countOfBytesClientExpectsToReceive"); + Assert.NotNull (task.Progress, "progress"); } } }