bump product version to 4.2.0.1
[LibreOffice.git] / i18npool / inc / transliteration_Ignore.hxx
blob0f5c4861886971012b54d223f7de09d3a0d78375
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 const 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
117 #if defined( TRANSLITERATION_Diacritics_CTL ) || defined( TRANSLITERATION_ALL )
118 TRANSLITERATION_IGNORE(Diacritics_CTL)
119 #endif
121 #undef TRANSLITERATION_IGNORE
123 #define TRANSLITERATION_IGNORE( name ) \
124 class ignore##name : public transliteration_Ignore {\
125 public:\
126 ignore##name () {\
127 func = (TransFunc) 0;\
128 table = 0;\
129 map = 0;\
130 transliterationName = "ignore"#name;\
131 implementationName = "com.sun.star.i18n.Transliteration.ignore"#name;\
133 OUString SAL_CALL folding( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, \
134 com::sun::star::uno::Sequence< sal_Int32 >& offset) throw(com::sun::star::uno::RuntimeException); \
137 #if defined( TRANSLITERATION_KiKuFollowedBySa_ja_JP ) || defined( TRANSLITERATION_ALL )
138 TRANSLITERATION_IGNORE(KiKuFollowedBySa_ja_JP)
139 #endif
140 #if defined( TRANSLITERATION_IandEfollowedByYa_ja_JP ) || defined( TRANSLITERATION_ALL )
141 TRANSLITERATION_IGNORE(IandEfollowedByYa_ja_JP)
142 #endif
143 #if defined( TRANSLITERATION_IterationMark_ja_JP ) || defined( TRANSLITERATION_ALL )
144 TRANSLITERATION_IGNORE(IterationMark_ja_JP)
145 #endif
146 #if defined( TRANSLITERATION_ProlongedSoundMark_ja_JP ) || defined( TRANSLITERATION_ALL )
147 TRANSLITERATION_IGNORE(ProlongedSoundMark_ja_JP)
148 #endif
149 #undef TRANSLITERATION_IGNORE
151 #define TRANSLITERATION_IGNORE( name ) \
152 class ignore##name : public transliteration_Ignore {\
153 public:\
154 ignore##name () {\
155 func = (TransFunc) 0;\
156 table = 0;\
157 map = 0;\
158 transliterationName = "ignore"#name;\
159 implementationName = "com.sun.star.i18n.Transliteration.ignore"#name;\
161 OUString SAL_CALL folding( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, \
162 com::sun::star::uno::Sequence< sal_Int32 >& offset) throw(com::sun::star::uno::RuntimeException); \
163 using transliteration_Ignore::transliterateRange;\
164 com::sun::star::uno::Sequence< OUString > SAL_CALL transliterateRange( const OUString& str1, \
165 const OUString& str2 ) throw(com::sun::star::uno::RuntimeException); \
166 sal_Unicode SAL_CALL \
167 transliterateChar2Char( sal_Unicode inChar) \
168 throw(com::sun::star::uno::RuntimeException,\
169 com::sun::star::i18n::MultipleCharsOutputException);\
172 #if defined( TRANSLITERATION_Kana ) || defined( TRANSLITERATION_ALL )
173 TRANSLITERATION_IGNORE(Kana)
174 #endif
175 #if defined( TRANSLITERATION_Width ) || defined( TRANSLITERATION_ALL )
176 TRANSLITERATION_IGNORE(Width)
177 #endif
178 #if defined( TRANSLITERATION_Size_ja_JP ) || defined( TRANSLITERATION_ALL )
179 TRANSLITERATION_IGNORE(Size_ja_JP)
180 #endif
181 #undef TRANSLITERATION_IGNORE
183 } } } }
185 #endif // _I18N_TRANSLITERATION_TRANSLITERATION_IGNORE_H_
187 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */