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