1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
27 #ifndef _I18N_TRANSLITERATION_TRANSLITERATION_IGNORE_H_
28 #define _I18N_TRANSLITERATION_TRANSLITERATION_IGNORE_H_
30 #include <transliteration_commonclass.hxx>
31 #include <i18nutil/oneToOneMapping.hxx>
33 typedef sal_Unicode (*TransFunc
)(const sal_Unicode
);
36 sal_Unicode previousChar
;
37 sal_Unicode currentChar
;
38 sal_Unicode replaceChar
;
42 namespace com
{ namespace sun
{ namespace star
{ namespace i18n
{
44 class transliteration_Ignore
: public transliteration_commonclass
47 virtual rtl::OUString SAL_CALL
48 folding( const rtl::OUString
& inStr
, sal_Int32 startPos
, sal_Int32 nCount
, com::sun::star::uno::Sequence
< sal_Int32
>& offset
)
49 throw(com::sun::star::uno::RuntimeException
);
51 // This method is shared.
53 equals( const rtl::OUString
& str1
, sal_Int32 pos1
, sal_Int32 nCount1
, sal_Int32
& nMatch1
,
54 const rtl::OUString
& str2
, sal_Int32 pos2
, sal_Int32 nCount2
, sal_Int32
& nMatch2
)
55 throw(com::sun::star::uno::RuntimeException
);
57 // This method is implemented in sub class if needed. Otherwise, the method implemented in this class will be used.
58 com::sun::star::uno::Sequence
< rtl::OUString
> SAL_CALL
59 transliterateRange( const rtl::OUString
& str1
, const rtl::OUString
& str2
)
60 throw(com::sun::star::uno::RuntimeException
);
63 // Methods which are shared.
64 sal_Int16 SAL_CALL
getType( ) throw(com::sun::star::uno::RuntimeException
);
66 rtl::OUString SAL_CALL
67 transliterate( const rtl::OUString
& inStr
, sal_Int32 startPos
, sal_Int32 nCount
, com::sun::star::uno::Sequence
< sal_Int32
>& offset
)
68 throw(com::sun::star::uno::RuntimeException
);
70 virtual sal_Unicode SAL_CALL
71 transliterateChar2Char( sal_Unicode inChar
)
72 throw(com::sun::star::uno::RuntimeException
,
73 com::sun::star::i18n::MultipleCharsOutputException
);
75 com::sun::star::uno::Sequence
< rtl::OUString
> SAL_CALL
76 transliterateRange( const rtl::OUString
& str1
, const rtl::OUString
& str2
, XTransliteration
& t1
, XTransliteration
& t2
)
77 throw(com::sun::star::uno::RuntimeException
);
81 oneToOneMapping
*table
;
85 #define TRANSLITERATION_IGNORE( name ) \
86 class ignore##name : public transliteration_Ignore {\
91 #if defined( TRANSLITERATION_BaFa_ja_JP ) || defined( TRANSLITERATION_ALL )
92 TRANSLITERATION_IGNORE(BaFa_ja_JP
)
94 #if defined( TRANSLITERATION_HyuByu_ja_JP ) || defined( TRANSLITERATION_ALL )
95 TRANSLITERATION_IGNORE(HyuByu_ja_JP
)
97 #if defined( TRANSLITERATION_SeZe_ja_JP ) || defined( TRANSLITERATION_ALL )
98 TRANSLITERATION_IGNORE(SeZe_ja_JP
)
100 #if defined( TRANSLITERATION_TiJi_ja_JP ) || defined( TRANSLITERATION_ALL )
101 TRANSLITERATION_IGNORE(TiJi_ja_JP
)
103 #if defined( TRANSLITERATION_MiddleDot_ja_JP ) || defined( TRANSLITERATION_ALL )
104 TRANSLITERATION_IGNORE(MiddleDot_ja_JP
)
106 #if defined( TRANSLITERATION_MinusSign_ja_JP ) || defined( TRANSLITERATION_ALL )
107 TRANSLITERATION_IGNORE(MinusSign_ja_JP
)
109 #if defined( TRANSLITERATION_Separator_ja_JP ) || defined( TRANSLITERATION_ALL )
110 TRANSLITERATION_IGNORE(Separator_ja_JP
)
112 #if defined( TRANSLITERATION_Space_ja_JP ) || defined( TRANSLITERATION_ALL )
113 TRANSLITERATION_IGNORE(Space_ja_JP
)
115 #if defined( TRANSLITERATION_TraditionalKana_ja_JP ) || defined( TRANSLITERATION_ALL )
116 TRANSLITERATION_IGNORE(TraditionalKana_ja_JP
)
118 #if defined( TRANSLITERATION_TraditionalKanji_ja_JP ) || defined( TRANSLITERATION_ALL )
119 TRANSLITERATION_IGNORE(TraditionalKanji_ja_JP
)
121 #if defined( TRANSLITERATION_ZiZu_ja_JP ) || defined( TRANSLITERATION_ALL )
122 TRANSLITERATION_IGNORE(ZiZu_ja_JP
)
124 #undef TRANSLITERATION_IGNORE
126 #define TRANSLITERATION_IGNORE( name ) \
127 class ignore##name : public transliteration_Ignore {\
130 func = (TransFunc) 0;\
133 transliterationName = "ignore"#name;\
134 implementationName = "com.sun.star.i18n.Transliteration.ignore"#name;\
136 rtl::OUString SAL_CALL folding( const rtl::OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, \
137 com::sun::star::uno::Sequence< sal_Int32 >& offset) throw(com::sun::star::uno::RuntimeException); \
140 #if defined( TRANSLITERATION_KiKuFollowedBySa_ja_JP ) || defined( TRANSLITERATION_ALL )
141 TRANSLITERATION_IGNORE(KiKuFollowedBySa_ja_JP
)
143 #if defined( TRANSLITERATION_IandEfollowedByYa_ja_JP ) || defined( TRANSLITERATION_ALL )
144 TRANSLITERATION_IGNORE(IandEfollowedByYa_ja_JP
)
146 #if defined( TRANSLITERATION_IterationMark_ja_JP ) || defined( TRANSLITERATION_ALL )
147 TRANSLITERATION_IGNORE(IterationMark_ja_JP
)
149 #if defined( TRANSLITERATION_ProlongedSoundMark_ja_JP ) || defined( TRANSLITERATION_ALL )
150 TRANSLITERATION_IGNORE(ProlongedSoundMark_ja_JP
)
152 #undef TRANSLITERATION_IGNORE
154 #define TRANSLITERATION_IGNORE( name ) \
155 class ignore##name : public transliteration_Ignore {\
158 func = (TransFunc) 0;\
161 transliterationName = "ignore"#name;\
162 implementationName = "com.sun.star.i18n.Transliteration.ignore"#name;\
164 rtl::OUString SAL_CALL folding( const rtl::OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, \
165 com::sun::star::uno::Sequence< sal_Int32 >& offset) throw(com::sun::star::uno::RuntimeException); \
166 using transliteration_Ignore::transliterateRange;\
167 com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL transliterateRange( const rtl::OUString& str1, \
168 const rtl::OUString& str2 ) throw(com::sun::star::uno::RuntimeException); \
169 sal_Unicode SAL_CALL \
170 transliterateChar2Char( sal_Unicode inChar) \
171 throw(com::sun::star::uno::RuntimeException,\
172 com::sun::star::i18n::MultipleCharsOutputException);\
175 #if defined( TRANSLITERATION_Kana ) || defined( TRANSLITERATION_ALL )
176 TRANSLITERATION_IGNORE(Kana
)
178 #if defined( TRANSLITERATION_Width ) || defined( TRANSLITERATION_ALL )
179 TRANSLITERATION_IGNORE(Width
)
181 #if defined( TRANSLITERATION_Size_ja_JP ) || defined( TRANSLITERATION_ALL )
182 TRANSLITERATION_IGNORE(Size_ja_JP
)
184 #undef TRANSLITERATION_IGNORE
188 #endif // _I18N_TRANSLITERATION_TRANSLITERATION_IGNORE_H_