merge the formfield patch from ooo-build
[ooovba.git] / i18npool / inc / transliteration_Ignore.hxx
blob25cffb2a78e1e88092b28e44dee48aca64fec596
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: transliteration_Ignore.hxx,v $
10 * $Revision: 1.9 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _I18N_TRANSLITERATION_TRANSLITERATION_IGNORE_H_
31 #define _I18N_TRANSLITERATION_TRANSLITERATION_IGNORE_H_
33 #include <transliteration_commonclass.hxx>
34 #include <i18nutil/oneToOneMapping.hxx>
36 typedef sal_Unicode (*TransFunc)(const sal_Unicode);
38 typedef struct {
39 sal_Unicode previousChar;
40 sal_Unicode currentChar;
41 sal_Unicode replaceChar;
42 sal_Bool two2one;
43 } Mapping;
45 namespace com { namespace sun { namespace star { namespace i18n {
47 class transliteration_Ignore : public transliteration_commonclass
49 public:
50 virtual rtl::OUString SAL_CALL
51 folding( const rtl::OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, com::sun::star::uno::Sequence< sal_Int32 >& offset)
52 throw(com::sun::star::uno::RuntimeException);
54 // This method is shared.
55 sal_Bool SAL_CALL
56 equals( const rtl::OUString& str1, sal_Int32 pos1, sal_Int32 nCount1, sal_Int32& nMatch1,
57 const rtl::OUString& str2, sal_Int32 pos2, sal_Int32 nCount2, sal_Int32& nMatch2 )
58 throw(com::sun::star::uno::RuntimeException);
60 // This method is implemented in sub class if needed. Otherwise, the method implemented in this class will be used.
61 com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL
62 transliterateRange( const rtl::OUString& str1, const rtl::OUString& str2 )
63 throw(com::sun::star::uno::RuntimeException);
66 // Methods which are shared.
67 sal_Int16 SAL_CALL getType( ) throw(com::sun::star::uno::RuntimeException);
69 rtl::OUString SAL_CALL
70 transliterate( const rtl::OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, com::sun::star::uno::Sequence< sal_Int32 >& offset )
71 throw(com::sun::star::uno::RuntimeException);
73 virtual sal_Unicode SAL_CALL
74 transliterateChar2Char( sal_Unicode inChar)
75 throw(com::sun::star::uno::RuntimeException,
76 com::sun::star::i18n::MultipleCharsOutputException);
78 com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL
79 transliterateRange( const rtl::OUString& str1, const rtl::OUString& str2, XTransliteration& t1, XTransliteration& t2 )
80 throw(com::sun::star::uno::RuntimeException);
82 protected:
83 TransFunc func;
84 oneToOneMapping *table;
85 Mapping *map;
88 #define TRANSLITERATION_IGNORE( name ) \
89 class ignore##name : public transliteration_Ignore {\
90 public:\
91 ignore##name ();\
94 #if defined( TRANSLITERATION_BaFa_ja_JP ) || defined( TRANSLITERATION_ALL )
95 TRANSLITERATION_IGNORE(BaFa_ja_JP)
96 #endif
97 #if defined( TRANSLITERATION_HyuByu_ja_JP ) || defined( TRANSLITERATION_ALL )
98 TRANSLITERATION_IGNORE(HyuByu_ja_JP)
99 #endif
100 #if defined( TRANSLITERATION_SeZe_ja_JP ) || defined( TRANSLITERATION_ALL )
101 TRANSLITERATION_IGNORE(SeZe_ja_JP)
102 #endif
103 #if defined( TRANSLITERATION_TiJi_ja_JP ) || defined( TRANSLITERATION_ALL )
104 TRANSLITERATION_IGNORE(TiJi_ja_JP)
105 #endif
106 #if defined( TRANSLITERATION_MiddleDot_ja_JP ) || defined( TRANSLITERATION_ALL )
107 TRANSLITERATION_IGNORE(MiddleDot_ja_JP)
108 #endif
109 #if defined( TRANSLITERATION_MinusSign_ja_JP ) || defined( TRANSLITERATION_ALL )
110 TRANSLITERATION_IGNORE(MinusSign_ja_JP)
111 #endif
112 #if defined( TRANSLITERATION_Separator_ja_JP ) || defined( TRANSLITERATION_ALL )
113 TRANSLITERATION_IGNORE(Separator_ja_JP)
114 #endif
115 #if defined( TRANSLITERATION_Space_ja_JP ) || defined( TRANSLITERATION_ALL )
116 TRANSLITERATION_IGNORE(Space_ja_JP)
117 #endif
118 #if defined( TRANSLITERATION_TraditionalKana_ja_JP ) || defined( TRANSLITERATION_ALL )
119 TRANSLITERATION_IGNORE(TraditionalKana_ja_JP)
120 #endif
121 #if defined( TRANSLITERATION_TraditionalKanji_ja_JP ) || defined( TRANSLITERATION_ALL )
122 TRANSLITERATION_IGNORE(TraditionalKanji_ja_JP)
123 #endif
124 #if defined( TRANSLITERATION_ZiZu_ja_JP ) || defined( TRANSLITERATION_ALL )
125 TRANSLITERATION_IGNORE(ZiZu_ja_JP)
126 #endif
127 #undef TRANSLITERATION_IGNORE
129 #define TRANSLITERATION_IGNORE( name ) \
130 class ignore##name : public transliteration_Ignore {\
131 public:\
132 ignore##name () {\
133 func = (TransFunc) 0;\
134 table = 0;\
135 map = 0;\
136 transliterationName = "ignore"#name;\
137 implementationName = "com.sun.star.i18n.Transliteration.ignore"#name;\
139 rtl::OUString SAL_CALL folding( const rtl::OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, \
140 com::sun::star::uno::Sequence< sal_Int32 >& offset) throw(com::sun::star::uno::RuntimeException); \
143 #if defined( TRANSLITERATION_KiKuFollowedBySa_ja_JP ) || defined( TRANSLITERATION_ALL )
144 TRANSLITERATION_IGNORE(KiKuFollowedBySa_ja_JP)
145 #endif
146 #if defined( TRANSLITERATION_IandEfollowedByYa_ja_JP ) || defined( TRANSLITERATION_ALL )
147 TRANSLITERATION_IGNORE(IandEfollowedByYa_ja_JP)
148 #endif
149 #if defined( TRANSLITERATION_IterationMark_ja_JP ) || defined( TRANSLITERATION_ALL )
150 TRANSLITERATION_IGNORE(IterationMark_ja_JP)
151 #endif
152 #if defined( TRANSLITERATION_ProlongedSoundMark_ja_JP ) || defined( TRANSLITERATION_ALL )
153 TRANSLITERATION_IGNORE(ProlongedSoundMark_ja_JP)
154 #endif
155 #undef TRANSLITERATION_IGNORE
157 #define TRANSLITERATION_IGNORE( name ) \
158 class ignore##name : public transliteration_Ignore {\
159 public:\
160 ignore##name () {\
161 func = (TransFunc) 0;\
162 table = 0;\
163 map = 0;\
164 transliterationName = "ignore"#name;\
165 implementationName = "com.sun.star.i18n.Transliteration.ignore"#name;\
167 rtl::OUString SAL_CALL folding( const rtl::OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, \
168 com::sun::star::uno::Sequence< sal_Int32 >& offset) throw(com::sun::star::uno::RuntimeException); \
169 using transliteration_Ignore::transliterateRange;\
170 com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL transliterateRange( const rtl::OUString& str1, \
171 const rtl::OUString& str2 ) throw(com::sun::star::uno::RuntimeException); \
172 sal_Unicode SAL_CALL \
173 transliterateChar2Char( sal_Unicode inChar) \
174 throw(com::sun::star::uno::RuntimeException,\
175 com::sun::star::i18n::MultipleCharsOutputException);\
178 #if defined( TRANSLITERATION_Kana ) || defined( TRANSLITERATION_ALL )
179 TRANSLITERATION_IGNORE(Kana)
180 #endif
181 #if defined( TRANSLITERATION_Width ) || defined( TRANSLITERATION_ALL )
182 TRANSLITERATION_IGNORE(Width)
183 #endif
184 #if defined( TRANSLITERATION_Size_ja_JP ) || defined( TRANSLITERATION_ALL )
185 TRANSLITERATION_IGNORE(Size_ja_JP)
186 #endif
187 #undef TRANSLITERATION_IGNORE
189 } } } }
191 #endif // _I18N_TRANSLITERATION_TRANSLITERATION_IGNORE_H_