bump product version to 4.1.6.2
[LibreOffice.git] / i18npool / inc / transliteration_Ignore.hxx
blob26f92523c8d5e9ebe221b9dc1d40975c874cf35c
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef _I18N_TRANSLITERATION_TRANSLITERATION_IGNORE_H_
20 #define _I18N_TRANSLITERATION_TRANSLITERATION_IGNORE_H_
22 #include <transliteration_commonclass.hxx>
23 #include <i18nutil/oneToOneMapping.hxx>
25 typedef sal_Unicode (*TransFunc)(const sal_Unicode);
27 typedef struct {
28 sal_Unicode previousChar;
29 sal_Unicode currentChar;
30 sal_Unicode replaceChar;
31 sal_Bool two2one;
32 } Mapping;
34 namespace com { namespace sun { namespace star { namespace i18n {
36 class transliteration_Ignore : public transliteration_commonclass
38 public:
39 virtual OUString SAL_CALL
40 folding( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, com::sun::star::uno::Sequence< sal_Int32 >& offset)
41 throw(com::sun::star::uno::RuntimeException);
43 // This method is shared.
44 sal_Bool SAL_CALL
45 equals( const OUString& str1, sal_Int32 pos1, sal_Int32 nCount1, sal_Int32& nMatch1,
46 const OUString& str2, sal_Int32 pos2, sal_Int32 nCount2, sal_Int32& nMatch2 )
47 throw(com::sun::star::uno::RuntimeException);
49 // This method is implemented in sub class if needed. Otherwise, the method implemented in this class will be used.
50 com::sun::star::uno::Sequence< OUString > SAL_CALL
51 transliterateRange( const OUString& str1, const OUString& str2 )
52 throw(com::sun::star::uno::RuntimeException);
55 // Methods which are shared.
56 sal_Int16 SAL_CALL getType( ) throw(com::sun::star::uno::RuntimeException);
58 OUString SAL_CALL
59 transliterate( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, com::sun::star::uno::Sequence< sal_Int32 >& offset )
60 throw(com::sun::star::uno::RuntimeException);
62 virtual sal_Unicode SAL_CALL
63 transliterateChar2Char( sal_Unicode inChar)
64 throw(com::sun::star::uno::RuntimeException,
65 com::sun::star::i18n::MultipleCharsOutputException);
67 com::sun::star::uno::Sequence< OUString > SAL_CALL
68 transliterateRange( const OUString& str1, const OUString& str2, XTransliteration& t1, XTransliteration& t2 )
69 throw(com::sun::star::uno::RuntimeException);
71 protected:
72 TransFunc func;
73 oneToOneMapping *table;
74 Mapping *map;
77 #define TRANSLITERATION_IGNORE( name ) \
78 class ignore##name : public transliteration_Ignore {\
79 public:\
80 ignore##name ();\
83 #if defined( TRANSLITERATION_BaFa_ja_JP ) || defined( TRANSLITERATION_ALL )
84 TRANSLITERATION_IGNORE(BaFa_ja_JP)
85 #endif
86 #if defined( TRANSLITERATION_HyuByu_ja_JP ) || defined( TRANSLITERATION_ALL )
87 TRANSLITERATION_IGNORE(HyuByu_ja_JP)
88 #endif
89 #if defined( TRANSLITERATION_SeZe_ja_JP ) || defined( TRANSLITERATION_ALL )
90 TRANSLITERATION_IGNORE(SeZe_ja_JP)
91 #endif
92 #if defined( TRANSLITERATION_TiJi_ja_JP ) || defined( TRANSLITERATION_ALL )
93 TRANSLITERATION_IGNORE(TiJi_ja_JP)
94 #endif
95 #if defined( TRANSLITERATION_MiddleDot_ja_JP ) || defined( TRANSLITERATION_ALL )
96 TRANSLITERATION_IGNORE(MiddleDot_ja_JP)
97 #endif
98 #if defined( TRANSLITERATION_MinusSign_ja_JP ) || defined( TRANSLITERATION_ALL )
99 TRANSLITERATION_IGNORE(MinusSign_ja_JP)
100 #endif
101 #if defined( TRANSLITERATION_Separator_ja_JP ) || defined( TRANSLITERATION_ALL )
102 TRANSLITERATION_IGNORE(Separator_ja_JP)
103 #endif
104 #if defined( TRANSLITERATION_Space_ja_JP ) || defined( TRANSLITERATION_ALL )
105 TRANSLITERATION_IGNORE(Space_ja_JP)
106 #endif
107 #if defined( TRANSLITERATION_TraditionalKana_ja_JP ) || defined( TRANSLITERATION_ALL )
108 TRANSLITERATION_IGNORE(TraditionalKana_ja_JP)
109 #endif
110 #if defined( TRANSLITERATION_TraditionalKanji_ja_JP ) || defined( TRANSLITERATION_ALL )
111 TRANSLITERATION_IGNORE(TraditionalKanji_ja_JP)
112 #endif
113 #if defined( TRANSLITERATION_ZiZu_ja_JP ) || defined( TRANSLITERATION_ALL )
114 TRANSLITERATION_IGNORE(ZiZu_ja_JP)
115 #endif
116 #undef TRANSLITERATION_IGNORE
118 #define TRANSLITERATION_IGNORE( name ) \
119 class ignore##name : public transliteration_Ignore {\
120 public:\
121 ignore##name () {\
122 func = (TransFunc) 0;\
123 table = 0;\
124 map = 0;\
125 transliterationName = "ignore"#name;\
126 implementationName = "com.sun.star.i18n.Transliteration.ignore"#name;\
128 OUString SAL_CALL folding( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, \
129 com::sun::star::uno::Sequence< sal_Int32 >& offset) throw(com::sun::star::uno::RuntimeException); \
132 #if defined( TRANSLITERATION_KiKuFollowedBySa_ja_JP ) || defined( TRANSLITERATION_ALL )
133 TRANSLITERATION_IGNORE(KiKuFollowedBySa_ja_JP)
134 #endif
135 #if defined( TRANSLITERATION_IandEfollowedByYa_ja_JP ) || defined( TRANSLITERATION_ALL )
136 TRANSLITERATION_IGNORE(IandEfollowedByYa_ja_JP)
137 #endif
138 #if defined( TRANSLITERATION_IterationMark_ja_JP ) || defined( TRANSLITERATION_ALL )
139 TRANSLITERATION_IGNORE(IterationMark_ja_JP)
140 #endif
141 #if defined( TRANSLITERATION_ProlongedSoundMark_ja_JP ) || defined( TRANSLITERATION_ALL )
142 TRANSLITERATION_IGNORE(ProlongedSoundMark_ja_JP)
143 #endif
144 #undef TRANSLITERATION_IGNORE
146 #define TRANSLITERATION_IGNORE( name ) \
147 class ignore##name : public transliteration_Ignore {\
148 public:\
149 ignore##name () {\
150 func = (TransFunc) 0;\
151 table = 0;\
152 map = 0;\
153 transliterationName = "ignore"#name;\
154 implementationName = "com.sun.star.i18n.Transliteration.ignore"#name;\
156 OUString SAL_CALL folding( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, \
157 com::sun::star::uno::Sequence< sal_Int32 >& offset) throw(com::sun::star::uno::RuntimeException); \
158 using transliteration_Ignore::transliterateRange;\
159 com::sun::star::uno::Sequence< OUString > SAL_CALL transliterateRange( const OUString& str1, \
160 const OUString& str2 ) throw(com::sun::star::uno::RuntimeException); \
161 sal_Unicode SAL_CALL \
162 transliterateChar2Char( sal_Unicode inChar) \
163 throw(com::sun::star::uno::RuntimeException,\
164 com::sun::star::i18n::MultipleCharsOutputException);\
167 #if defined( TRANSLITERATION_Kana ) || defined( TRANSLITERATION_ALL )
168 TRANSLITERATION_IGNORE(Kana)
169 #endif
170 #if defined( TRANSLITERATION_Width ) || defined( TRANSLITERATION_ALL )
171 TRANSLITERATION_IGNORE(Width)
172 #endif
173 #if defined( TRANSLITERATION_Size_ja_JP ) || defined( TRANSLITERATION_ALL )
174 TRANSLITERATION_IGNORE(Size_ja_JP)
175 #endif
176 #undef TRANSLITERATION_IGNORE
178 } } } }
180 #endif // _I18N_TRANSLITERATION_TRANSLITERATION_IGNORE_H_
182 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */