1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 INCLUDED_I18NPOOL_INC_TRANSLITERATION_IGNORE_HXX
20 #define INCLUDED_I18NPOOL_INC_TRANSLITERATION_IGNORE_HXX
22 #include <transliteration_commonclass.hxx>
23 #include <i18nutil/oneToOneMapping.hxx>
25 typedef sal_Unicode (*TransFunc
)(const sal_Unicode
);
27 namespace com
{ namespace sun
{ namespace star
{ namespace i18n
{
29 class transliteration_Ignore
: public transliteration_commonclass
32 virtual OUString SAL_CALL
33 folding( const OUString
& inStr
, sal_Int32 startPos
, sal_Int32 nCount
, com::sun::star::uno::Sequence
< sal_Int32
>& offset
)
34 throw(com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
36 // This method is shared.
38 equals( const OUString
& str1
, sal_Int32 pos1
, sal_Int32 nCount1
, sal_Int32
& nMatch1
,
39 const OUString
& str2
, sal_Int32 pos2
, sal_Int32 nCount2
, sal_Int32
& nMatch2
)
40 throw(com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
42 // This method is implemented in sub class if needed. Otherwise, the method implemented in this class will be used.
43 com::sun::star::uno::Sequence
< OUString
> SAL_CALL
44 transliterateRange( const OUString
& str1
, const OUString
& str2
)
45 throw(com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
48 // Methods which are shared.
49 sal_Int16 SAL_CALL
getType( ) throw(com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
52 transliterate( const OUString
& inStr
, sal_Int32 startPos
, sal_Int32 nCount
, com::sun::star::uno::Sequence
< sal_Int32
>& offset
)
53 throw(com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
55 virtual sal_Unicode SAL_CALL
56 transliterateChar2Char( sal_Unicode inChar
)
57 throw(com::sun::star::uno::RuntimeException
,
58 com::sun::star::i18n::MultipleCharsOutputException
, std::exception
) SAL_OVERRIDE
;
60 static com::sun::star::uno::Sequence
< OUString
> SAL_CALL
61 transliterateRange( const OUString
& str1
, const OUString
& str2
, XTransliteration
& t1
, XTransliteration
& t2
)
62 throw(com::sun::star::uno::RuntimeException
);
65 sal_Unicode previousChar
;
66 sal_Unicode currentChar
;
67 sal_Unicode replaceChar
;
73 oneToOneMapping
*table
;
77 #define TRANSLITERATION_IGNORE( name ) \
78 class ignore##name : public transliteration_Ignore {\
83 TRANSLITERATION_IGNORE(BaFa_ja_JP
)
84 TRANSLITERATION_IGNORE(HyuByu_ja_JP
)
85 TRANSLITERATION_IGNORE(SeZe_ja_JP
)
86 TRANSLITERATION_IGNORE(TiJi_ja_JP
)
87 TRANSLITERATION_IGNORE(MiddleDot_ja_JP
)
88 TRANSLITERATION_IGNORE(MinusSign_ja_JP
)
89 TRANSLITERATION_IGNORE(Separator_ja_JP
)
90 TRANSLITERATION_IGNORE(Space_ja_JP
)
91 TRANSLITERATION_IGNORE(TraditionalKana_ja_JP
)
92 TRANSLITERATION_IGNORE(TraditionalKanji_ja_JP
)
93 TRANSLITERATION_IGNORE(ZiZu_ja_JP
)
94 TRANSLITERATION_IGNORE(Diacritics_CTL
)
95 TRANSLITERATION_IGNORE(Kashida_CTL
)
97 #undef TRANSLITERATION_IGNORE
99 #define TRANSLITERATION_IGNORE( name ) \
100 class ignore##name : public transliteration_Ignore {\
103 func = (TransFunc) 0;\
106 transliterationName = "ignore"#name;\
107 implementationName = "com.sun.star.i18n.Transliteration.ignore"#name;\
109 OUString SAL_CALL folding( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, \
110 com::sun::star::uno::Sequence< sal_Int32 >& offset) throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; \
113 TRANSLITERATION_IGNORE(KiKuFollowedBySa_ja_JP
)
114 TRANSLITERATION_IGNORE(IandEfollowedByYa_ja_JP
)
115 TRANSLITERATION_IGNORE(IterationMark_ja_JP
)
116 TRANSLITERATION_IGNORE(ProlongedSoundMark_ja_JP
)
118 #undef TRANSLITERATION_IGNORE
120 #define TRANSLITERATION_IGNORE( name ) \
121 class ignore##name : public transliteration_Ignore {\
124 func = (TransFunc) 0;\
127 transliterationName = "ignore"#name;\
128 implementationName = "com.sun.star.i18n.Transliteration.ignore"#name;\
130 OUString SAL_CALL folding( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, \
131 com::sun::star::uno::Sequence< sal_Int32 >& offset) throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; \
132 using transliteration_Ignore::transliterateRange;\
133 com::sun::star::uno::Sequence< OUString > SAL_CALL transliterateRange( const OUString& str1, \
134 const OUString& str2 ) throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; \
135 sal_Unicode SAL_CALL \
136 transliterateChar2Char( sal_Unicode inChar) \
137 throw(com::sun::star::uno::RuntimeException,\
138 com::sun::star::i18n::MultipleCharsOutputException, std::exception) SAL_OVERRIDE;\
141 TRANSLITERATION_IGNORE(Kana
)
142 TRANSLITERATION_IGNORE(Width
)
143 TRANSLITERATION_IGNORE(Size_ja_JP
)
145 #undef TRANSLITERATION_IGNORE
149 #endif // INCLUDED_I18NPOOL_INC_TRANSLITERATION_IGNORE_HXX
151 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */