Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / i18npool / source / registerservices / registerservices.cxx
blobdd891558696de93ffb43b366a23505e5cf030ead
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #include <config_locales.h>
22 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
24 #include <comphelper/processfactory.hxx>
25 #include <cppuhelper/factory.hxx>
26 #include <cppuhelper/weak.hxx>
28 #include <servicename.hxx>
30 #include <transliteration_body.hxx>
31 #include <transliteration_OneToOne.hxx>
32 #include <textToPronounce_zh.hxx>
33 #include <numtotext_cjk.hxx>
34 #include <numtochar.hxx>
35 #include <texttonum.hxx>
36 #include <chartonum.hxx>
38 #include <calendarImpl.hxx>
39 #include <calendar_gregorian.hxx>
40 #include <calendar_hijri.hxx>
41 #include <calendar_jewish.hxx>
43 #include <breakiterator_cjk.hxx>
44 #include <breakiterator_th.hxx>
46 #include <indexentrysupplier.hxx>
47 #include <indexentrysupplier_asian.hxx>
48 #include <indexentrysupplier_ja_phonetic.hxx>
49 #include <indexentrysupplier_default.hxx>
51 #include <chaptercollator.hxx>
52 #include <collator_unicode.hxx>
54 #include <inputsequencechecker_th.hxx>
55 #include <inputsequencechecker_hi.hxx>
57 #include <textconversion.hxx>
59 using namespace ::com::sun::star;
60 using namespace ::com::sun::star::i18n;
61 using namespace i18npool;
63 #define IMPL_CREATEINSTANCE( ImplName ) \
64 static uno::Reference< uno::XInterface > \
65 ImplName##_CreateInstance( \
66 SAL_UNUSED_PARAMETER const uno::Reference< \
67 lang::XMultiServiceFactory >& ) \
68 { \
69 return uno::Reference < \
70 uno::XInterface >( static_cast<cppu::OWeakObject*>( \
71 new ImplName) ); \
74 #define IMPL_CREATEINSTANCE_CTX( ImplName ) \
75 static uno::Reference< uno::XInterface > \
76 ImplName##_CreateInstance( \
77 const uno::Reference< \
78 lang::XMultiServiceFactory >& rxMSF ) \
79 { \
80 return uno::Reference < \
81 uno::XInterface >( static_cast<cppu::OWeakObject*>( \
82 new ImplName( comphelper::getComponentContext(rxMSF) )) ); \
85 typedef uno::Reference<
86 uno::XInterface > (*FN_CreateInstance)(
87 const uno::Reference<
88 lang::XMultiServiceFactory >& );
90 #define IMPL_TRANSLITERATION_ITEM( implName ) \
91 { TRLT_SERVICELNAME_L10N, \
92 TRLT_IMPLNAME_PREFIX #implName, \
93 &implName##_CreateInstance }
96 // At least for iOS it doesn't hurt if we have lots of functions here
97 // generated by these lovely macros that get compiled, but then no
98 // references to them thanks to the WITH_LOCALE ifdefs for the
99 // aInstances table below. The -dead_strip linker option will take
100 // care of not linking these functions in. Presumably the same holds
101 // for Android, too, as we use -ffunction-sections and
102 // -Wl,--gc_sections. It's mainly for iOS and Android that the
103 // --with-locales option is intended anyway.
105 IMPL_CREATEINSTANCE_CTX( IndexEntrySupplier )
106 IMPL_CREATEINSTANCE_CTX( IndexEntrySupplier_asian )
107 IMPL_CREATEINSTANCE_CTX( IndexEntrySupplier_ja_phonetic_alphanumeric_first_by_syllable )
108 IMPL_CREATEINSTANCE_CTX( IndexEntrySupplier_ja_phonetic_alphanumeric_first_by_consonant )
109 IMPL_CREATEINSTANCE_CTX( IndexEntrySupplier_ja_phonetic_alphanumeric_last_by_syllable )
110 IMPL_CREATEINSTANCE_CTX( IndexEntrySupplier_ja_phonetic_alphanumeric_last_by_consonant )
111 IMPL_CREATEINSTANCE_CTX( IndexEntrySupplier_Unicode )
112 IMPL_CREATEINSTANCE_CTX( CalendarImpl )
113 IMPL_CREATEINSTANCE( Calendar_gregorian )
114 IMPL_CREATEINSTANCE( Calendar_hanja )
115 IMPL_CREATEINSTANCE( Calendar_gengou )
116 IMPL_CREATEINSTANCE( Calendar_ROC )
117 IMPL_CREATEINSTANCE( Calendar_dangi )
118 IMPL_CREATEINSTANCE( Calendar_hijri )
119 IMPL_CREATEINSTANCE( Calendar_jewish )
120 IMPL_CREATEINSTANCE( Calendar_buddhist )
121 IMPL_CREATEINSTANCE( BreakIterator_ja )
122 IMPL_CREATEINSTANCE( BreakIterator_zh )
123 IMPL_CREATEINSTANCE( BreakIterator_zh_TW )
124 IMPL_CREATEINSTANCE( BreakIterator_ko )
125 IMPL_CREATEINSTANCE( BreakIterator_th )
126 IMPL_CREATEINSTANCE_CTX( ChapterCollator )
127 IMPL_CREATEINSTANCE( Collator_Unicode )
129 IMPL_CREATEINSTANCE( InputSequenceChecker_th )
130 IMPL_CREATEINSTANCE( InputSequenceChecker_hi )
132 IMPL_CREATEINSTANCE_CTX( TextConversion_ko )
133 IMPL_CREATEINSTANCE_CTX( TextConversion_zh )
135 IMPL_CREATEINSTANCE( Transliteration_u2l )
136 IMPL_CREATEINSTANCE( Transliteration_l2u )
137 IMPL_CREATEINSTANCE( Transliteration_sentencecase )
138 IMPL_CREATEINSTANCE( Transliteration_titlecase )
139 IMPL_CREATEINSTANCE( Transliteration_togglecase )
140 IMPL_CREATEINSTANCE( hiraganaToKatakana )
141 IMPL_CREATEINSTANCE( katakanaToHiragana )
142 IMPL_CREATEINSTANCE( fullwidthToHalfwidth )
143 IMPL_CREATEINSTANCE( halfwidthToFullwidth )
145 IMPL_CREATEINSTANCE( smallToLarge_ja_JP)
146 IMPL_CREATEINSTANCE( largeToSmall_ja_JP)
147 IMPL_CREATEINSTANCE( ignoreTraditionalKanji_ja_JP)
148 IMPL_CREATEINSTANCE( ignoreTraditionalKana_ja_JP)
149 IMPL_CREATEINSTANCE( ignoreMinusSign_ja_JP)
150 IMPL_CREATEINSTANCE( ignoreIterationMark_ja_JP)
151 IMPL_CREATEINSTANCE( ignoreSeparator_ja_JP)
152 IMPL_CREATEINSTANCE( ignoreZiZu_ja_JP)
153 IMPL_CREATEINSTANCE( ignoreBaFa_ja_JP)
154 IMPL_CREATEINSTANCE( ignoreTiJi_ja_JP)
155 IMPL_CREATEINSTANCE( ignoreHyuByu_ja_JP)
156 IMPL_CREATEINSTANCE( ignoreSeZe_ja_JP)
157 IMPL_CREATEINSTANCE( ignoreIandEfollowedByYa_ja_JP)
158 IMPL_CREATEINSTANCE( ignoreKiKuFollowedBySa_ja_JP)
159 IMPL_CREATEINSTANCE( ignoreSize_ja_JP)
160 IMPL_CREATEINSTANCE( ignoreProlongedSoundMark_ja_JP)
161 IMPL_CREATEINSTANCE( ignoreMiddleDot_ja_JP)
162 IMPL_CREATEINSTANCE( ignoreSpace_ja_JP)
163 IMPL_CREATEINSTANCE( ignoreDiacritics_CTL)
164 IMPL_CREATEINSTANCE( ignoreKashida_CTL)
166 IMPL_CREATEINSTANCE( TextToChuyin_zh_TW )
167 IMPL_CREATEINSTANCE( TextToPinyin_zh_CN )
169 IMPL_CREATEINSTANCE( NumToCharLower_zh_CN )
170 IMPL_CREATEINSTANCE( NumToCharUpper_zh_CN )
171 IMPL_CREATEINSTANCE( NumToCharLower_zh_TW )
172 IMPL_CREATEINSTANCE( NumToCharUpper_zh_TW )
173 IMPL_CREATEINSTANCE( NumToCharHalfwidth )
174 IMPL_CREATEINSTANCE( NumToCharFullwidth )
175 IMPL_CREATEINSTANCE( NumToCharKanjiShort_ja_JP )
176 IMPL_CREATEINSTANCE( NumToCharKanjiTraditional_ja_JP )
177 IMPL_CREATEINSTANCE( NumToCharHangul_ko )
178 IMPL_CREATEINSTANCE( NumToCharLower_ko )
179 IMPL_CREATEINSTANCE( NumToCharUpper_ko )
180 IMPL_CREATEINSTANCE( NumToCharIndic_ar )
181 IMPL_CREATEINSTANCE( NumToCharEastIndic_ar )
182 IMPL_CREATEINSTANCE( NumToCharIndic_hi )
183 IMPL_CREATEINSTANCE( NumToChar_th )
185 IMPL_CREATEINSTANCE( CharToNumLower_zh_CN )
186 IMPL_CREATEINSTANCE( CharToNumUpper_zh_CN )
187 IMPL_CREATEINSTANCE( CharToNumLower_zh_TW )
188 IMPL_CREATEINSTANCE( CharToNumUpper_zh_TW )
189 IMPL_CREATEINSTANCE( CharToNumFullwidth )
190 IMPL_CREATEINSTANCE( CharToNumKanjiShort_ja_JP )
191 IMPL_CREATEINSTANCE( CharToNumKanjiTraditional_ja_JP )
192 IMPL_CREATEINSTANCE( CharToNumHangul_ko )
193 IMPL_CREATEINSTANCE( CharToNumLower_ko )
194 IMPL_CREATEINSTANCE( CharToNumUpper_ko )
195 IMPL_CREATEINSTANCE( CharToNumIndic_ar )
196 IMPL_CREATEINSTANCE( CharToNumEastIndic_ar )
197 IMPL_CREATEINSTANCE( CharToNumIndic_hi )
198 IMPL_CREATEINSTANCE( CharToNum_th )
200 IMPL_CREATEINSTANCE( NumToTextLower_zh_CN )
201 IMPL_CREATEINSTANCE( NumToTextUpper_zh_CN )
202 IMPL_CREATEINSTANCE( NumToTextLower_zh_TW )
203 IMPL_CREATEINSTANCE( NumToTextUpper_zh_TW )
204 IMPL_CREATEINSTANCE( NumToTextFullwidth_zh_CN )
205 IMPL_CREATEINSTANCE( NumToTextFullwidth_zh_TW )
206 IMPL_CREATEINSTANCE( NumToTextFullwidth_ja_JP )
207 IMPL_CREATEINSTANCE( NumToTextFullwidth_ko )
208 IMPL_CREATEINSTANCE( NumToTextKanjiLongModern_ja_JP )
209 IMPL_CREATEINSTANCE( NumToTextKanjiLongTraditional_ja_JP )
210 IMPL_CREATEINSTANCE( NumToTextKanjiShortModern_ja_JP )
211 IMPL_CREATEINSTANCE( NumToTextKanjiShortTraditional_ja_JP )
212 IMPL_CREATEINSTANCE( NumToTextFormalHangul_ko )
213 IMPL_CREATEINSTANCE( NumToTextFormalLower_ko )
214 IMPL_CREATEINSTANCE( NumToTextFormalUpper_ko )
215 IMPL_CREATEINSTANCE( NumToTextInformalHangul_ko )
216 IMPL_CREATEINSTANCE( NumToTextInformalUpper_ko )
217 IMPL_CREATEINSTANCE( NumToTextInformalLower_ko )
219 IMPL_CREATEINSTANCE( TextToNumLower_zh_CN )
220 IMPL_CREATEINSTANCE( TextToNumUpper_zh_CN )
221 IMPL_CREATEINSTANCE( TextToNumLower_zh_TW )
222 IMPL_CREATEINSTANCE( TextToNumUpper_zh_TW )
223 IMPL_CREATEINSTANCE( TextToNumKanjiLongModern_ja_JP )
224 IMPL_CREATEINSTANCE( TextToNumKanjiLongTraditional_ja_JP )
225 IMPL_CREATEINSTANCE( TextToNumFormalHangul_ko )
226 IMPL_CREATEINSTANCE( TextToNumFormalLower_ko )
227 IMPL_CREATEINSTANCE( TextToNumFormalUpper_ko )
228 IMPL_CREATEINSTANCE( TextToNumInformalHangul_ko )
229 IMPL_CREATEINSTANCE( TextToNumInformalUpper_ko )
230 IMPL_CREATEINSTANCE( TextToNumInformalLower_ko )
232 IMPL_CREATEINSTANCE( NumToTextDate_zh )
233 IMPL_CREATEINSTANCE( NumToTextAIUFullWidth_ja_JP )
234 IMPL_CREATEINSTANCE( NumToTextAIUHalfWidth_ja_JP )
235 IMPL_CREATEINSTANCE( NumToTextIROHAFullWidth_ja_JP )
236 IMPL_CREATEINSTANCE( NumToTextIROHAHalfWidth_ja_JP )
237 IMPL_CREATEINSTANCE( NumToTextCircledNumber )
238 IMPL_CREATEINSTANCE( NumToTextHangulJamo_ko )
239 IMPL_CREATEINSTANCE( NumToTextHangulSyllable_ko )
240 IMPL_CREATEINSTANCE( NumToTextHangulCircledJamo_ko )
241 IMPL_CREATEINSTANCE( NumToTextHangulCircledSyllable_ko )
242 IMPL_CREATEINSTANCE( NumToTextTianGan_zh )
243 IMPL_CREATEINSTANCE( NumToTextDiZi_zh )
245 IMPL_CREATEINSTANCE( fullwidthKatakanaToHalfwidthKatakana )
246 IMPL_CREATEINSTANCE( halfwidthKatakanaToFullwidthKatakana )
247 IMPL_CREATEINSTANCE( fullwidthToHalfwidthLikeASC )
248 IMPL_CREATEINSTANCE( halfwidthToFullwidthLikeJIS )
250 static const struct InstancesArray {
251 const sal_Char* pServiceNm;
252 const sal_Char* pImplementationNm;
253 FN_CreateInstance pFn;
254 } aInstances[] = {
255 { "com.sun.star.i18n.IndexEntrySupplier",
256 "com.sun.star.i18n.IndexEntrySupplier",
257 &IndexEntrySupplier_CreateInstance },
258 { "com.sun.star.i18n.IndexEntrySupplier_asian",
259 "com.sun.star.i18n.IndexEntrySupplier_asian",
260 &IndexEntrySupplier_asian_CreateInstance },
261 #if WITH_LOCALE_ALL || WITH_LOCALE_ja
262 { "com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric first)",
263 "com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric first)",
264 &IndexEntrySupplier_ja_phonetic_alphanumeric_first_by_syllable_CreateInstance },
265 { "com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric last)",
266 "com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric last)",
267 &IndexEntrySupplier_ja_phonetic_alphanumeric_last_by_syllable_CreateInstance },
268 { "com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric first) (grouped by syllable)",
269 "com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric first) (grouped by syllable)",
270 &IndexEntrySupplier_ja_phonetic_alphanumeric_first_by_syllable_CreateInstance },
271 { "com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric first) (grouped by consonant)",
272 "com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric first) (grouped by consonant)",
273 &IndexEntrySupplier_ja_phonetic_alphanumeric_first_by_consonant_CreateInstance },
274 { "com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric last) (grouped by syllable)",
275 "com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric last) (grouped by syllable)",
276 &IndexEntrySupplier_ja_phonetic_alphanumeric_last_by_syllable_CreateInstance },
277 { "com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric last) (grouped by consonant)",
278 "com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric last) (grouped by consonant)",
279 &IndexEntrySupplier_ja_phonetic_alphanumeric_last_by_consonant_CreateInstance },
280 #endif
281 { "com.sun.star.i18n.IndexEntrySupplier_Unicode",
282 "com.sun.star.i18n.IndexEntrySupplier_Unicode",
283 &IndexEntrySupplier_Unicode_CreateInstance },
284 { "com.sun.star.i18n.LocaleCalendar",
285 "com.sun.star.i18n.CalendarImpl",
286 &CalendarImpl_CreateInstance },
287 { "com.sun.star.i18n.LocaleCalendar2",
288 "com.sun.star.i18n.CalendarImpl",
289 &CalendarImpl_CreateInstance },
290 { "com.sun.star.i18n.Calendar_gregorian",
291 "com.sun.star.i18n.Calendar_gregorian",
292 &Calendar_gregorian_CreateInstance },
293 { "com.sun.star.i18n.Calendar_gengou",
294 "com.sun.star.i18n.Calendar_gengou",
295 &Calendar_gengou_CreateInstance },
296 { "com.sun.star.i18n.Calendar_ROC",
297 "com.sun.star.i18n.Calendar_ROC",
298 &Calendar_ROC_CreateInstance },
299 { "com.sun.star.i18n.Calendar_dangi",
300 "com.sun.star.i18n.Calendar_dangi",
301 &Calendar_dangi_CreateInstance },
302 { "com.sun.star.i18n.Calendar_hanja_yoil",
303 "com.sun.star.i18n.Calendar_hanja_yoil",
304 &Calendar_hanja_CreateInstance },
305 { "com.sun.star.i18n.Calendar_hanja",
306 "com.sun.star.i18n.Calendar_hanja",
307 &Calendar_hanja_CreateInstance },
308 { "com.sun.star.i18n.Calendar_hijri",
309 "com.sun.star.i18n.Calendar_hijri",
310 &Calendar_hijri_CreateInstance },
311 { "com.sun.star.i18n.Calendar_jewish",
312 "com.sun.star.i18n.Calendar_jewish",
313 &Calendar_jewish_CreateInstance },
314 { "com.sun.star.i18n.Calendar_buddhist",
315 "com.sun.star.i18n.Calendar_buddhist",
316 &Calendar_buddhist_CreateInstance },
317 #if WITH_LOCALE_ALL || WITH_LOCALE_ja
318 { "com.sun.star.i18n.BreakIterator_ja",
319 "com.sun.star.i18n.BreakIterator_ja",
320 &BreakIterator_ja_CreateInstance },
321 #endif
322 #if WITH_LOCALE_ALL || WITH_LOCALE_zh
323 { "com.sun.star.i18n.BreakIterator_zh",
324 "com.sun.star.i18n.BreakIterator_zh",
325 &BreakIterator_zh_CreateInstance },
326 { "com.sun.star.i18n.BreakIterator_zh_TW",
327 "com.sun.star.i18n.BreakIterator_zh_TW",
328 &BreakIterator_zh_TW_CreateInstance },
329 #endif
330 #if WITH_LOCALE_ALL || WITH_LOCALE_ko
331 { "com.sun.star.i18n.BreakIterator_ko",
332 "com.sun.star.i18n.BreakIterator_ko",
333 &BreakIterator_ko_CreateInstance },
334 #endif
335 #if WITH_LOCALE_ALL || WITH_LOCALE_th
336 { "com.sun.star.i18n.BreakIterator_th",
337 "com.sun.star.i18n.BreakIterator_th",
338 &BreakIterator_th_CreateInstance },
339 #endif
340 { "com.sun.star.i18n.ChapterCollator",
341 "com.sun.star.i18n.ChapterCollator",
342 &ChapterCollator_CreateInstance },
343 { "com.sun.star.i18n.Collator_Unicode",
344 "com.sun.star.i18n.Collator_Unicode",
345 &Collator_Unicode_CreateInstance },
346 #if WITH_LOCALE_ALL || WITH_LOCALE_th
347 { "com.sun.star.i18n.InputSequenceChecker_th",
348 "com.sun.star.i18n.InputSequenceChecker_th",
349 &InputSequenceChecker_th_CreateInstance },
350 #endif
351 #if WITH_LOCALE_ALL || WITH_LOCALE_hi
352 { "com.sun.star.i18n.InputSequenceChecker_hi",
353 "com.sun.star.i18n.InputSequenceChecker_hi",
354 &InputSequenceChecker_hi_CreateInstance },
355 #endif
356 #if WITH_LOCALE_ALL || WITH_LOCALE_ko
357 { "com.sun.star.i18n.TextConversion_ko",
358 "com.sun.star.i18n.TextConversion_ko",
359 &TextConversion_ko_CreateInstance },
360 #endif
361 #if WITH_LOCALE_ALL || WITH_LOCALE_zh
362 { "com.sun.star.i18n.TextConversion_zh",
363 "com.sun.star.i18n.TextConversion_zh",
364 &TextConversion_zh_CreateInstance },
365 #endif
366 { TRLT_SERVICELNAME_L10N,
367 TRLT_IMPLNAME_PREFIX "UPPERCASE_LOWERCASE",
368 &Transliteration_u2l_CreateInstance },
369 { TRLT_SERVICELNAME_L10N,
370 TRLT_IMPLNAME_PREFIX "LOWERCASE_UPPERCASE",
371 &Transliteration_l2u_CreateInstance },
372 { TRLT_SERVICELNAME_L10N,
373 TRLT_IMPLNAME_PREFIX "SENTENCE_CASE",
374 &Transliteration_sentencecase_CreateInstance },
375 { TRLT_SERVICELNAME_L10N,
376 TRLT_IMPLNAME_PREFIX "TITLE_CASE",
377 &Transliteration_titlecase_CreateInstance },
378 { TRLT_SERVICELNAME_L10N,
379 TRLT_IMPLNAME_PREFIX "TOGGLE_CASE",
380 &Transliteration_togglecase_CreateInstance },
381 #if WITH_LOCALE_ALL || WITH_LOCALE_ja
382 { TRLT_SERVICELNAME_L10N,
383 TRLT_IMPLNAME_PREFIX "HIRAGANA_KATAKANA",
384 &hiraganaToKatakana_CreateInstance },
385 { TRLT_SERVICELNAME_L10N,
386 TRLT_IMPLNAME_PREFIX "KATAKANA_HIRAGANA",
387 &katakanaToHiragana_CreateInstance },
388 { TRLT_SERVICELNAME_L10N,
389 TRLT_IMPLNAME_PREFIX "FULLWIDTH_HALFWIDTH",
390 &fullwidthToHalfwidth_CreateInstance },
391 { TRLT_SERVICELNAME_L10N,
392 TRLT_IMPLNAME_PREFIX "HALFWIDTH_FULLWIDTH",
393 &halfwidthToFullwidth_CreateInstance },
394 #endif
395 #if WITH_LOCALE_ALL || WITH_LOCALE_ja
396 IMPL_TRANSLITERATION_ITEM (smallToLarge_ja_JP),
397 IMPL_TRANSLITERATION_ITEM (largeToSmall_ja_JP),
398 IMPL_TRANSLITERATION_ITEM (ignoreTraditionalKanji_ja_JP),
399 IMPL_TRANSLITERATION_ITEM (ignoreTraditionalKana_ja_JP),
400 IMPL_TRANSLITERATION_ITEM (ignoreMinusSign_ja_JP),
401 IMPL_TRANSLITERATION_ITEM (ignoreIterationMark_ja_JP),
402 IMPL_TRANSLITERATION_ITEM (ignoreSeparator_ja_JP),
403 IMPL_TRANSLITERATION_ITEM (ignoreZiZu_ja_JP),
404 IMPL_TRANSLITERATION_ITEM (ignoreBaFa_ja_JP),
405 IMPL_TRANSLITERATION_ITEM (ignoreTiJi_ja_JP),
406 IMPL_TRANSLITERATION_ITEM (ignoreHyuByu_ja_JP),
407 IMPL_TRANSLITERATION_ITEM (ignoreSeZe_ja_JP),
408 IMPL_TRANSLITERATION_ITEM (ignoreIandEfollowedByYa_ja_JP),
409 IMPL_TRANSLITERATION_ITEM (ignoreKiKuFollowedBySa_ja_JP),
410 IMPL_TRANSLITERATION_ITEM (ignoreSize_ja_JP),
411 IMPL_TRANSLITERATION_ITEM (ignoreProlongedSoundMark_ja_JP),
412 IMPL_TRANSLITERATION_ITEM (ignoreMiddleDot_ja_JP),
413 IMPL_TRANSLITERATION_ITEM (ignoreSpace_ja_JP),
414 #endif
415 #if WITH_LOCALE_ALL || WITH_LOCALE_zh
416 IMPL_TRANSLITERATION_ITEM (TextToPinyin_zh_CN),
417 IMPL_TRANSLITERATION_ITEM (TextToChuyin_zh_TW),
418 #endif
419 IMPL_TRANSLITERATION_ITEM( ignoreDiacritics_CTL),
420 IMPL_TRANSLITERATION_ITEM (ignoreKashida_CTL),
422 #if WITH_LOCALE_ALL || WITH_LOCALE_zh
423 IMPL_TRANSLITERATION_ITEM (NumToCharUpper_zh_CN),
424 IMPL_TRANSLITERATION_ITEM (NumToCharLower_zh_CN),
425 IMPL_TRANSLITERATION_ITEM (NumToCharUpper_zh_TW),
426 IMPL_TRANSLITERATION_ITEM (NumToCharLower_zh_TW),
427 #endif
428 #if WITH_LOCALE_ALL || WITH_LOCALE_ja
429 IMPL_TRANSLITERATION_ITEM (NumToCharHalfwidth),
430 IMPL_TRANSLITERATION_ITEM (NumToCharFullwidth),
431 IMPL_TRANSLITERATION_ITEM (NumToCharKanjiShort_ja_JP),
432 IMPL_TRANSLITERATION_ITEM (NumToCharKanjiTraditional_ja_JP),
433 #endif
434 #if WITH_LOCALE_ALL || WITH_LOCALE_ko
435 IMPL_TRANSLITERATION_ITEM (NumToCharLower_ko),
436 IMPL_TRANSLITERATION_ITEM (NumToCharUpper_ko),
437 IMPL_TRANSLITERATION_ITEM (NumToCharHangul_ko),
438 #endif
439 IMPL_TRANSLITERATION_ITEM (NumToCharIndic_ar),
440 IMPL_TRANSLITERATION_ITEM (NumToCharEastIndic_ar),
441 #if WITH_LOCALE_ALL || WITH_LOCALE_hi
442 IMPL_TRANSLITERATION_ITEM (NumToCharIndic_hi),
443 #endif
444 #if WITH_LOCALE_ALL || WITH_LOCALE_th
445 IMPL_TRANSLITERATION_ITEM (NumToChar_th),
446 #endif
448 #if WITH_LOCALE_ALL || WITH_LOCALE_zh
449 IMPL_TRANSLITERATION_ITEM (CharToNumUpper_zh_CN),
450 IMPL_TRANSLITERATION_ITEM (CharToNumLower_zh_CN),
451 IMPL_TRANSLITERATION_ITEM (CharToNumUpper_zh_TW),
452 IMPL_TRANSLITERATION_ITEM (CharToNumLower_zh_TW),
453 #endif
454 #if WITH_LOCALE_ALL || WITH_LOCALE_ja
455 IMPL_TRANSLITERATION_ITEM (CharToNumFullwidth),
456 IMPL_TRANSLITERATION_ITEM (CharToNumKanjiShort_ja_JP),
457 IMPL_TRANSLITERATION_ITEM (CharToNumKanjiTraditional_ja_JP),
458 #endif
459 #if WITH_LOCALE_ALL || WITH_LOCALE_ko
460 IMPL_TRANSLITERATION_ITEM (CharToNumLower_ko),
461 IMPL_TRANSLITERATION_ITEM (CharToNumUpper_ko),
462 IMPL_TRANSLITERATION_ITEM (CharToNumHangul_ko),
463 #endif
464 IMPL_TRANSLITERATION_ITEM (CharToNumIndic_ar),
465 IMPL_TRANSLITERATION_ITEM (CharToNumEastIndic_ar),
466 #if WITH_LOCALE_ALL || WITH_LOCALE_hi
467 IMPL_TRANSLITERATION_ITEM (CharToNumIndic_hi),
468 #endif
469 #if WITH_LOCALE_ALL || WITH_LOCALE_th
470 IMPL_TRANSLITERATION_ITEM (CharToNum_th),
471 #endif
473 #if WITH_LOCALE_ALL || WITH_LOCALE_zh
474 IMPL_TRANSLITERATION_ITEM (NumToTextUpper_zh_CN),
475 IMPL_TRANSLITERATION_ITEM (NumToTextLower_zh_CN),
476 IMPL_TRANSLITERATION_ITEM (NumToTextUpper_zh_TW),
477 IMPL_TRANSLITERATION_ITEM (NumToTextLower_zh_TW),
478 IMPL_TRANSLITERATION_ITEM (NumToTextFullwidth_zh_CN),
479 IMPL_TRANSLITERATION_ITEM (NumToTextFullwidth_zh_TW),
480 #endif
481 #if WITH_LOCALE_ALL || WITH_LOCALE_ja
482 IMPL_TRANSLITERATION_ITEM (NumToTextFullwidth_ja_JP),
483 #endif
484 #if WITH_LOCALE_ALL || WITH_LOCALE_ko
485 IMPL_TRANSLITERATION_ITEM (NumToTextFullwidth_ko),
486 #endif
487 #if WITH_LOCALE_ALL || WITH_LOCALE_ja
488 IMPL_TRANSLITERATION_ITEM (NumToTextKanjiLongModern_ja_JP),
489 IMPL_TRANSLITERATION_ITEM (NumToTextKanjiLongTraditional_ja_JP),
490 IMPL_TRANSLITERATION_ITEM (NumToTextKanjiShortModern_ja_JP),
491 IMPL_TRANSLITERATION_ITEM (NumToTextKanjiShortTraditional_ja_JP),
492 #endif
493 #if WITH_LOCALE_ALL || WITH_LOCALE_ko
494 IMPL_TRANSLITERATION_ITEM (NumToTextInformalHangul_ko),
495 IMPL_TRANSLITERATION_ITEM (NumToTextInformalLower_ko),
496 IMPL_TRANSLITERATION_ITEM (NumToTextInformalUpper_ko),
497 IMPL_TRANSLITERATION_ITEM (NumToTextFormalHangul_ko),
498 IMPL_TRANSLITERATION_ITEM (NumToTextFormalLower_ko),
499 IMPL_TRANSLITERATION_ITEM (NumToTextFormalUpper_ko),
500 #endif
502 #if WITH_LOCALE_ALL || WITH_LOCALE_zh
503 IMPL_TRANSLITERATION_ITEM (TextToNumUpper_zh_CN),
504 IMPL_TRANSLITERATION_ITEM (TextToNumLower_zh_CN),
505 IMPL_TRANSLITERATION_ITEM (TextToNumUpper_zh_TW),
506 IMPL_TRANSLITERATION_ITEM (TextToNumLower_zh_TW),
507 #endif
508 #if WITH_LOCALE_ALL || WITH_LOCALE_ja
509 IMPL_TRANSLITERATION_ITEM (TextToNumKanjiLongModern_ja_JP),
510 IMPL_TRANSLITERATION_ITEM (TextToNumKanjiLongTraditional_ja_JP),
511 #endif
512 #if WITH_LOCALE_ALL || WITH_LOCALE_ko
513 IMPL_TRANSLITERATION_ITEM (TextToNumInformalHangul_ko),
514 IMPL_TRANSLITERATION_ITEM (TextToNumInformalLower_ko),
515 IMPL_TRANSLITERATION_ITEM (TextToNumInformalUpper_ko),
516 IMPL_TRANSLITERATION_ITEM (TextToNumFormalHangul_ko),
517 IMPL_TRANSLITERATION_ITEM (TextToNumFormalLower_ko),
518 IMPL_TRANSLITERATION_ITEM (TextToNumFormalUpper_ko),
519 #endif
521 #if WITH_LOCALE_ALL || WITH_LOCALE_zh
522 IMPL_TRANSLITERATION_ITEM (NumToTextDate_zh),
523 #endif
524 #if WITH_LOCALE_ALL || WITH_LOCALE_ja
525 IMPL_TRANSLITERATION_ITEM (NumToTextAIUFullWidth_ja_JP),
526 IMPL_TRANSLITERATION_ITEM (NumToTextAIUHalfWidth_ja_JP),
527 IMPL_TRANSLITERATION_ITEM (NumToTextIROHAFullWidth_ja_JP),
528 IMPL_TRANSLITERATION_ITEM (NumToTextIROHAHalfWidth_ja_JP),
529 #endif
530 IMPL_TRANSLITERATION_ITEM (NumToTextCircledNumber),
531 #if WITH_LOCALE_ALL || WITH_LOCALE_ko
532 IMPL_TRANSLITERATION_ITEM (NumToTextHangulJamo_ko),
533 IMPL_TRANSLITERATION_ITEM (NumToTextHangulSyllable_ko),
534 IMPL_TRANSLITERATION_ITEM (NumToTextHangulCircledJamo_ko),
535 IMPL_TRANSLITERATION_ITEM (NumToTextHangulCircledSyllable_ko),
536 #endif
537 #if WITH_LOCALE_ALL || WITH_LOCALE_zh
538 IMPL_TRANSLITERATION_ITEM (NumToTextTianGan_zh),
539 IMPL_TRANSLITERATION_ITEM (NumToTextDiZi_zh),
540 #endif
542 #if WITH_LOCALE_ALL || WITH_LOCALE_ja
543 { TRLT_SERVICELNAME_L10N,
544 TRLT_IMPLNAME_PREFIX "FULLWIDTHKATAKANA_HALFWIDTHKATAKANA",
545 &fullwidthKatakanaToHalfwidthKatakana_CreateInstance },
546 { TRLT_SERVICELNAME_L10N,
547 TRLT_IMPLNAME_PREFIX "HALFWIDTHKATAKANA_FULLWIDTHKATAKANA",
548 &halfwidthKatakanaToFullwidthKatakana_CreateInstance },
549 { TRLT_SERVICELNAME_L10N,
550 TRLT_IMPLNAME_PREFIX "FULLWIDTH_HALFWIDTH_LIKE_ASC",
551 &fullwidthToHalfwidthLikeASC_CreateInstance },
552 { TRLT_SERVICELNAME_L10N,
553 TRLT_IMPLNAME_PREFIX "HALFWIDTH_FULLWIDTH_LIKE_JIS",
554 &halfwidthToFullwidthLikeJIS_CreateInstance },
555 #endif
556 // add here new services !!
557 { nullptr, nullptr, nullptr }
561 extern "C"
564 SAL_DLLPUBLIC_EXPORT void* i18npool_component_getFactory( const sal_Char* sImplementationName, void* _pServiceManager, SAL_UNUSED_PARAMETER void* /*_pRegistryKey*/ )
566 void* pRet = nullptr;
568 lang::XMultiServiceFactory* pServiceManager =
569 static_cast< lang::XMultiServiceFactory* >( _pServiceManager );
570 uno::Reference< lang::XSingleServiceFactory > xFactory;
572 for( const InstancesArray* pArr = aInstances; pArr->pServiceNm; ++pArr )
574 if( 0 == rtl_str_compare( sImplementationName, pArr->pImplementationNm ) )
576 uno::Sequence< OUString > aServiceNames {
577 OUString::createFromAscii( pArr->pServiceNm ) };
578 xFactory = ::cppu::createSingleFactory(
579 pServiceManager,
580 OUString::createFromAscii( pArr->pImplementationNm ),
581 *pArr->pFn, aServiceNames );
582 break;
586 if ( xFactory.is() )
588 xFactory->acquire();
589 pRet = xFactory.get();
592 return pRet;
595 } // "C"
597 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */