From 733780091df526bf083c237f7b508d17c5fa3163 Mon Sep 17 00:00:00 2001 From: iska Date: Tue, 22 Nov 2016 01:24:02 +0100 Subject: [PATCH] Add method declaration for comparing HTML Ranges --- Sources/HTMLRange.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Sources/HTMLRange.h b/Sources/HTMLRange.h index fe460e6..e17cc05 100644 --- a/Sources/HTMLRange.h +++ b/Sources/HTMLRange.h @@ -8,6 +8,15 @@ #import "HTMLNode.h" +NS_ASSUME_NONNULL_BEGIN + +typedef NS_ENUM(unsigned short, HTMLRangeComparisonMethod) +{ + HTMLRangeComparisonMethodStartToStart = 0, + HTMLRangeComparisonMethodStartToEnd = 1, + HTMLRangeComparisonMethodEndToEnd = 2, + HTMLRangeComparisonMethodEndToStart = 3 +}; #pragma mark - DOM Range @@ -128,4 +137,17 @@ */ - (void)selectNodeContents:(HTMLNode *)node; + +/** + Compares the boundary points of this range with the given source range. + + @param method The comparison method. + @param sourceRange The range to compare with. + @return `NSOrderedAscending` if ordered before, `NSOrderedSame` if ordered same, `NSOrderedDescending` otherwise. + + @see HTMLRangeComparisonMethod + */ +- (NSComparisonResult)compareBoundaryPoints:(HTMLRangeComparisonMethod)method sourceRange:(HTMLRange *)sourceRange; @end + +NS_ASSUME_NONNULL_END