Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/ImageCaptureCore/Defs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,25 @@ public enum ICExifOrientationType : ulong {
Orientation8 = 8,
}

#if XAMCORE_5_0
[Native]
public enum ICReturnCodeOffset : long {
Comment on lines +43 to +44
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is a breaking change.

#else
public enum ICReturnCodeOffset {
#endif
Thumbnail = -21000,
Metadata = -21050,
Download = -21100,
Delete = -21150,
ExFat = -21200,
Ptp = -21250,
System = -21300,
/// <summary>The device error code offset.</summary>
Device = -21350,
/// <summary>The device connection error code offset.</summary>
DeviceConnection = -21400,
/// <summary>The object error code offset.</summary>
Object = -21450,
}

[Native]
Expand Down Expand Up @@ -281,5 +292,9 @@ enum ICTransportType {
TcpIp,
[Field ("ICTransportTypeMassStorage")]
MassStorage,
/// <summary>Represents a proximity transport type for devices.</summary>
[Mac (14, 0)]
[Field ("ICTransportTypeProximity")]
Proximity,
}
}
37 changes: 37 additions & 0 deletions src/imagecapturecore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@

namespace ImageCaptureCore {

/// <summary>Completion handler for <see cref="ICCameraFile.RequestSecurityScopedUrl" />.</summary>
delegate void ICCameraFileRequestSecurityScopedUrlCompletionHandler ([NullAllowed] NSUrl url, [NullAllowed] NSError error);
/// <summary>Completion handler for <see cref="ICCameraFile.RequestFingerprint" />.</summary>
delegate void ICCameraFileRequestFingerprintCompletionHandler ([NullAllowed] string fingerprint, [NullAllowed] NSError error);

interface IICDeviceDelegate { }

[Static]
Expand Down Expand Up @@ -414,6 +419,35 @@ interface ICCameraFile {

[NullAllowed, Export ("sidecarFiles")]
ICCameraItem [] SidecarFiles { get; }

/// <summary>Gets the fingerprint generated from the camera file data.</summary>
[Mac (13, 0)]
[NullAllowed, Export ("fingerprint")]
string Fingerprint { get; }

/// <summary>Generates a fingerprint for the file at the specified URL.</summary>
/// <param name="url">The URL of the file for which to generate a fingerprint.</param>
/// <returns>The fingerprint string, or <see langword="null" /> if the fingerprint could not be generated.</returns>
[Mac (15, 0)]
[Static]
[Export ("fingerprintForFileAtURL:")]
[return: NullAllowed]
string GetFingerprint (NSUrl url);

/// <summary>Requests a security-scoped URL for a media file on a mass storage volume.</summary>
/// <param name="completion">A callback invoked with the security-scoped URL and any error that occurred.</param>
/// <remarks>The returned <see cref="NSUrl" /> requires the use of <c>StartAccessingSecurityScopedResource</c> and <c>StopAccessingSecurityScopedResource</c> for access.</remarks>
[Mac (14, 0)]
[Export ("requestSecurityScopedURLWithCompletion:")]
[Async]
void RequestSecurityScopedUrl (ICCameraFileRequestSecurityScopedUrlCompletionHandler completion);

/// <summary>Requests a fingerprint to be generated for the camera file.</summary>
/// <param name="completion">A callback invoked with the generated fingerprint string and any error that occurred.</param>
[Mac (15, 0)]
[Export ("requestFingerprintWithCompletion:")]
[Async]
void RequestFingerprint (ICCameraFileRequestFingerprintCompletionHandler completion);
}

[Protocol, Model]
Expand Down Expand Up @@ -532,9 +566,11 @@ interface ICCameraDevice {
[Export ("requestSyncClock")]
void RequestSyncClock ();

[Deprecated (PlatformName.MacOSX, 14, 0, message: "Third party cameras that support the standard take picture command will have the capability enabled by default. This call will have no effect.")]
[Export ("requestEnableTethering")]
void RequestEnableTethering ();

[Deprecated (PlatformName.MacOSX, 14, 0, message: "Third party cameras that support the standard take picture command will have the capability enabled by default. This call will have no effect.")]
[Export ("requestDisableTethering")]
void RequestDisableTethering ();

Expand All @@ -553,6 +589,7 @@ interface ICCameraDevice {
[Export ("cancelDownload")]
void CancelDownload ();

[Deprecated (PlatformName.MacOSX, 14, 0, message: "Sandbox restrictions prohibit writing directly to device hardware.")]
[Export ("requestUploadFile:options:uploadDelegate:didUploadSelector:contextInfo:")]
void RequestUploadFile (NSUrl fileUrl, NSDictionary<NSString, NSObject> options, NSObject uploadDelegate, Selector didUploadSelector, [NullAllowed] IntPtr contextInfo);

Expand Down
2 changes: 2 additions & 0 deletions tests/cecil-tests/Documentation.KnownFailures.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13902,6 +13902,8 @@ M:ImageCaptureCore.ICCameraDeviceDelegate.DidReceiveButtonPress(ImageCaptureCore
M:ImageCaptureCore.ICCameraDeviceDelegate.DidReceiveCustomNotification(ImageCaptureCore.ICDevice,Foundation.NSDictionary{Foundation.NSString,Foundation.NSObject},Foundation.NSData)
M:ImageCaptureCore.ICCameraDeviceDownloadDelegate_Extensions.DidDownloadFile(ImageCaptureCore.IICCameraDeviceDownloadDelegate,ImageCaptureCore.ICCameraFile,Foundation.NSError,Foundation.NSDictionary{Foundation.NSString,Foundation.NSObject},System.IntPtr)
M:ImageCaptureCore.ICCameraDeviceDownloadDelegate_Extensions.DidReceiveDownloadProgress(ImageCaptureCore.IICCameraDeviceDownloadDelegate,ImageCaptureCore.ICCameraFile,System.Int64,System.Int64)
M:ImageCaptureCore.ICCameraFile.RequestFingerprintAsync
M:ImageCaptureCore.ICCameraFile.RequestSecurityScopedUrlAsync
M:ImageCaptureCore.ICDevice.Dispose(System.Boolean)
M:ImageCaptureCore.ICDeviceBrowser.Dispose(System.Boolean)
M:ImageCaptureCore.ICDeviceBrowserDelegate_Extensions.DeviceDidChangeName(ImageCaptureCore.IICDeviceBrowserDelegate,ImageCaptureCore.ICDeviceBrowser,ImageCaptureCore.ICDevice)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
!missing-enum! ICLegacyReturnCode not bound
!missing-enum! ICMediaPresentation not bound
!missing-enum! ICReturnCode not bound
!missing-enum! ICReturnCodeOffset not bound
!missing-enum! ICReturnConnectionErrorCode not bound
!missing-enum! ICReturnDownloadErrorCode not bound
!missing-enum! ICReturnMetadataErrorCode not bound
Expand Down Expand Up @@ -51,6 +52,7 @@
!missing-field! ICStatusNotificationKey not bound
!missing-field! ICTransportTypeExFAT not bound
!missing-field! ICTransportTypeMassStorage not bound
!missing-field! ICTransportTypeProximity not bound
!missing-field! ICTransportTypeTCPIP not bound
!missing-field! ICTransportTypeUSB not bound
!missing-field! ICTruncateAfterSuccessfulDownload not bound
Expand Down Expand Up @@ -90,6 +92,8 @@
!missing-selector! ICCameraFile::fileCreationDate not bound
!missing-selector! ICCameraFile::fileModificationDate not bound
!missing-selector! ICCameraFile::fileSize not bound
!missing-selector! ICCameraFile::fingerprint not bound
!missing-selector! +ICCameraFile::fingerprintForFileAtURL: not bound
!missing-selector! ICCameraFile::firstPicked not bound
!missing-selector! ICCameraFile::gpsString not bound
!missing-selector! ICCameraFile::groupUUID not bound
Expand All @@ -101,8 +105,10 @@
!missing-selector! ICCameraFile::pairedRawImage not bound
!missing-selector! ICCameraFile::relatedUUID not bound
!missing-selector! ICCameraFile::requestDownloadWithOptions:completion: not bound
!missing-selector! ICCameraFile::requestFingerprintWithCompletion: not bound
!missing-selector! ICCameraFile::requestMetadataDictionaryWithOptions:completion: not bound
!missing-selector! ICCameraFile::requestReadDataAtOffset:length:completion: not bound
!missing-selector! ICCameraFile::requestSecurityScopedURLWithCompletion: not bound
!missing-selector! ICCameraFile::requestThumbnailDataWithOptions:completion: not bound
!missing-selector! ICCameraFile::setOrientation: not bound
!missing-selector! ICCameraFile::sidecarFiles not bound
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@
!unknown-native-enum! ICBrowsedDeviceType bound
!wrong-enum-size! ICScannerFunctionalUnitState managed 4 vs native 8

## ICReturnCodeOffset - fixing this is a breaking change (changing backing type from int to long)
!missing-enum-native! ICReturnCodeOffset
!wrong-enum-size! ICReturnCodeOffset managed 4 vs native 8

## new @required on existing protocols are breaking changes
!incorrect-protocol-member! ICCameraDeviceDelegate::cameraDevice:didReceiveThumbnail:forItem:error: is REQUIRED and should be abstract
!incorrect-protocol-member! ICCameraDeviceDelegate::cameraDevice:didReceiveThumbnailForItem: is OPTIONAL and should NOT be abstract

This file was deleted.

Loading