1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
28 #ifndef _I18N_TRANSLITERATION_TRANSLITERATION_IGNORE_H_
29 #define _I18N_TRANSLITERATION_TRANSLITERATION_IGNORE_H_
31 #include <transliteration_commonclass.hxx>
32 #include <i18nutil/oneToOneMapping.hxx>
34 typedef sal_Unicode (*TransFunc
)(const sal_Unicode
);
37 sal_Unicode previousChar
;
38 sal_Unicode currentChar
;
39 sal_Unicode replaceChar
;
43 namespace com
{ namespace sun
{ namespace star
{ namespace i18n
{
45 class transliteration_Ignore
: public transliteration_commonclass
48 virtual rtl::OUString SAL_CALL
49 folding( const rtl::OUString
& inStr
, sal_Int32 startPos
, sal_Int32 nCount
, com::sun::star::uno::Sequence
< sal_Int32
>& offset
)
50 throw(com::sun::star::uno::RuntimeException
);
52 // This method is shared.
54 equals( const rtl::OUString
& str1
, sal_Int32 pos1
, sal_Int32 nCount1
, sal_Int32
& nMatch1
,
55 const rtl::OUString
& str2
, sal_Int32 pos2
, sal_Int32 nCount2
, sal_Int32
& nMatch2
)
56 throw(com::sun::star::uno::RuntimeException
);
58 // This method is implemented in sub class if needed. Otherwise, the method implemented in this class will be used.
59 com::sun::star::uno::Sequence
< rtl::OUString
> SAL_CALL
60 transliterateRange( const rtl::OUString
& str1
, const rtl::OUString
& str2
)
61 throw(com::sun::star::uno::RuntimeException
);
64 // Methods which are shared.
65 sal_Int16 SAL_CALL
getType( ) throw(com::sun::star::uno::RuntimeException
);
67 rtl::OUString SAL_CALL
68 transliterate( const rtl::OUString
& inStr
, sal_Int32 startPos
, sal_Int32 nCount
, com::sun::star::uno::Sequence
< sal_Int32
>& offset
)
69 throw(com::sun::star::uno::RuntimeException
);
71 virtual sal_Unicode SAL_CALL
72 transliterateChar2Char( sal_Unicode inChar
)
73 throw(com::sun::star::uno::RuntimeException
,
74 com::sun::star::i18n::MultipleCharsOutputException
);
76 com::sun::star::uno::Sequence
< rtl::OUString
> SAL_CALL
77 transliterateRange( const rtl::OUString
& str1
, const rtl::OUString
& str2
, XTransliteration
& t1
, XTransliteration
& t2
)
78 throw(com::sun::star::uno::RuntimeException
);
82 oneToOneMapping
*table
;
86 #define TRANSLITERATION_IGNORE( name ) \
87 class ignore##name : public transliteration_Ignore {\
92 #if defined( TRANSLITERATION_BaFa_ja_JP ) || defined( TRANSLITERATION_ALL )
93 TRANSLITERATION_IGNORE(BaFa_ja_JP
)
95 #if defined( TRANSLITERATION_HyuByu_ja_JP ) || defined( TRANSLITERATION_ALL )
96 TRANSLITERATION_IGNORE(HyuByu_ja_JP
)
98 #if defined( TRANSLITERATION_SeZe_ja_JP ) || defined( TRANSLITERATION_ALL )
99 TRANSLITERATION_IGNORE(SeZe_ja_JP
)
101 #if defined( TRANSLITERATION_TiJi_ja_JP ) || defined( TRANSLITERATION_ALL )
102 TRANSLITERATION_IGNORE(TiJi_ja_JP
)
104 #if defined( TRANSLITERATION_MiddleDot_ja_JP ) || defined( TRANSLITERATION_ALL )
105 TRANSLITERATION_IGNORE(MiddleDot_ja_JP
)
107 #if defined( TRANSLITERATION_MinusSign_ja_JP ) || defined( TRANSLITERATION_ALL )
108 TRANSLITERATION_IGNORE(MinusSign_ja_JP
)
110 #if defined( TRANSLITERATION_Separator_ja_JP ) || defined( TRANSLITERATION_ALL )
111 TRANSLITERATION_IGNORE(Separator_ja_JP
)
113 #if defined( TRANSLITERATION_Space_ja_JP ) || defined( TRANSLITERATION_ALL )
114 TRANSLITERATION_IGNORE(Space_ja_JP
)
116 #if defined( TRANSLITERATION_TraditionalKana_ja_JP ) || defined( TRANSLITERATION_ALL )
117 TRANSLITERATION_IGNORE(TraditionalKana_ja_JP
)
119 #if defined( TRANSLITERATION_TraditionalKanji_ja_JP ) || defined( TRANSLITERATION_ALL )
120 TRANSLITERATION_IGNORE(TraditionalKanji_ja_JP
)
122 #if defined( TRANSLITERATION_ZiZu_ja_JP ) || defined( TRANSLITERATION_ALL )
123 TRANSLITERATION_IGNORE(ZiZu_ja_JP
)
125 #undef TRANSLITERATION_IGNORE
127 #define TRANSLITERATION_IGNORE( name ) \
128 class ignore##name : public transliteration_Ignore {\
131 func = (TransFunc) 0;\
134 transliterationName = "ignore"#name;\
135 implementationName = "com.sun.star.i18n.Transliteration.ignore"#name;\
137 rtl::OUString SAL_CALL folding( const rtl::OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, \
138 com::sun::star::uno::Sequence< sal_Int32 >& offset) throw(com::sun::star::uno::RuntimeException); \
141 #if defined( TRANSLITERATION_KiKuFollowedBySa_ja_JP ) || defined( TRANSLITERATION_ALL )
142 TRANSLITERATION_IGNORE(KiKuFollowedBySa_ja_JP
)
144 #if defined( TRANSLITERATION_IandEfollowedByYa_ja_JP ) || defined( TRANSLITERATION_ALL )
145 TRANSLITERATION_IGNORE(IandEfollowedByYa_ja_JP
)
147 #if defined( TRANSLITERATION_IterationMark_ja_JP ) || defined( TRANSLITERATION_ALL )
148 TRANSLITERATION_IGNORE(IterationMark_ja_JP
)
150 #if defined( TRANSLITERATION_ProlongedSoundMark_ja_JP ) || defined( TRANSLITERATION_ALL )
151 TRANSLITERATION_IGNORE(ProlongedSoundMark_ja_JP
)
153 #undef TRANSLITERATION_IGNORE
155 #define TRANSLITERATION_IGNORE( name ) \
156 class ignore##name : public transliteration_Ignore {\
159 func = (TransFunc) 0;\
162 transliterationName = "ignore"#name;\
163 implementationName = "com.sun.star.i18n.Transliteration.ignore"#name;\
165 rtl::OUString SAL_CALL folding( const rtl::OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, \
166 com::sun::star::uno::Sequence< sal_Int32 >& offset) throw(com::sun::star::uno::RuntimeException); \
167 using transliteration_Ignore::transliterateRange;\
168 com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL transliterateRange( const rtl::OUString& str1, \
169 const rtl::OUString& str2 ) throw(com::sun::star::uno::RuntimeException); \
170 sal_Unicode SAL_CALL \
171 transliterateChar2Char( sal_Unicode inChar) \
172 throw(com::sun::star::uno::RuntimeException,\
173 com::sun::star::i18n::MultipleCharsOutputException);\
176 #if defined( TRANSLITERATION_Kana ) || defined( TRANSLITERATION_ALL )
177 TRANSLITERATION_IGNORE(Kana
)
179 #if defined( TRANSLITERATION_Width ) || defined( TRANSLITERATION_ALL )
180 TRANSLITERATION_IGNORE(Width
)
182 #if defined( TRANSLITERATION_Size_ja_JP ) || defined( TRANSLITERATION_ALL )
183 TRANSLITERATION_IGNORE(Size_ja_JP
)
185 #undef TRANSLITERATION_IGNORE
189 #endif // _I18N_TRANSLITERATION_TRANSLITERATION_IGNORE_H_
191 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */