|
@@ -67,6 +67,11 @@ extern NSNotificationName const CPDFViewPageChangedNotification;
|
|
|
*/
|
|
|
- (BOOL)IsTextArea;
|
|
|
|
|
|
+/**
|
|
|
+ * Whether it is image code block.
|
|
|
+ */
|
|
|
+- (BOOL)IsImageArea;
|
|
|
+
|
|
|
@end
|
|
|
|
|
|
#pragma mark - CPDFEditTextArea
|
|
@@ -76,6 +81,18 @@ extern NSNotificationName const CPDFViewPageChangedNotification;
|
|
|
@end
|
|
|
|
|
|
|
|
|
+#pragma mark - CPDFEditImageArea
|
|
|
+
|
|
|
+@interface CPDFEditImageArea : CPDFEditArea
|
|
|
+
|
|
|
+@property (nonatomic,readonly) CGRect cropRect;
|
|
|
+
|
|
|
+@property (nonatomic,assign) BOOL isCropMode;
|
|
|
+
|
|
|
+@end
|
|
|
+
|
|
|
+#pragma mark - CPDFEditingConfig
|
|
|
+
|
|
|
@interface CPDFEditingConfig : NSObject
|
|
|
|
|
|
/**
|
|
@@ -461,76 +478,80 @@ extern NSNotificationName const CPDFViewPageChangedNotification;
|
|
|
- (CPDFEditArea *)editingArea;
|
|
|
|
|
|
/**
|
|
|
-* Sets the position of the text (image) block
|
|
|
-*/
|
|
|
-- (void)setBoundsEditArea:(CPDFEditArea *)editArea withBounds:(CGRect)bounds;
|
|
|
+ * Clicks the context menu of block.
|
|
|
+ */
|
|
|
+- (NSArray<UIMenuItem *> *)menuItemsEditingAtPoint:(CGPoint)point forPage:(CPDFPage *)page;
|
|
|
|
|
|
/**
|
|
|
-* Delete text (image) block
|
|
|
-*/
|
|
|
-- (void)deleteEditingArea:(CPDFEditArea *)editArea;
|
|
|
+ * The statuses when editing.
|
|
|
+ *
|
|
|
+ * @see CEditingSelectState
|
|
|
+ */
|
|
|
+- (CEditingSelectState )editStatus;
|
|
|
+
|
|
|
+#pragma mark - Edit Text & Image
|
|
|
|
|
|
/**
|
|
|
- * Clicks the context menu of block.
|
|
|
+ * Sets the position of the text (image) block
|
|
|
*/
|
|
|
-- (NSArray<UIMenuItem *> *)menuItemsEditingAtPoint:(CGPoint)point forPage:(CPDFPage *)page;
|
|
|
+- (void)setBoundsEditArea:(CPDFEditArea *)editArea withBounds:(CGRect)bounds;
|
|
|
|
|
|
/**
|
|
|
- * Gets the font size of a text block or a piece of text.
|
|
|
+ * Delete text (image) block
|
|
|
*/
|
|
|
-- (CGFloat)editingSelectionFontSize;
|
|
|
+- (void)deleteEditingArea:(CPDFEditArea *)editArea;
|
|
|
|
|
|
/**
|
|
|
- * Sets the font size of a text block or a piece of text.
|
|
|
+ * Whether to support undo on current page.
|
|
|
*/
|
|
|
-- (void)setEditingSelectionFontSize:(CGFloat)fontSize;
|
|
|
+- (BOOL)canEditTextUndo;
|
|
|
|
|
|
/**
|
|
|
- * Gets the font color of a text block or a piece of text.
|
|
|
+ * Whether to support redo on current page.
|
|
|
*/
|
|
|
-- (CPDFKitPlatformColor *)editingSelectionFontColor;
|
|
|
+- (BOOL)canEditTextRedo;
|
|
|
|
|
|
/**
|
|
|
- * Sets the font color of a text block or a piece of text.
|
|
|
+ * Undo on current page.
|
|
|
*/
|
|
|
-- (void)setEditingSelectionFontColor:(CPDFKitPlatformColor *)fontColor;
|
|
|
+- (void)editTextUndo;
|
|
|
|
|
|
/**
|
|
|
- * Gets the alignment of a text block or a piece of text.
|
|
|
+ * Redo on current page.
|
|
|
*/
|
|
|
-- (NSTextAlignment)editingSelectionAlignment;
|
|
|
+- (void)editTextRedo;
|
|
|
+
|
|
|
+#pragma mark - Edit Text
|
|
|
|
|
|
/**
|
|
|
- * Sets the alignment of a text block or a piece of text.
|
|
|
+ * Gets the font size of a text block or a piece of text.
|
|
|
*/
|
|
|
-- (void)setCurrentSelectionAlignment:(NSTextAlignment)alignment;
|
|
|
+- (CGFloat)editingSelectionFontSize;
|
|
|
|
|
|
/**
|
|
|
- * The statuses when editing.
|
|
|
- *
|
|
|
- * @see CEditingSelectState
|
|
|
+ * Sets the font size of a text block or a piece of text.
|
|
|
*/
|
|
|
-- (CEditingSelectState )editStatus;
|
|
|
+- (void)setEditingSelectionFontSize:(CGFloat)fontSize;
|
|
|
|
|
|
/**
|
|
|
- * Whether to support undo on current page.
|
|
|
+ * Gets the font color of a text block or a piece of text.
|
|
|
*/
|
|
|
-- (BOOL)canEditTextUndo;
|
|
|
+- (CPDFKitPlatformColor *)editingSelectionFontColor;
|
|
|
|
|
|
/**
|
|
|
- * Whether to support redo on current page.
|
|
|
+ * Sets the font color of a text block or a piece of text.
|
|
|
*/
|
|
|
-- (BOOL)canEditTextRedo;
|
|
|
+- (void)setEditingSelectionFontColor:(CPDFKitPlatformColor *)fontColor;
|
|
|
|
|
|
/**
|
|
|
- * Undo on current page.
|
|
|
+ * Gets the alignment of a text block or a piece of text.
|
|
|
*/
|
|
|
-- (void)editTextUndo;
|
|
|
+- (NSTextAlignment)editingSelectionAlignment;
|
|
|
|
|
|
/**
|
|
|
- * Redo on current page.
|
|
|
+ * Sets the alignment of a text block or a piece of text.
|
|
|
*/
|
|
|
-- (void)editTextRedo;
|
|
|
+- (void)setCurrentSelectionAlignment:(NSTextAlignment)alignment;
|
|
|
|
|
|
/**
|
|
|
* The font name of the currently selected text block.
|
|
@@ -570,79 +591,87 @@ extern NSNotificationName const CPDFViewPageChangedNotification;
|
|
|
* @return Returns whether the creation is successful.
|
|
|
*/
|
|
|
- (BOOL)createEmptyStringBounds:(CGRect)rect withAttributes:(NSDictionary<NSAttributedStringKey, id> *)attributes page:(CPDFPage *)page;
|
|
|
-/**
|
|
|
- * Gets the supported font name.
|
|
|
- */
|
|
|
-- (NSArray*)getFontList;
|
|
|
+
|
|
|
/**
|
|
|
* Sets text transparency.
|
|
|
*/
|
|
|
- (BOOL)setCharsFontTransparency:(float)transparency;
|
|
|
|
|
|
+/**
|
|
|
+ * Gets the Edit supported font name.
|
|
|
+ */
|
|
|
+- (NSArray*)getFontList;
|
|
|
+
|
|
|
+#pragma mark - Edit Image
|
|
|
+
|
|
|
/*
|
|
|
-* Get the rotation Angle of the picture
|
|
|
-*/
|
|
|
-- (void)getRotationEditArea:(CPDFEditArea*)editArea;
|
|
|
+ * Get the rotation Angle of the picture
|
|
|
+ */
|
|
|
+- (CGFloat)getRotationEditArea:(CPDFEditImageArea*)editArea;
|
|
|
|
|
|
/*
|
|
|
-* Sets the rotation angle of image.
|
|
|
-*/
|
|
|
-- (void)rotateEditArea:(CPDFEditArea *)editArea rotateAngle:(float)angle;
|
|
|
+ * Sets the rotation angle of image.
|
|
|
+ */
|
|
|
+- (void)rotateEditArea:(CPDFEditImageArea *)editArea rotateAngle:(float)angle;
|
|
|
|
|
|
/*
|
|
|
-* Mirrors the image horizontally.
|
|
|
-*/
|
|
|
-- (void)horizontalMirrorEditArea:(CPDFEditArea *)editArea;
|
|
|
+ * Mirrors the image horizontally.
|
|
|
+ */
|
|
|
+- (BOOL)horizontalMirrorEditArea:(CPDFEditImageArea *)editArea;
|
|
|
|
|
|
/*
|
|
|
-* Mirrors the image vertically.
|
|
|
-*/
|
|
|
-- (void)verticalMirrorEditArea:(CPDFEditArea *)editArea;
|
|
|
+ * Mirrors the image vertically.
|
|
|
+ */
|
|
|
+- (BOOL)verticalMirrorEditArea:(CPDFEditImageArea *)editArea;
|
|
|
|
|
|
/*
|
|
|
-* Crops the specified size.
|
|
|
-*/
|
|
|
-- (void)cropEditArea:(CPDFEditArea *)editArea WithRect:(CGRect)rect;
|
|
|
+ * Crops the specified size.
|
|
|
+ */
|
|
|
+- (void)cropEditArea:(CPDFEditImageArea *)editArea withRect:(CGRect)rect;
|
|
|
|
|
|
/*
|
|
|
-* Gets the cropped size.
|
|
|
-*/
|
|
|
-- (CGRect)getClipRectEditArea:(CPDFEditArea *)editArea;
|
|
|
+ * Gets the cropped size.
|
|
|
+ */
|
|
|
+- (CGRect)getClipRectEditArea:(CPDFEditImageArea *)editArea;
|
|
|
|
|
|
/*
|
|
|
-* Ends cropping.
|
|
|
-*/
|
|
|
-- (void)beginCropEditArea:(CPDFEditArea *)editArea;
|
|
|
+ * Ends cropping.
|
|
|
+ */
|
|
|
+- (void)beginCropEditArea:(CPDFEditImageArea *)editArea;
|
|
|
|
|
|
/*
|
|
|
-* End cutting
|
|
|
-*/
|
|
|
-- (void)endCropEditArea:(CPDFEditArea *)editArea;
|
|
|
+ * End cutting
|
|
|
+ */
|
|
|
+- (void)endCropEditArea:(CPDFEditImageArea *)editArea;
|
|
|
|
|
|
/*
|
|
|
-* Extracts the image to the specified path.
|
|
|
-*/
|
|
|
-- (BOOL)extractImageEditArea:(CPDFEditArea *)editArea filePath:(NSString*)filePath;
|
|
|
+ * Extracts the image to the specified path.
|
|
|
+ */
|
|
|
+- (BOOL)extractImageEditArea:(CPDFEditImageArea *)editArea filePath:(NSString*)filePath;
|
|
|
|
|
|
/*
|
|
|
-* Extracts the image to the specified path.
|
|
|
-*/
|
|
|
+ * Extracts the image to the specified path.
|
|
|
+ */
|
|
|
- (BOOL)extractImageWithEditImageArea:(CPDFEditArea *)editArea;
|
|
|
|
|
|
/*
|
|
|
-* Gets image transparency.
|
|
|
-*/
|
|
|
-- (float)getImageTransparencyEditArea:(CPDFEditArea *)editArea;
|
|
|
+ * Gets image transparency.
|
|
|
+ */
|
|
|
+- (float)getImageTransparencyEditArea:(CPDFEditImageArea *)editArea;
|
|
|
|
|
|
/*
|
|
|
-* Sets image transparency.
|
|
|
-*/
|
|
|
-- (BOOL)setImageTransparencyEditArea:(CPDFEditArea *)editArea transparency:(float)transparency;
|
|
|
+ * Sets image transparency.
|
|
|
+ */
|
|
|
+- (BOOL)setImageTransparencyEditArea:(CPDFEditImageArea *)editArea transparency:(float)transparency;
|
|
|
|
|
|
/*
|
|
|
-* Adds interface of the image.
|
|
|
-*/
|
|
|
+ * Adds interface of the image.
|
|
|
+ */
|
|
|
- (BOOL)createEmptyImage:(CGRect)rect page:(CPDFPage *)page path:(NSString*)imagePath;
|
|
|
|
|
|
-- (BOOL)replaceEditImageArea:(CPDFEditArea *)editArea imagePath:(NSString *)imagePath;
|
|
|
+/*
|
|
|
+ * Replace of the image.
|
|
|
+ */
|
|
|
+- (BOOL)replaceEditImageArea:(CPDFEditImageArea *)editArea imagePath:(NSString *)imagePath;
|
|
|
+
|
|
|
@end
|