]>
Commit | Line | Data |
---|---|---|
b75a7d8f A |
1 | /* |
2 | ********************************************************************** | |
73c04bcf | 3 | * Copyright (C) 2001-2006, International Business Machines |
b75a7d8f A |
4 | * Corporation and others. All Rights Reserved. |
5 | ********************************************************************** | |
6 | * Date Name Description | |
7 | * 05/24/01 aliu Creation. | |
8 | ********************************************************************** | |
9 | */ | |
10 | #ifndef TITLETRN_H | |
11 | #define TITLETRN_H | |
12 | ||
13 | #include "unicode/utypes.h" | |
14 | ||
15 | #if !UCONFIG_NO_TRANSLITERATION | |
16 | ||
17 | #include "unicode/translit.h" | |
374ca955 A |
18 | #include "ucase.h" |
19 | #include "casetrn.h" | |
b75a7d8f A |
20 | |
21 | U_NAMESPACE_BEGIN | |
22 | ||
23 | /** | |
24 | * A transliterator that converts all letters (as defined by | |
25 | * <code>UCharacter.isLetter()</code>) to lower case, except for those | |
26 | * letters preceded by non-letters. The latter are converted to title | |
27 | * case using <code>u_totitle()</code>. | |
28 | * @author Alan Liu | |
29 | */ | |
374ca955 | 30 | class U_I18N_API TitlecaseTransliterator : public CaseMapTransliterator { |
b75a7d8f A |
31 | public: |
32 | ||
33 | /** | |
34 | * Constructs a transliterator. | |
35 | * @param loc the given locale. | |
36 | */ | |
73c04bcf | 37 | TitlecaseTransliterator(); |
b75a7d8f A |
38 | |
39 | /** | |
40 | * Destructor. | |
41 | */ | |
42 | virtual ~TitlecaseTransliterator(); | |
43 | ||
44 | /** | |
45 | * Copy constructor. | |
46 | */ | |
47 | TitlecaseTransliterator(const TitlecaseTransliterator&); | |
48 | ||
49 | /** | |
50 | * Assignment operator. | |
51 | */ | |
52 | TitlecaseTransliterator& operator=(const TitlecaseTransliterator&); | |
53 | ||
54 | /** | |
55 | * Transliterator API. | |
56 | * @return a copy of the object. | |
57 | */ | |
374ca955 | 58 | virtual Transliterator* clone(void) const; |
b75a7d8f A |
59 | |
60 | /** | |
61 | * ICU "poor man's RTTI", returns a UClassID for the actual class. | |
b75a7d8f | 62 | */ |
374ca955 | 63 | virtual UClassID getDynamicClassID() const; |
b75a7d8f A |
64 | |
65 | /** | |
66 | * ICU "poor man's RTTI", returns a UClassID for this class. | |
b75a7d8f | 67 | */ |
374ca955 | 68 | static UClassID U_EXPORT2 getStaticClassID(); |
b75a7d8f A |
69 | |
70 | protected: | |
71 | ||
72 | /** | |
73 | * Implements {@link Transliterator#handleTransliterate}. | |
74 | * @param text the buffer holding transliterated and | |
75 | * untransliterated text | |
76 | * @param offset the start and limit of the text, the position | |
77 | * of the cursor, and the start and limit of transliteration. | |
78 | * @param incremental if true, assume more text may be coming after | |
79 | * pos.contextLimit. Otherwise, assume the text is complete. | |
80 | */ | |
374ca955 | 81 | virtual void handleTransliterate(Replaceable& text, UTransPosition& offset, |
b75a7d8f | 82 | UBool isIncremental) const; |
b75a7d8f A |
83 | }; |
84 | ||
85 | U_NAMESPACE_END | |
86 | ||
87 | #endif /* #if !UCONFIG_NO_TRANSLITERATION */ | |
88 | ||
89 | #endif |