|
@@ -27,6 +27,19 @@ typedef NS_OPTIONS(NSInteger, CEditingLoadType) {
|
|
CEditingLoadTypeImage = (1UL << 1),
|
|
CEditingLoadTypeImage = (1UL << 1),
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+typedef NS_OPTIONS(NSInteger, CEditingLocation) {
|
|
|
|
+ CEditingLocationLineBegin = 0,
|
|
|
|
+ CEditingLoadTypeLineEnd,
|
|
|
|
+ CEditingLoadTypeSectionBegin,
|
|
|
|
+ CEditingLoadTypeSectionEnd,
|
|
|
|
+ CEditingLoadTypePreWord,
|
|
|
|
+ CEditingLoadTypeNextWord,
|
|
|
|
+ CEditingLoadTypePreCharPlace,
|
|
|
|
+ CEditingLoadTypeNextCharPlace,
|
|
|
|
+ CEditingLoadTypeUpCharPlace,
|
|
|
|
+ CEditingLoadTypeDownCharPlace,
|
|
|
|
+};
|
|
|
|
+
|
|
typedef NS_ENUM(NSInteger, CPDFDisplayDirection) {
|
|
typedef NS_ENUM(NSInteger, CPDFDisplayDirection) {
|
|
CPDFDisplayDirectionVertical = 0,
|
|
CPDFDisplayDirectionVertical = 0,
|
|
CPDFDisplayDirectionHorizontal = 1,
|
|
CPDFDisplayDirectionHorizontal = 1,
|
|
@@ -40,6 +53,12 @@ typedef NS_ENUM(NSInteger, CPDFDisplayMode) {
|
|
CPDFDisplayModeCustom = 4
|
|
CPDFDisplayModeCustom = 4
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+typedef NS_OPTIONS(NSInteger, CAddEditingAreaType) {
|
|
|
|
+ CAddEditingAreaTypeNone = 0,
|
|
|
|
+ CAddEditingAreaTypeText,
|
|
|
|
+ CAddEditingAreaTypeImage,
|
|
|
|
+};
|
|
|
|
+
|
|
extern NSNotificationName const CPDFViewDocumentChangedNotification;
|
|
extern NSNotificationName const CPDFViewDocumentChangedNotification;
|
|
extern NSNotificationName const CPDFViewPageChangedNotification;
|
|
extern NSNotificationName const CPDFViewPageChangedNotification;
|
|
|
|
|
|
@@ -78,6 +97,8 @@ extern NSNotificationName const CPDFViewPageChangedNotification;
|
|
|
|
|
|
@interface CPDFEditTextArea : CPDFEditArea
|
|
@interface CPDFEditTextArea : CPDFEditArea
|
|
|
|
|
|
|
|
+- (nullable NSString *)editTextAreaString;
|
|
|
|
+
|
|
@end
|
|
@end
|
|
|
|
|
|
|
|
|
|
@@ -89,6 +110,8 @@ extern NSNotificationName const CPDFViewPageChangedNotification;
|
|
|
|
|
|
@property (nonatomic,assign) BOOL isCropMode;
|
|
@property (nonatomic,assign) BOOL isCropMode;
|
|
|
|
|
|
|
|
+- (nullable UIImage *)thumbnailImageWithSize:(CGSize)thumbSize;
|
|
|
|
+
|
|
@end
|
|
@end
|
|
|
|
|
|
#pragma mark - CPDFEditingConfig
|
|
#pragma mark - CPDFEditingConfig
|
|
@@ -165,6 +188,10 @@ extern NSNotificationName const CPDFViewPageChangedNotification;
|
|
|
|
|
|
- (void)PDFEditingViewShouldEndEditing:(CPDFView *)pdfView textView:(UITextView *)textView;
|
|
- (void)PDFEditingViewShouldEndEditing:(CPDFView *)pdfView textView:(UITextView *)textView;
|
|
|
|
|
|
|
|
+- (void)PDFViewEditingAddTextArea:(CPDFView * _Nonnull)pdfView addPage:(CPDFPage * _Nonnull )page addRect:(CGRect)rect;
|
|
|
|
+
|
|
|
|
+- (void)PDFViewEditingAddImageArea:(CPDFView * _Nonnull)pdfView addPage:(CPDFPage * _Nonnull)page addRect:(CGRect)rect;
|
|
|
|
+
|
|
- (BOOL)PDFEditingViewCanPerformAction:(SEL)action withSender:(id)sender;
|
|
- (BOOL)PDFEditingViewCanPerformAction:(SEL)action withSender:(id)sender;
|
|
|
|
|
|
@end
|
|
@end
|
|
@@ -446,18 +473,25 @@ extern NSNotificationName const CPDFViewPageChangedNotification;
|
|
* This method is about configuring of editing content.
|
|
* This method is about configuring of editing content.
|
|
*/
|
|
*/
|
|
@property (nonatomic,retain) CPDFEditingConfig *editingConfig;
|
|
@property (nonatomic,retain) CPDFEditingConfig *editingConfig;
|
|
-
|
|
|
|
-@property (nonatomic,readonly) CEditingLoadType editingLoadType ;
|
|
|
|
|
|
+/**
|
|
|
|
+ * The properties of the editing modes: Edit text, edit images, edit text & images.
|
|
|
|
+ */
|
|
|
|
+@property (nonatomic,readonly) CEditingLoadType editingLoadType;
|
|
|
|
|
|
/**
|
|
/**
|
|
* Begins editing content.
|
|
* Begins editing content.
|
|
*/
|
|
*/
|
|
- (void)beginEditingLoadType:(CEditingLoadType)editingLoadType;
|
|
- (void)beginEditingLoadType:(CEditingLoadType)editingLoadType;
|
|
/**
|
|
/**
|
|
- * Change editing content.
|
|
|
|
|
|
+ * Change the editing modes.
|
|
*/
|
|
*/
|
|
- (void)changeEditingLoadType:(CEditingLoadType)editingLoadType;
|
|
- (void)changeEditingLoadType:(CEditingLoadType)editingLoadType;
|
|
|
|
|
|
|
|
+
|
|
|
|
+- (CAddEditingAreaType)shouAddEditAreaType;
|
|
|
|
+
|
|
|
|
+- (void)setShouAddEditAreaType:(CAddEditingAreaType)shouAddEditAreaType;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Ends editing content.
|
|
* Ends editing content.
|
|
*/
|
|
*/
|
|
@@ -495,6 +529,12 @@ extern NSNotificationName const CPDFViewPageChangedNotification;
|
|
*/
|
|
*/
|
|
- (CEditingSelectState )editStatus;
|
|
- (CEditingSelectState )editStatus;
|
|
|
|
|
|
|
|
+- (void)endEditIsRemoveBlockWithEditArea:(CPDFEditArea *)editArea;
|
|
|
|
+
|
|
|
|
+- (void)clearEditingSelectCharItem;
|
|
|
|
+
|
|
|
|
+- (void)clearEditingSelectCharRange;
|
|
|
|
+
|
|
|
|
|
|
#pragma mark - Edit Text & Image
|
|
#pragma mark - Edit Text & Image
|
|
|
|
|
|
@@ -532,64 +572,78 @@ extern NSNotificationName const CPDFViewPageChangedNotification;
|
|
|
|
|
|
/**
|
|
/**
|
|
* Gets the font size of a text block or a piece of text.
|
|
* Gets the font size of a text block or a piece of text.
|
|
|
|
+ *
|
|
*/
|
|
*/
|
|
-- (CGFloat)editingSelectionFontSize;
|
|
|
|
|
|
+- (CGFloat)editingSelectionFontSize DEPRECATED_MSG_ATTRIBUTE("use editingSelectionFontSizesWithTextArea instead.");
|
|
|
|
+- (CGFloat)editingSelectionFontSizesWithTextArea:(CPDFEditTextArea *)textArea;
|
|
|
|
|
|
/**
|
|
/**
|
|
* Sets the font size of a text block or a piece of text.
|
|
* Sets the font size of a text block or a piece of text.
|
|
*/
|
|
*/
|
|
-- (void)setEditingSelectionFontSize:(CGFloat)fontSize;
|
|
|
|
|
|
+- (void)setEditingSelectionFontSize:(CGFloat)fontSize withTextArea:(CPDFEditTextArea *)textArea isAutoSize:(BOOL)isAutoSize;
|
|
|
|
|
|
|
|
+- (void)setEditingSelectionFontSize:(CGFloat)fontSize DEPRECATED_MSG_ATTRIBUTE("use setEditingAutoSelectionFontSize:withTextArea:isAutoSize: instead.");
|
|
/**
|
|
/**
|
|
* Gets the font color of a text block or a piece of text.
|
|
* Gets the font color of a text block or a piece of text.
|
|
*/
|
|
*/
|
|
-- (CPDFKitPlatformColor *)editingSelectionFontColor;
|
|
|
|
|
|
+- (CPDFKitPlatformColor *)editingSelectionFontColor DEPRECATED_MSG_ATTRIBUTE("use editingSelectionFontColorWithTextArea instead,");
|
|
|
|
+
|
|
|
|
+- (CPDFKitPlatformColor *)editingSelectionFontColorWithTextArea:(CPDFEditTextArea *)textArea;
|
|
|
|
|
|
/**
|
|
/**
|
|
* Sets the font color of a text block or a piece of text.
|
|
* Sets the font color of a text block or a piece of text.
|
|
*/
|
|
*/
|
|
-- (void)setEditingSelectionFontColor:(CPDFKitPlatformColor *)fontColor;
|
|
|
|
|
|
+- (void)setEditingSelectionFontColor:(CPDFKitPlatformColor *)fontColor DEPRECATED_MSG_ATTRIBUTE("use setEditingSelectionFontColor:withTextArea: instead.");
|
|
|
|
+
|
|
|
|
+- (void)setEditingSelectionFontColor:(CPDFKitPlatformColor *)fontColor withTextArea:(CPDFEditTextArea *)textArea;
|
|
|
|
|
|
/**
|
|
/**
|
|
* Gets the alignment of a text block or a piece of text.
|
|
* Gets the alignment of a text block or a piece of text.
|
|
*/
|
|
*/
|
|
-- (NSTextAlignment)editingSelectionAlignment;
|
|
|
|
|
|
+- (NSTextAlignment)editingSelectionAlignment DEPRECATED_MSG_ATTRIBUTE("use editingSelectionAlignmentWithTextArea: instead.");
|
|
|
|
+- (NSTextAlignment)editingSelectionAlignmentWithTextArea:(CPDFEditTextArea *)textArea;
|
|
|
|
|
|
/**
|
|
/**
|
|
* Sets the alignment of a text block or a piece of text.
|
|
* Sets the alignment of a text block or a piece of text.
|
|
*/
|
|
*/
|
|
-- (void)setCurrentSelectionAlignment:(NSTextAlignment)alignment;
|
|
|
|
|
|
+- (void)setCurrentSelectionAlignment:(NSTextAlignment)alignment DEPRECATED_MSG_ATTRIBUTE("use setCurrentSelectionAlignment:withTextArea: instead.");
|
|
|
|
+- (void)setCurrentSelectionAlignment:(NSTextAlignment)alignment withTextArea:(CPDFEditTextArea *)textArea;
|
|
|
|
|
|
/**
|
|
/**
|
|
* The font name of the currently selected text block.
|
|
* The font name of the currently selected text block.
|
|
*/
|
|
*/
|
|
-- (NSString *)editingSelectionFontName;
|
|
|
|
|
|
+- (NSString *)editingSelectionFontName DEPRECATED_MSG_ATTRIBUTE("use editingSelectionFontNameWithTextArea instead.");
|
|
|
|
+- (NSString *)editingSelectionFontNameWithTextArea:(CPDFEditTextArea *)textArea;
|
|
|
|
|
|
/**
|
|
/**
|
|
* Sets the font name of the selected text block. (Several standard fonts are currently supported)
|
|
* Sets the font name of the selected text block. (Several standard fonts are currently supported)
|
|
*/
|
|
*/
|
|
-- (void)setEditingSelectionFontName:(NSString *)fontName;
|
|
|
|
|
|
+- (void)setEditingSelectionFontName:(NSString *)fontName DEPRECATED_MSG_ATTRIBUTE("use setEditingSelectionFontName: withTextArea: instead.");
|
|
|
|
+- (void)setEditingSelectionFontName:(NSString *)fontName withTextArea:(CPDFEditTextArea *)textArea;
|
|
|
|
|
|
/**
|
|
/**
|
|
* Sets the currently selected text is italic.
|
|
* Sets the currently selected text is italic.
|
|
*/
|
|
*/
|
|
-- (void)setCurrentSelectionIsItalic:(BOOL)isItalic;
|
|
|
|
|
|
+- (void)setCurrentSelectionIsItalic:(BOOL)isItalic DEPRECATED_MSG_ATTRIBUTE("use setCurrentSelectionIsItalic: withTextArea: instead.");
|
|
|
|
+- (void)setCurrentSelectionIsItalic:(BOOL)isItalic withTextArea:(CPDFEditTextArea *)textArea;
|
|
|
|
|
|
/**
|
|
/**
|
|
* Whether the font of the currently selected text block is italic.
|
|
* Whether the font of the currently selected text block is italic.
|
|
*/
|
|
*/
|
|
-- (BOOL)isItalicCurrentSelection;
|
|
|
|
|
|
+- (BOOL)isItalicCurrentSelection DEPRECATED_MSG_ATTRIBUTE("use isItalicCurrentSelectionWithTextArea: instead.");
|
|
|
|
+- (BOOL)isItalicCurrentSelectionWithTextArea:(CPDFEditTextArea *)textArea;
|
|
|
|
|
|
/**
|
|
/**
|
|
* Sets the currently selected text is bold.
|
|
* Sets the currently selected text is bold.
|
|
*/
|
|
*/
|
|
-- (void)setCurrentSelectionIsBold:(BOOL)isBold;
|
|
|
|
|
|
+- (void)setCurrentSelectionIsBold:(BOOL)isBold DEPRECATED_MSG_ATTRIBUTE("use setCurrentSelectionIsBold:withTextArea: instead.");
|
|
|
|
+- (void)setCurrentSelectionIsBold:(BOOL)isBold withTextArea:(CPDFEditTextArea *)textArea;
|
|
|
|
|
|
/**
|
|
/**
|
|
* Whether the font of the currently selected text block is bold.
|
|
* Whether the font of the currently selected text block is bold.
|
|
*/
|
|
*/
|
|
-- (BOOL)isBoldCurrentSelection;
|
|
|
|
-
|
|
|
|
|
|
+- (BOOL)isBoldCurrentSelection DEPRECATED_MSG_ATTRIBUTE("isBoldCurrentSelectionWithTextArea:");
|
|
|
|
+- (BOOL)isBoldCurrentSelectionWithTextArea:(CPDFEditTextArea *)textArea;
|
|
/**
|
|
/**
|
|
* Create a blank text block.
|
|
* Create a blank text block.
|
|
* @param rect The area of the text box.
|
|
* @param rect The area of the text box.
|
|
@@ -598,19 +652,53 @@ extern NSNotificationName const CPDFViewPageChangedNotification;
|
|
* @return Returns whether the creation is successful.
|
|
* @return Returns whether the creation is successful.
|
|
*/
|
|
*/
|
|
- (BOOL)createEmptyStringBounds:(CGRect)rect withAttributes:(NSDictionary<NSAttributedStringKey, id> *)attributes page:(CPDFPage *)page;
|
|
- (BOOL)createEmptyStringBounds:(CGRect)rect withAttributes:(NSDictionary<NSAttributedStringKey, id> *)attributes page:(CPDFPage *)page;
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* Sets text transparency.
|
|
* Sets text transparency.
|
|
*/
|
|
*/
|
|
-- (BOOL)setCharsFontTransparency:(float)transparency;
|
|
|
|
|
|
+- (BOOL)setCharsFontTransparency:(float)transparency DEPRECATED_MSG_ATTRIBUTE("use setCharsFontTransparency:withTextArea: instead.");
|
|
|
|
+- (BOOL)setCharsFontTransparency:(float)transparency withTextArea:(CPDFEditTextArea *)textArea;
|
|
|
|
|
|
|
|
+- (void)jumpEditingLoction:(CEditingLocation)editingLocation withTextArea:(CPDFEditTextArea *)editArea isSelectRanage:(BOOL)isSelectRanage;
|
|
|
|
+/**
|
|
|
|
+ * Get the opacity of image boxes or the last character of the text.
|
|
|
|
+ */
|
|
- (CGFloat)getCurrentOpacity;
|
|
- (CGFloat)getCurrentOpacity;
|
|
-
|
|
|
|
|
|
+/**
|
|
|
|
+ * Get the font size of a certain range of text.
|
|
|
|
+ */
|
|
|
|
+- (CGFloat)editingSelectionFontSizeByRangeEditArea:(CPDFEditTextArea *)editArea;
|
|
|
|
+/**
|
|
|
|
+ * Get the font color of a certain range of text.
|
|
|
|
+ */
|
|
|
|
+- (CPDFKitPlatformColor *)editingSelectionFontColorByRangeEditArea:(CPDFEditTextArea *)editArea;
|
|
|
|
+/**
|
|
|
|
+ * Get the font name of a certain range of text.
|
|
|
|
+ */
|
|
|
|
+- (NSString *)editingSelectionFontNameByRangeEditArea:(CPDFEditTextArea *)editArea;
|
|
|
|
+/**
|
|
|
|
+ * Determine whether a certain range of text is italic.
|
|
|
|
+ */
|
|
|
|
+- (BOOL)isItalicCurrentSelectionByRangeEditArea:(CPDFEditTextArea *)editArea;
|
|
|
|
+/**
|
|
|
|
+ * Determine whether a certain range of text is bold.
|
|
|
|
+ */
|
|
|
|
+- (BOOL)isBoldCurrentSelectionByRangeEditArea:(CPDFEditTextArea *)editArea;
|
|
|
|
+/**
|
|
|
|
+ * Get the alignment of a certain range of text.
|
|
|
|
+ */
|
|
|
|
+- (NSTextAlignment)currentSelectionAlignmentByRangeEditArea:(CPDFEditTextArea *)editArea;
|
|
|
|
+/**
|
|
|
|
+ * Get the opacity of a certain range of text.
|
|
|
|
+ */
|
|
|
|
+- (CGFloat)opacityByRangeForEditArea:(CPDFEditArea *)editArea;
|
|
/**
|
|
/**
|
|
* Gets the Edit supported font name.
|
|
* Gets the Edit supported font name.
|
|
*/
|
|
*/
|
|
- (NSArray*)getFontList;
|
|
- (NSArray*)getFontList;
|
|
|
|
|
|
|
|
+- (BOOL)textFocusedOnWithTextArea:(CPDFEditTextArea *)textArea;
|
|
|
|
+- (BOOL)textFocusedOffWithTextArea:(CPDFEditTextArea *)textArea;
|
|
|
|
+
|
|
#pragma mark - Edit Image
|
|
#pragma mark - Edit Image
|
|
|
|
|
|
/*
|
|
/*
|