]> git.saurik.com Git - apple/icu.git/blame - icuSources/i18n/nortrans.h
ICU-400.38.tar.gz
[apple/icu.git] / icuSources / i18n / nortrans.h
CommitLineData
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* 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
20U_NAMESPACE_BEGIN
21
22/**
23 * A transliterator that performs normalization.
24 * @author Alan Liu
25 */
46f4442e 26class NormalizationTransliterator : public Transliterator {
b75a7d8f
A
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
b75a7d8f
A
38 public:
39
40 /**
41 * Destructor.
42 */
43 virtual ~NormalizationTransliterator();
44
45 /**
46 * Copy constructor.
47 */
48 NormalizationTransliterator(const NormalizationTransliterator&);
49
b75a7d8f
A
50 /**
51 * Transliterator API.
52 * @return A copy of the object.
53 */
374ca955 54 virtual Transliterator* clone(void) const;
b75a7d8f
A
55
56 /**
57 * ICU "poor man's RTTI", returns a UClassID for the actual class.
b75a7d8f 58 */
374ca955 59 virtual UClassID getDynamicClassID() const;
b75a7d8f
A
60
61 /**
62 * ICU "poor man's RTTI", returns a UClassID for this class.
b75a7d8f 63 */
46f4442e 64 U_I18N_API static UClassID U_EXPORT2 getStaticClassID();
b75a7d8f
A
65
66 protected:
67
68 /**
69 * Implements {@link Transliterator#handleTransliterate}.
70 * @param text the buffer holding transliterated and
71 * untransliterated text
72 * @param offset the start and limit of the text, the position
73 * of the cursor, and the start and limit of transliteration.
74 * @param incremental if true, assume more text may be coming after
75 * pos.contextLimit. Otherwise, assume the text is complete.
76 */
73c04bcf 77 virtual void handleTransliterate(Replaceable& text, UTransPosition& offset,
b75a7d8f
A
78 UBool isIncremental) const;
79 public:
80
81 /**
82 * System registration hook. Public to Transliterator only.
83 */
84 static void registerIDs();
85
86 private:
87
88 // Transliterator::Factory methods
89 static Transliterator* _create(const UnicodeString& ID,
90 Token context);
91
92 /**
93 * Constructs a transliterator. This method is private.
94 * Public users must use the factory method createInstance().
95 */
96 NormalizationTransliterator(const UnicodeString& id,
97 UNormalizationMode mode, int32_t opt);
46f4442e
A
98
99private:
100 /**
101 * Assignment operator.
102 */
103 NormalizationTransliterator& operator=(const NormalizationTransliterator&);
b75a7d8f
A
104};
105
106U_NAMESPACE_END
107
108#endif /* #if !UCONFIG_NO_TRANSLITERATION */
109
110#endif