OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Lars Knoll <lars@trolltech.com> | 2 * Copyright (C) 2006 Lars Knoll <lars@trolltech.com> |
3 * Copyright (C) 2007, 2011, 2012 Apple Inc. All rights reserved. | 3 * Copyright (C) 2007, 2011, 2012 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 #ifndef TextBreakIterator_h | 22 #ifndef TextBreakIterator_h |
23 #define TextBreakIterator_h | 23 #define TextBreakIterator_h |
24 | 24 |
25 #include "platform/PlatformExport.h" | 25 #include "platform/PlatformExport.h" |
26 #include "wtf/text/AtomicString.h" | 26 #include "wtf/text/AtomicString.h" |
27 #include "wtf/unicode/Unicode.h" | 27 #include "wtf/unicode/Unicode.h" |
28 | 28 |
29 namespace WebCore { | 29 namespace WebCore { |
30 | 30 |
31 class TextBreakIterator; | 31 typedef icu::BreakIterator TextBreakIterator; |
32 | 32 |
33 // Note: The returned iterator is good only until you get another iterator, with
the exception of acquireLineBreakIterator. | 33 // Note: The returned iterator is good only until you get another iterator, with
the exception of acquireLineBreakIterator. |
34 | 34 |
35 // This is similar to character break iterator in most cases, but is subject to | 35 // This is similar to character break iterator in most cases, but is subject to |
36 // platform UI conventions. One notable example where this can be different | 36 // platform UI conventions. One notable example where this can be different |
37 // from character break iterator is Thai prepend characters, see bug 24342. | 37 // from character break iterator is Thai prepend characters, see bug 24342. |
38 // Use this for insertion point and selection manipulations. | 38 // Use this for insertion point and selection manipulations. |
39 PLATFORM_EXPORT TextBreakIterator* cursorMovementIterator(const UChar*, int leng
th); | 39 PLATFORM_EXPORT TextBreakIterator* cursorMovementIterator(const UChar*, int leng
th); |
40 | 40 |
41 PLATFORM_EXPORT TextBreakIterator* wordBreakIterator(const String&, int start, i
nt length); | 41 PLATFORM_EXPORT TextBreakIterator* wordBreakIterator(const String&, int start, i
nt length); |
42 PLATFORM_EXPORT TextBreakIterator* wordBreakIterator(const UChar*, int length); | 42 PLATFORM_EXPORT TextBreakIterator* wordBreakIterator(const UChar*, int length); |
43 PLATFORM_EXPORT TextBreakIterator* acquireLineBreakIterator(const LChar*, int le
ngth, const AtomicString& locale, const UChar* priorContext, unsigned priorConte
xtLength); | 43 PLATFORM_EXPORT TextBreakIterator* acquireLineBreakIterator(const LChar*, int le
ngth, const AtomicString& locale, const UChar* priorContext, unsigned priorConte
xtLength); |
44 PLATFORM_EXPORT TextBreakIterator* acquireLineBreakIterator(const UChar*, int le
ngth, const AtomicString& locale, const UChar* priorContext, unsigned priorConte
xtLength); | 44 PLATFORM_EXPORT TextBreakIterator* acquireLineBreakIterator(const UChar*, int le
ngth, const AtomicString& locale, const UChar* priorContext, unsigned priorConte
xtLength); |
45 PLATFORM_EXPORT void releaseLineBreakIterator(TextBreakIterator*); | 45 PLATFORM_EXPORT void releaseLineBreakIterator(TextBreakIterator*); |
46 PLATFORM_EXPORT TextBreakIterator* sentenceBreakIterator(const UChar*, int lengt
h); | 46 PLATFORM_EXPORT TextBreakIterator* sentenceBreakIterator(const UChar*, int lengt
h); |
47 | 47 |
48 PLATFORM_EXPORT int textBreakFirst(TextBreakIterator*); | |
49 PLATFORM_EXPORT int textBreakLast(TextBreakIterator*); | |
50 PLATFORM_EXPORT int textBreakNext(TextBreakIterator*); | |
51 PLATFORM_EXPORT int textBreakPrevious(TextBreakIterator*); | |
52 PLATFORM_EXPORT int textBreakCurrent(TextBreakIterator*); | |
53 PLATFORM_EXPORT int textBreakPreceding(TextBreakIterator*, int); | |
54 PLATFORM_EXPORT int textBreakFollowing(TextBreakIterator*, int); | |
55 PLATFORM_EXPORT bool isTextBreak(TextBreakIterator*, int); | |
56 PLATFORM_EXPORT bool isWordTextBreak(TextBreakIterator*); | 48 PLATFORM_EXPORT bool isWordTextBreak(TextBreakIterator*); |
57 | 49 |
58 const int TextBreakDone = -1; | 50 const int TextBreakDone = -1; |
59 | 51 |
60 class PLATFORM_EXPORT LazyLineBreakIterator { | 52 class PLATFORM_EXPORT LazyLineBreakIterator { |
61 public: | 53 public: |
62 LazyLineBreakIterator() | 54 LazyLineBreakIterator() |
63 : m_iterator(0) | 55 : m_iterator(0) |
64 , m_cachedPriorContext(0) | 56 , m_cachedPriorContext(0) |
65 , m_cachedPriorContextLength(0) | 57 , m_cachedPriorContextLength(0) |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 // of a non-combining character and following combining characters is | 226 // of a non-combining character and following combining characters is |
235 // counted as 1 grapheme cluster. | 227 // counted as 1 grapheme cluster. |
236 PLATFORM_EXPORT unsigned numGraphemeClusters(const String&); | 228 PLATFORM_EXPORT unsigned numGraphemeClusters(const String&); |
237 // Returns the number of characters which will be less than or equal to | 229 // Returns the number of characters which will be less than or equal to |
238 // the specified grapheme cluster length. | 230 // the specified grapheme cluster length. |
239 PLATFORM_EXPORT unsigned numCharactersInGraphemeClusters(const String&, unsigned
); | 231 PLATFORM_EXPORT unsigned numCharactersInGraphemeClusters(const String&, unsigned
); |
240 | 232 |
241 } | 233 } |
242 | 234 |
243 #endif | 235 #endif |
OLD | NEW |