| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 PLATFORM_EXPORT bool isWordTextBreak(TextBreakIterator*); | 50 PLATFORM_EXPORT bool isWordTextBreak(TextBreakIterator*); |
| 51 | 51 |
| 52 const int TextBreakDone = -1; | 52 const int TextBreakDone = -1; |
| 53 | 53 |
| 54 enum class LineBreakType { | 54 enum class LineBreakType { |
| 55 Normal, | 55 Normal, |
| 56 BreakAll, // word-break:break-all allows breaks between letters/numbers | 56 BreakAll, // word-break:break-all allows breaks between letters/numbers |
| 57 KeepAll, // word-break:keep-all doesn't allow breaks between all kind of let
ters/numbers except some south east asians'. | 57 KeepAll, // word-break:keep-all doesn't allow breaks between all kind of let
ters/numbers except some south east asians'. |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 class PLATFORM_EXPORT LazyLineBreakIterator { | 60 class PLATFORM_EXPORT LazyLineBreakIterator final { |
| 61 STACK_ALLOCATED(); |
| 61 public: | 62 public: |
| 62 LazyLineBreakIterator() | 63 LazyLineBreakIterator() |
| 63 : m_iterator(0) | 64 : m_iterator(0) |
| 64 , m_cachedPriorContext(0) | 65 , m_cachedPriorContext(0) |
| 65 , m_cachedPriorContextLength(0) | 66 , m_cachedPriorContextLength(0) |
| 66 { | 67 { |
| 67 resetPriorContext(); | 68 resetPriorContext(); |
| 68 } | 69 } |
| 69 | 70 |
| 70 LazyLineBreakIterator(String string, const AtomicString& locale = AtomicStri
ng()) | 71 LazyLineBreakIterator(String string, const AtomicString& locale = AtomicStri
ng()) |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 UChar m_priorContext[priorContextCapacity]; | 193 UChar m_priorContext[priorContextCapacity]; |
| 193 const UChar* m_cachedPriorContext; | 194 const UChar* m_cachedPriorContext; |
| 194 unsigned m_cachedPriorContextLength; | 195 unsigned m_cachedPriorContextLength; |
| 195 }; | 196 }; |
| 196 | 197 |
| 197 // Iterates over "extended grapheme clusters", as defined in UAX #29. | 198 // Iterates over "extended grapheme clusters", as defined in UAX #29. |
| 198 // Note that platform implementations may be less sophisticated - e.g. ICU prior
to | 199 // Note that platform implementations may be less sophisticated - e.g. ICU prior
to |
| 199 // version 4.0 only supports "legacy grapheme clusters". | 200 // version 4.0 only supports "legacy grapheme clusters". |
| 200 // Use this for general text processing, e.g. string truncation. | 201 // Use this for general text processing, e.g. string truncation. |
| 201 | 202 |
| 202 class PLATFORM_EXPORT NonSharedCharacterBreakIterator { | 203 class PLATFORM_EXPORT NonSharedCharacterBreakIterator final { |
| 204 STACK_ALLOCATED(); |
| 203 WTF_MAKE_NONCOPYABLE(NonSharedCharacterBreakIterator); | 205 WTF_MAKE_NONCOPYABLE(NonSharedCharacterBreakIterator); |
| 204 public: | 206 public: |
| 205 explicit NonSharedCharacterBreakIterator(const String&); | 207 explicit NonSharedCharacterBreakIterator(const String&); |
| 206 NonSharedCharacterBreakIterator(const UChar*, unsigned length); | 208 NonSharedCharacterBreakIterator(const UChar*, unsigned length); |
| 207 ~NonSharedCharacterBreakIterator(); | 209 ~NonSharedCharacterBreakIterator(); |
| 208 | 210 |
| 209 int next(); | 211 int next(); |
| 210 int current(); | 212 int current(); |
| 211 | 213 |
| 212 bool isBreak(int offset) const; | 214 bool isBreak(int offset) const; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 }; | 254 }; |
| 253 | 255 |
| 254 // Counts the number of grapheme clusters. A surrogate pair or a sequence | 256 // Counts the number of grapheme clusters. A surrogate pair or a sequence |
| 255 // of a non-combining character and following combining characters is | 257 // of a non-combining character and following combining characters is |
| 256 // counted as 1 grapheme cluster. | 258 // counted as 1 grapheme cluster. |
| 257 PLATFORM_EXPORT unsigned numGraphemeClusters(const String&); | 259 PLATFORM_EXPORT unsigned numGraphemeClusters(const String&); |
| 258 | 260 |
| 259 } | 261 } |
| 260 | 262 |
| 261 #endif | 263 #endif |
| OLD | NEW |