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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 50 additions & 1 deletion src/pdfkit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
#if MONOMAC
using AppKit;
using UIViewController = Foundation.NSObject;
using UIFindInteraction = Foundation.NSObject;
using UIFindInteractionDelegate = Foundation.NSObject;
using UIView = AppKit.NSView;
#else
using UIKit;
using NSColor = UIKit.UIColor;
Expand Down Expand Up @@ -432,6 +435,14 @@ interface PdfDocumentWriteOptionKeys {
[iOS (15,0), Mac (12,0), MacCatalyst (15,0)]
[Field ("PDFDocumentAccessPermissionsOption", "+PDFKit")]
NSString AccessPermissionsKey { get; }

[iOS (16,0), Mac (13,0), MacCatalyst (16,0)]
[Field ("PDFDocumentBurnInAnnotationsOption", "+PDFKit")]
NSString BurnInAnnotationsKey { get; }

[iOS (16,0), Mac (13,0), MacCatalyst (16,0)]
[Field ("PDFDocumentSaveTextFromOCROption", "+PDFKit")]
NSString SaveTextFromOCRKey { get; }
}

[Mac (10,13)]
Expand Down Expand Up @@ -1524,7 +1535,9 @@ interface PdfPage : NSCopying {
[DesignatedInitializer]
NativeHandle Constructor ();

#if !XAMCORE_5_0
[DesignatedInitializer]
#endif
[Export ("initWithImage:")]
NativeHandle Constructor (NSImage image);

Expand Down Expand Up @@ -1743,7 +1756,8 @@ interface PdfThumbnailView : NSCoding {
[BaseType (typeof (NSView), Name = "PDFView", Delegates = new string [] { "WeakDelegate" }, Events = new Type [] { typeof (PdfViewDelegate) })]
interface PdfView :
#if IOS
UIGestureRecognizerDelegate
// Uncomment this changes after Xcode 14 UIKit is bound - https://github.com/xamarin/xamarin-macios/issues/15623
UIGestureRecognizerDelegate//, UIFindInteractionDelegate
#else
NSMenuDelegate, NSAnimationDelegate
#endif
Expand Down Expand Up @@ -2065,6 +2079,23 @@ interface PdfView :
[Mac (10,13)]
[Export ("acceptsDraggedFiles")]
bool AcceptsDraggedFiles { get; set; }

[iOS (16,0), Mac (13,0), MacCatalyst (16,0)]
[NullAllowed, Export ("pageOverlayViewProvider", ArgumentSemantic.Weak)]
IPDFPageOverlayViewProvider PageOverlayViewProvider { get; set; }

[iOS (16,0), Mac (13,0), MacCatalyst (16,0)]
[Export ("inMarkupMode")]
bool InMarkupMode { [Bind ("isInMarkupMode")] get; set; }

// Uncomment this changes after Xcode 14 UIKit is bound - https://github.com/xamarin/xamarin-macios/issues/15623
// [iOS (16,0), NoMac, MacCatalyst (16,0)]
// [Export ("findInteraction")]
// UIFindInteraction FindInteraction { get; }

[iOS (16,0), NoMac, MacCatalyst (16,0)]
[Export ("findInteractionEnabled")]
bool FindInteractionEnabled { [Bind ("isFindInteractionEnabled")] get; set; }
}

[NoiOS]
Expand Down Expand Up @@ -2118,4 +2149,22 @@ interface PdfViewDelegate {
UIViewController ParentViewController { get; }
}

[Mac (13,0), iOS (16,0), MacCatalyst (16,0)]
interface IPDFPageOverlayViewProvider {}

[Mac (13,0), iOS (16,0), MacCatalyst (16,0)]
[Protocol]
interface PDFPageOverlayViewProvider
{
[Abstract]
[Export ("pdfView:overlayViewForPage:")]
[return: NullAllowed]
UIView RequestPdfView (PdfView view, PdfPage page);

[Export ("pdfView:willDisplayOverlayView:forPage:")]
void WillDisplay (PdfView pdfView, UIView overlayView, PdfPage page);

[Export ("pdfView:willEndDisplayingOverlayView:forPage:")]
void WillEndDisplaying (PdfView pdfView, UIView overlayView, PdfPage page);
}
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
# Field used in an EventArg based structure that are in documentation but not in headers
!unknown-field! PDFAnnotationHit bound

# Change set for XAMCORE_5_0
!extra-designated-initializer! PDFPage::initWithImage: is incorrectly decorated with an [DesignatedInitializer] attribute

# Uncomment these changes after Xcode 14 UIKit is bound - https://github.com/xamarin/xamarin-macios/issues/15623
!missing-protocol-conformance! PDFView should conform to UIFindInteractionDelegate
!missing-selector! PDFView::findInteraction not bound
17 changes: 0 additions & 17 deletions tests/xtro-sharpie/api-annotations-dotnet/iOS-PDFKit.todo

This file was deleted.

7 changes: 0 additions & 7 deletions tests/xtro-sharpie/api-annotations-dotnet/macOS-PDFKit.todo

This file was deleted.

7 changes: 7 additions & 0 deletions tests/xtro-sharpie/common-PDFKit.ignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
# Field used in an EventArg based structure that are in documentation but not in headers
!unknown-field! PDFAnnotationHit bound

# Change set for XAMCORE_5_0
!extra-designated-initializer! PDFPage::initWithImage: is incorrectly decorated with an [DesignatedInitializer] attribute

# Uncomment these changes after Xcode 14 UIKit is bound - https://github.com/xamarin/xamarin-macios/issues/15623
!missing-protocol-conformance! PDFView should conform to UIFindInteractionDelegate
!missing-selector! PDFView::findInteraction not bound
17 changes: 0 additions & 17 deletions tests/xtro-sharpie/iOS-PDFKit.todo

This file was deleted.

7 changes: 0 additions & 7 deletions tests/xtro-sharpie/macOS-PDFKit.todo

This file was deleted.