Version 3.6.0.2, tag libreoffice-3.6.0.2
[LibreOffice.git] / i18npool / inc / transliteration_Ignore.hxx
blob3f16695bfaf9b835b9519508adb1a2e05a436a26
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);
36 typedef struct {
37 sal_Unicode previousChar;
38 sal_Unicode currentChar;
39 sal_Unicode replaceChar;
40 sal_Bool two2one;
41 } Mapping;
43 namespace com { namespace sun { namespace star { namespace i18n {
45 class transliteration_Ignore : public transliteration_commonclass
47 public:
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.
53 sal_Bool SAL_CALL
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);
80 protected:
81 TransFunc func;
82 oneToOneMapping *table;
83 Mapping *map;
86 #define TRANSLITERATION_IGNORE( name ) \
87 class ignore##name : public transliteration_Ignore {\
88 public:\
89 ignore##name ();\
92 #if defined( TRANSLITERATION_BaFa_ja_JP ) || defined( TRANSLITERATION_ALL )
93 TRANSLITERATION_IGNORE(BaFa_ja_JP)
94 #endif
95 #if defined( TRANSLITERATION_HyuByu_ja_JP ) || defined( TRANSLITERATION_ALL )
96 TRANSLITERATION_IGNORE(HyuByu_ja_JP)
97 #endif
98 #if defined( TRANSLITERATION_SeZe_ja_JP ) || defined( TRANSLITERATION_ALL )
99 TRANSLITERATION_IGNORE(SeZe_ja_JP)
100 #endif
101 #if defined( TRANSLITERATION_TiJi_ja_JP ) || defined( TRANSLITERATION_ALL )
102 TRANSLITERATION_IGNORE(TiJi_ja_JP)
103 #endif
104 #if defined( TRANSLITERATION_MiddleDot_ja_JP ) || defined( TRANSLITERATION_ALL )
105 TRANSLITERATION_IGNORE(MiddleDot_ja_JP)
106 #endif
107 #if defined( TRANSLITERATION_MinusSign_ja_JP ) || defined( TRANSLITERATION_ALL )
108 TRANSLITERATION_IGNORE(MinusSign_ja_JP)
109 #endif
110 #if defined( TRANSLITERATION_Separator_ja_JP ) || defined( TRANSLITERATION_ALL )
111 TRANSLITERATION_IGNORE(Separator_ja_JP)
112 #endif
113 #if defined( TRANSLITERATION_Space_ja_JP ) || defined( TRANSLITERATION_ALL )
114 TRANSLITERATION_IGNORE(Space_ja_JP)
115 #endif
116 #if defined( TRANSLITERATION_TraditionalKana_ja_JP ) || defined( TRANSLITERATION_ALL )
117 TRANSLITERATION_IGNORE(TraditionalKana_ja_JP)
118 #endif
119 #if defined( TRANSLITERATION_TraditionalKanji_ja_JP ) || defined( TRANSLITERATION_ALL )
120 TRANSLITERATION_IGNORE(TraditionalKanji_ja_JP)
121 #endif
122 #if defined( TRANSLITERATION_ZiZu_ja_JP ) || defined( TRANSLITERATION_ALL )
123 TRANSLITERATION_IGNORE(ZiZu_ja_JP)
124 #endif
125 #undef TRANSLITERATION_IGNORE
127 #define TRANSLITERATION_IGNORE( name ) \
128 class ignore##name : public transliteration_Ignore {\
129 public:\
130 ignore##name () {\
131 func = (TransFunc) 0;\
132 table = 0;\
133 map = 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)
143 #endif
144 #if defined( TRANSLITERATION_IandEfollowedByYa_ja_JP ) || defined( TRANSLITERATION_ALL )
145 TRANSLITERATION_IGNORE(IandEfollowedByYa_ja_JP)
146 #endif
147 #if defined( TRANSLITERATION_IterationMark_ja_JP ) || defined( TRANSLITERATION_ALL )
148 TRANSLITERATION_IGNORE(IterationMark_ja_JP)
149 #endif
150 #if defined( TRANSLITERATION_ProlongedSoundMark_ja_JP ) || defined( TRANSLITERATION_ALL )
151 TRANSLITERATION_IGNORE(ProlongedSoundMark_ja_JP)
152 #endif
153 #undef TRANSLITERATION_IGNORE
155 #define TRANSLITERATION_IGNORE( name ) \
156 class ignore##name : public transliteration_Ignore {\
157 public:\
158 ignore##name () {\
159 func = (TransFunc) 0;\
160 table = 0;\
161 map = 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)
178 #endif
179 #if defined( TRANSLITERATION_Width ) || defined( TRANSLITERATION_ALL )
180 TRANSLITERATION_IGNORE(Width)
181 #endif
182 #if defined( TRANSLITERATION_Size_ja_JP ) || defined( TRANSLITERATION_ALL )
183 TRANSLITERATION_IGNORE(Size_ja_JP)
184 #endif
185 #undef TRANSLITERATION_IGNORE
187 } } } }
189 #endif // _I18N_TRANSLITERATION_TRANSLITERATION_IGNORE_H_
191 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */