diff options
Diffstat (limited to 'WebKit/mac/WebView/WebTextIterator.h')
| -rw-r--r-- | WebKit/mac/WebView/WebTextIterator.h | 55 |
1 files changed, 42 insertions, 13 deletions
diff --git a/WebKit/mac/WebView/WebTextIterator.h b/WebKit/mac/WebView/WebTextIterator.h index e6f77ac..ab5ca4e 100644 --- a/WebKit/mac/WebView/WebTextIterator.h +++ b/WebKit/mac/WebView/WebTextIterator.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008 Apple Inc. All Rights Reserved. + * Copyright (C) 2008, 2009 Apple Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -25,13 +25,17 @@ #import <Foundation/Foundation.h> +#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4 +#define WebNSUInteger unsigned int +#else +#define WebNSUInteger NSUInteger +#endif @class DOMRange; @class DOMNode; @class WebTextIteratorPrivate; -@interface WebTextIterator : NSObject -{ +@interface WebTextIterator : NSObject { @private WebTextIteratorPrivate *_private; } @@ -39,28 +43,53 @@ - (id)initWithRange:(DOMRange *)range; /*! - @method advance: + @method advance @abstract Makes the WebTextIterator iterate to the next visible text element. */ - (void)advance; /*! - @method currentNode: - @result The current DOMNode in the WebTextIterator. + @method atEnd + @result YES if the WebTextIterator has reached the end of the DOMRange. */ -- (DOMNode *)currentNode; +- (BOOL)atEnd; /*! - @method currentText: - @result The current text in the WebTextIterator. + @method currentRange + @result A range, indicating the position within the document of the current text. */ -- (NSString *)currentText; +- (DOMRange *)currentRange; /*! - @method atEnd: - @result YES if the WebTextIterator has reached the end of the DOMRange. + @method currentTextPointer + @result A pointer to the current text. The pointer becomes invalid after any modification is made to the document; it must be used right away. */ -- (BOOL)atEnd; +- (const unichar *)currentTextPointer; + +/*! + @method currentTextLength + @result lengthPtr Length of the current text. + */ +- (WebNSUInteger)currentTextLength; + +@end + +@interface WebTextIterator (WebTextIteratorDeprecated) +/*! + @method currentNode + @abstract A convenience method that finds the first node in currentRange; it's almost always better to use currentRange instead. + @result The current DOMNode in the WebTextIterator + */ +- (DOMNode *)currentNode; + +/*! + @method currentText + @abstract A convenience method that makes an NSString out of the current text; it's almost always better to use currentTextPointer and currentTextLength instead. + @result The current text in the WebTextIterator. + */ +- (NSString *)currentText; @end + +#undef WebNSUInteger |
