]>
git.saurik.com Git - iphone-api.git/blob - WebCore/TextBreakIterator.h
2 * Copyright (C) 2006 Lars Knoll <lars@trolltech.com>
3 * Copyright (C) 2007 Apple Inc. All rights reserved.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
22 #ifndef TextBreakIterator_h
23 #define TextBreakIterator_h
25 #include <wtf/unicode/Unicode.h>
29 class TextBreakIterator
;
31 // Note: The returned iterator is good only until you get another iterator.
33 // Iterates over "extended grapheme clusters", as defined in UAX #29.
34 // Note that platform implementations may be less sophisticated - e.g. ICU prior to
35 // version 4.0 only supports "legacy grapheme clusters".
36 // Use this for general text processing, e.g. string truncation.
37 TextBreakIterator
* characterBreakIterator(const UChar
*, int length
);
39 // This is similar to character break iterator in most cases, but is subject to
40 // platform UI conventions. One notable example where this can be different
41 // from character break iterator is Thai prepend characters, see bug 24342.
42 // Use this for insertion point and selection manipulations.
43 TextBreakIterator
* cursorMovementIterator(const UChar
*, int length
);
45 TextBreakIterator
* wordBreakIterator(const UChar
*, int length
);
46 TextBreakIterator
* lineBreakIterator(const UChar
*, int length
);
47 TextBreakIterator
* sentenceBreakIterator(const UChar
*, int length
);
49 int textBreakFirst(TextBreakIterator
*);
50 int textBreakNext(TextBreakIterator
*);
51 int textBreakCurrent(TextBreakIterator
*);
52 int textBreakPreceding(TextBreakIterator
*, int);
53 int textBreakFollowing(TextBreakIterator
*, int);
54 bool isTextBreak(TextBreakIterator
*, int);
56 const int TextBreakDone
= -1;