]> git.saurik.com Git - apple/icu.git/blob - icuSources/i18n/nortrans.h
ICU-6.2.14.tar.gz
[apple/icu.git] / icuSources / i18n / nortrans.h
1 /*
2 **********************************************************************
3 * Copyright (C) 2001-2004, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 **********************************************************************
6 * Date Name Description
7 * 07/03/01 aliu Creation.
8 **********************************************************************
9 */
10 #ifndef NORTRANS_H
11 #define NORTRANS_H
12
13 #include "unicode/utypes.h"
14
15 #if !UCONFIG_NO_TRANSLITERATION
16
17 #include "unicode/translit.h"
18 #include "unicode/normlzr.h"
19
20 U_NAMESPACE_BEGIN
21
22 /**
23 * A transliterator that performs normalization.
24 * @author Alan Liu
25 */
26 class U_I18N_API NormalizationTransliterator : public Transliterator {
27
28 /**
29 * The normalization mode of this transliterator.
30 */
31 UNormalizationMode fMode;
32
33 /**
34 * Normalization options for this transliterator.
35 */
36 int32_t options;
37
38 public:
39
40 /**
41 * Destructor.
42 */
43 virtual ~NormalizationTransliterator();
44
45 /**
46 * Copy constructor.
47 */
48 NormalizationTransliterator(const NormalizationTransliterator&);
49
50 /**
51 * Assignment operator.
52 */
53 NormalizationTransliterator& operator=(const NormalizationTransliterator&);
54
55 /**
56 * Transliterator API.
57 * @return A copy of the object.
58 */
59 virtual Transliterator* clone(void) const;
60
61 /**
62 * ICU "poor man's RTTI", returns a UClassID for the actual class.
63 *
64 * @draft ICU 2.2
65 */
66 virtual UClassID getDynamicClassID() const;
67
68 /**
69 * ICU "poor man's RTTI", returns a UClassID for this class.
70 *
71 * @draft ICU 2.2
72 */
73 static UClassID U_EXPORT2 getStaticClassID();
74
75 protected:
76
77 /**
78 * Implements {@link Transliterator#handleTransliterate}.
79 * @param text the buffer holding transliterated and
80 * untransliterated text
81 * @param offset the start and limit of the text, the position
82 * of the cursor, and the start and limit of transliteration.
83 * @param incremental if true, assume more text may be coming after
84 * pos.contextLimit. Otherwise, assume the text is complete.
85 */
86 void handleTransliterate(Replaceable& text, UTransPosition& offset,
87 UBool isIncremental) const;
88 public:
89
90 /**
91 * System registration hook. Public to Transliterator only.
92 */
93 static void registerIDs();
94
95 private:
96
97 // Transliterator::Factory methods
98 static Transliterator* _create(const UnicodeString& ID,
99 Token context);
100
101 /**
102 * Constructs a transliterator. This method is private.
103 * Public users must use the factory method createInstance().
104 */
105 NormalizationTransliterator(const UnicodeString& id,
106 UNormalizationMode mode, int32_t opt);
107 };
108
109 U_NAMESPACE_END
110
111 #endif /* #if !UCONFIG_NO_TRANSLITERATION */
112
113 #endif