// // CPDFListView.h // ComPDFKit // // Copyright © 2014-2022 PDF Technologies, Inc. All Rights Reserved. // // THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW // AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT. // UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES. // This notice may not be removed from this file. // #import #import #import extern NSNotificationName const CPDFListViewSelectionChangedNotification; extern NSNotificationName const CPDFListViewToolModeChangeNotification; extern NSNotificationName const CPDFListViewAnnotationTypeChangeNotification; extern NSNotificationName const CPDFListViewMagnificationChangedNotification; extern NSNotificationName const CPDFListViewDidAddAnnotationNotification; extern NSNotificationName const CPDFListViewDidRemoveAnnotationNotification; extern NSNotificationName const CPDFListViewActiveAnnotationsChangeNotification; extern NSNotificationName const CPDFListViewAnnotationsAttributeHasChangeNotification; typedef NS_ENUM(NSInteger, CPDFViewSidebarSpeedMode) { CPDFViewSidebarSpeedModeLeft = 0, CPDFViewSidebarSpeedModeRight }; typedef NS_ENUM(NSInteger, CAnnotationType) { CAnnotationTypeUnkown = 0, CAnnotationTypeAnchored, CAnnotationTypeLink, CAnnotationTypeFreeText, CAnnotationTypeLine, CAnnotationTypeArrow, CAnnotationTypeSquare, CAnnotationTypeCircle, /*CAnnotationTypePolyGon,*/ /*CAnnotationTypePolyLine,*/ CAnnotationTypeHighlight, CAnnotationTypeUnderline, // CAnnotationTypeSquiggly, CAnnotationTypeStrikeOut, CAnnotationTypeStamp, CAnnotationTypeSignSignature, /*CAnnotationTypeCaret,*/ CAnnotationTypeInk, /*CAnnotationTypePopUp,*/ /*CAnnotationTypeFileattachment,*/ /*CAnnotationTypeSound,*/ /*CAnnotationTypeMovie,*/ CAnnotationTypeRedact, CAnnotationTypeEraser, CAnnotationTypeAddText, CAnnotationTypeAddImage, CAnnotationTypeRadioButton = 100, CAnnotationTypeCheckBox, CAnnotationTypeTextField, CAnnotationTypeComboBox, CAnnotationTypeListMenu, CAnnotationTypeActionButton, CAnnotationTypeSignature, CAnnotationTypeSignText = 200, CAnnotationTypeSignFalse, CAnnotationTypeSignTure, CAnnotationTypeSignCircle, CAnnotationTypeSignLine, CAnnotationTypeSignDot, CAnnotationTypeSignConfig, CAnnotationTypeSignDate, }; typedef NS_ENUM(NSInteger, CToolMode) { CTextToolMode = 0, CMoveToolMode, CMagnifyToolMode, CSelectToolMode, CNoteToolMode, CSelectZoomToolMode, CFormToolMode, CSelfSignMode, CRedactToolMode, CRedactErasureToolMode, CEditPDFToolMode, }; @protocol CPDFListViewDelegate; @class CStampSignatureObject,CPDFListStampAnnotation,CPDFListSignatureAnnotation; @interface CPDFListView : CPDFView @property (nonatomic, weak) idpdfListViewDelegate; // Methods for The currently selected Annotation. @property (nonatomic, readonly) NSMutableArray *activeAnnotations; // Methods for The currently selected Annotation. @property (nonatomic, readonly) CPDFAnnotation * activeAnnotation; // Methods for The annotation type currently selected. @property (nonatomic, assign) CAnnotationType annotationType; // Method of the currently selected annotation mode. @property (nonatomic, assign) CToolMode toolMode; // The magnification times when the current magnifying glass is in mode @property (nonatomic, readonly) CGFloat magnification; @property (nonatomic, assign) BOOL isSetLinkDestinationArea; // Show Annotation or not @property (nonatomic, assign) BOOL hideNotes; // Whether to display a Form comment hop number @property (nonatomic, assign) BOOL showHopnumber; // Whether to display the Form name @property (nonatomic, assign) BOOL showFormFieldName; // Auxiliary reference line @property (nonatomic, strong) CAShapeLayer *shapeLayerLeftV; @property (nonatomic, strong) CAShapeLayer *shapeLayerRightV; @property (nonatomic, strong) CAShapeLayer *shapeLayerTopH; @property (nonatomic, strong) CAShapeLayer *shapeLayerBottomH; - (CPDFAnnotation *)addAnnotationWithType:(CAnnotationType)annotationType selection:(CPDFSelection *)selection page:(CPDFPage *)page bounds:(NSRect)bounds; // Add stamp Annotation, add directly after mouse click // a new parameter. // stampObject - stamp Object. // isToolModel - Whether it is a pattern - (void)setAddStampObject:(CStampSignatureObject *)stampObject keepToolModel:(BOOL)isToolModel; // Add an image Stamp note - (void)addAnnotationWithImage:(NSImage *)image page:(CPDFPage *)page point:(NSPoint)point; // Refresh the currently selected Annotation - (void)updateActiveAnnotations:(NSArray *)activeAnnotation; // Edit Annotation - (void)editAnnotation:(CPDFAnnotation *)annotation; // Rotate Stamp notes, angle 0-360 degrees,Rotation is supported only by the current addition - (void)rotateStampAnnotation:(CPDFListStampAnnotation *)annotation rotateAngle:(NSInteger)angle; // Rotate Signature notes, angle 0-360 degrees,Rotation is supported only by the current addition - (void)rotateSignatureAnnotation:(CPDFListSignatureAnnotation *)annotation rotateAngle:(NSInteger)angle; // When selecting a region mode, the selected region is obtained - (NSRect)currentSelectionRect; // Scale the page to the specified range - (void)zoomToRect:(NSRect)rect onPage:(CPDFPage *)page; // Remove Auxiliary reference line - (void)removeShapeLayer; @end @protocol CPDFListViewDelegate @optional - (void)PDFListViewChangedSelectionOrMagnification:(CPDFListView *)pdfListView; - (void)PDFListViewDidSelectionEnd:(CPDFListView *)pdfListView; - (void)PDFListViewChangedMagnification:(CPDFListView *)pdfListView; - (void)PDFListViewChangedToolMode:(CPDFListView *)pdfListView forToolMode:(CToolMode)toolMode; - (void)PDFListViewChangedAnnotationType:(CPDFListView *)pdfListView forAnnotationType:(CAnnotationType)annotationType; - (NSColor *)PDFListViewBackgroundColor; - (void)PDFListViewAddAnnotations:(CPDFListView *)pdfListView forAddAnnotations:(NSArray *)annotations inPage:(CPDFPage *)pdfPage; - (void)PDFListViewRemoveAnnotations:(CPDFListView *)pdfListView forRemoveAnnotations:(NSArray *)annotations inPage:(CPDFPage *)pdfPage; - (void)PDFListViewDeleteAnnotations:(CPDFListView *)pdfListView forDeleteAnnotations:(NSArray *)annotations inPage:(CPDFPage *)pdfPage; - (void)PDFListViewChangeatioActiveAnnotations:(CPDFListView *)pdfListView forActiveAnnotations:(NSArray *)annotations isRightMenu:(BOOL)isRightMenu; - (void)PDFListViewMenuForEvent:(CPDFListView *)pdfListView forEvent:(NSEvent *)theEvent clickMenu:(NSMenu **)menu; - (BOOL)PDFListViewMenuValidate:(CPDFListView *)pdfListView menuItem:(NSMenuItem *)menuItem isTakesEffect:(BOOL *)isTakesEffect; - (void)PDFListViewEditAnnotation:(CPDFListView *)pdfListView forAnnotation:(CPDFAnnotation *)anotation; - (BOOL)PDFListViewKeyDownIsContinue:(CPDFListView *)pdfListView theEvent:(NSEvent *)theEvent; - (NSArray *)PDFListViewMenuItemsEditingAtPoint:(CGPoint)point forPage:(CPDFPage *)page menuItems:(NSArray *)menuItems; - (void)PDFListViewRedactErasure:(CPDFListView *)pdfListView; - (void)PDFListViewLinkDestinationStart:(CPDFListView *)pdfListView withActiveAnnotation:(CPDFAnnotation *)annotation; - (void)PDFListViewLinkDestinationEnd:(CPDFListView *)pdfListView withActiveAnnotation:(CPDFAnnotation *)annotation; - (void)PDFListViewKeyDowClosePanel:(CPDFViewSidebarSpeedMode)speedy event:(NSEvent *)theEvent; - (NSArray *)PDFListViewEventMarkupColorWithAnnotation:(CPDFAnnotation *)annotation; - (BOOL)PDFListViewHaveDocumentAttribute; // 是否需要绘制注释 【文字、背景】 - (BOOL)PDFListView:(CPDFListView *)pdfListView needDrawAnnotation:(CPDFAnnotation *)annotation; - (void)PDFListViewAnnotationAttributeHasChange:(CPDFListView *)pdfListView withAnnotation:(CPDFAnnotation *)annotation; @end