]>
Commit | Line | Data |
---|---|---|
b75a7d8f A |
1 | /* |
2 | ********************************************************************** | |
46f4442e | 3 | * Copyright (C) 2001-2007, 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 | */ | |
46f4442e | 30 | class 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 | ||
b75a7d8f A |
49 | /** |
50 | * Transliterator API. | |
51 | * @return a copy of the object. | |
52 | */ | |
374ca955 | 53 | virtual Transliterator* clone(void) const; |
b75a7d8f A |
54 | |
55 | /** | |
56 | * ICU "poor man's RTTI", returns a UClassID for the actual class. | |
b75a7d8f | 57 | */ |
374ca955 | 58 | virtual UClassID getDynamicClassID() const; |
b75a7d8f A |
59 | |
60 | /** | |
61 | * ICU "poor man's RTTI", returns a UClassID for this class. | |
b75a7d8f | 62 | */ |
46f4442e | 63 | U_I18N_API static UClassID U_EXPORT2 getStaticClassID(); |
b75a7d8f | 64 | |
46f4442e | 65 | protected: |
b75a7d8f A |
66 | |
67 | /** | |
68 | * Implements {@link Transliterator#handleTransliterate}. | |
69 | * @param text the buffer holding transliterated and | |
70 | * untransliterated text | |
71 | * @param offset the start and limit of the text, the position | |
72 | * of the cursor, and the start and limit of transliteration. | |
73 | * @param incremental if true, assume more text may be coming after | |
74 | * pos.contextLimit. Otherwise, assume the text is complete. | |
75 | */ | |
374ca955 | 76 | virtual void handleTransliterate(Replaceable& text, UTransPosition& offset, |
b75a7d8f | 77 | UBool isIncremental) const; |
46f4442e A |
78 | |
79 | private: | |
80 | /** | |
81 | * Assignment operator. | |
82 | */ | |
83 | TitlecaseTransliterator& operator=(const TitlecaseTransliterator&); | |
b75a7d8f A |
84 | }; |
85 | ||
86 | U_NAMESPACE_END | |
87 | ||
88 | #endif /* #if !UCONFIG_NO_TRANSLITERATION */ | |
89 | ||
90 | #endif |