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