Update ooo320-m1
[ooovba.git] / i18npool / source / registerservices / registerservices.cxx
blob29c4def38641f07921bf3e70f52b4c7c5d3e493b
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: registerservices.cxx,v $
10 * $Revision: 1.44.16.2 $
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 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_i18npool.hxx"
33 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
34 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
35 #include <com/sun/star/registry/XRegistryKey.hpp>
37 #include <cppuhelper/factory.hxx>
38 #include <cppuhelper/weak.hxx>
39 #include <osl/mutex.hxx>
41 #include <localedata.hxx>
42 #include <numberformatcode.hxx>
43 #include <nativenumbersupplier.hxx>
44 #include <defaultnumberingprovider.hxx>
45 #include <servicename.hxx>
47 #define TRANSLITERATION_ALL
48 #include <transliterationImpl.hxx>
49 #include <transliteration_body.hxx>
50 #include <transliteration_caseignore.hxx>
51 #include <transliteration_Ignore.hxx>
52 #include <transliteration_OneToOne.hxx>
53 #include <textToPronounce_zh.hxx>
54 #include <numtotext_cjk.hxx>
55 #include <numtochar.hxx>
56 #include <texttonum.hxx>
57 #include <chartonum.hxx>
59 #include <calendarImpl.hxx>
60 #include <calendar_gregorian.hxx>
61 #include <calendar_hijri.hxx>
62 #include <calendar_jewish.hxx>
64 #define BREAKITERATOR_ALL
65 #include <breakiteratorImpl.hxx>
66 #include <breakiterator_cjk.hxx>
67 #include <breakiterator_th.hxx>
68 #include <breakiterator_unicode.hxx>
70 #include <indexentrysupplier.hxx>
71 #include <indexentrysupplier_asian.hxx>
72 #include <indexentrysupplier_ja_phonetic.hxx>
73 #include <indexentrysupplier_common.hxx>
74 #include <indexentrysupplier_default.hxx>
76 #define CCLASS_ALL
77 #include <characterclassificationImpl.hxx>
78 #include <scripttypedetector.hxx>
79 #include <cclass_unicode.hxx>
81 #define COLLATOR_ALL
82 #include <collatorImpl.hxx>
83 #include <chaptercollator.hxx>
84 #include <collator_unicode.hxx>
86 #include <inputsequencechecker.hxx>
87 #include <inputsequencechecker_th.hxx>
88 #include <inputsequencechecker_hi.hxx>
90 #include <textconversionImpl.hxx>
91 #include <textconversion.hxx>
93 #include <ordinalsuffix.hxx>
95 #define IMPL_CREATEINSTANCE( ImplName ) \
96 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > \
97 SAL_CALL ImplName##_CreateInstance( \
98 const ::com::sun::star::uno::Reference< \
99 ::com::sun::star::lang::XMultiServiceFactory >& ) \
101 return ::com::sun::star::uno::Reference < \
102 ::com::sun::star::uno::XInterface >( ( ::cppu::OWeakObject* ) \
103 new ImplName ); \
106 #define IMPL_CREATEINSTANCE_MSF( ImplName ) \
107 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > \
108 SAL_CALL ImplName##_CreateInstance( \
109 const ::com::sun::star::uno::Reference< \
110 ::com::sun::star::lang::XMultiServiceFactory >& rxMSF ) \
112 return ::com::sun::star::uno::Reference < \
113 ::com::sun::star::uno::XInterface >( ( ::cppu::OWeakObject* ) \
114 new ImplName( rxMSF ) ); \
117 typedef ::com::sun::star::uno::Reference<
118 ::com::sun::star::uno::XInterface > (SAL_CALL *FN_CreateInstance)(
119 const ::com::sun::star::uno::Reference<
120 ::com::sun::star::lang::XMultiServiceFactory >& );
122 #define IMPL_TRANSLITERATION_ITEM( implName ) \
123 { TRLT_SERVICELNAME_L10N, \
124 TRLT_IMPLNAME_PREFIX #implName, \
125 &implName##_CreateInstance }
127 // -------------------------------------------------------------------------------------
129 using namespace ::com::sun::star::i18n;
131 IMPL_CREATEINSTANCE_MSF( NumberFormatCodeMapper )
132 IMPL_CREATEINSTANCE( NativeNumberSupplier )
133 IMPL_CREATEINSTANCE( LocaleData )
134 IMPL_CREATEINSTANCE_MSF( DefaultNumberingProvider )
135 IMPL_CREATEINSTANCE_MSF( IndexEntrySupplier )
136 IMPL_CREATEINSTANCE_MSF( IndexEntrySupplier_asian )
137 IMPL_CREATEINSTANCE_MSF( IndexEntrySupplier_ja_phonetic_alphanumeric_first_by_syllable )
138 IMPL_CREATEINSTANCE_MSF( IndexEntrySupplier_ja_phonetic_alphanumeric_first_by_consonant )
139 IMPL_CREATEINSTANCE_MSF( IndexEntrySupplier_ja_phonetic_alphanumeric_last_by_syllable )
140 IMPL_CREATEINSTANCE_MSF( IndexEntrySupplier_ja_phonetic_alphanumeric_last_by_consonant )
141 IMPL_CREATEINSTANCE_MSF( IndexEntrySupplier_Unicode )
142 IMPL_CREATEINSTANCE_MSF( CalendarImpl )
143 IMPL_CREATEINSTANCE( Calendar_gregorian )
144 IMPL_CREATEINSTANCE( Calendar_hanja )
145 IMPL_CREATEINSTANCE( Calendar_gengou )
146 IMPL_CREATEINSTANCE( Calendar_ROC )
147 IMPL_CREATEINSTANCE( Calendar_hijri )
148 IMPL_CREATEINSTANCE( Calendar_jewish )
149 IMPL_CREATEINSTANCE( Calendar_buddhist )
150 IMPL_CREATEINSTANCE_MSF( BreakIteratorImpl )
151 IMPL_CREATEINSTANCE( BreakIterator_Unicode )
152 IMPL_CREATEINSTANCE( BreakIterator_ja )
153 IMPL_CREATEINSTANCE( BreakIterator_zh )
154 IMPL_CREATEINSTANCE( BreakIterator_zh_TW )
155 IMPL_CREATEINSTANCE( BreakIterator_ko )
156 IMPL_CREATEINSTANCE( BreakIterator_th )
157 IMPL_CREATEINSTANCE_MSF( ChapterCollator )
158 IMPL_CREATEINSTANCE_MSF( CollatorImpl )
159 IMPL_CREATEINSTANCE( Collator_Unicode )
161 IMPL_CREATEINSTANCE_MSF( CharacterClassificationImpl )
162 IMPL_CREATEINSTANCE_MSF( cclass_Unicode )
163 IMPL_CREATEINSTANCE_MSF( TransliterationImpl )
164 IMPL_CREATEINSTANCE( ScriptTypeDetector )
166 IMPL_CREATEINSTANCE_MSF( InputSequenceCheckerImpl )
167 IMPL_CREATEINSTANCE( InputSequenceChecker_th )
168 IMPL_CREATEINSTANCE( InputSequenceChecker_hi )
170 IMPL_CREATEINSTANCE_MSF( TextConversionImpl )
171 IMPL_CREATEINSTANCE_MSF( TextConversion_ko )
172 IMPL_CREATEINSTANCE_MSF( TextConversion_zh )
174 IMPL_CREATEINSTANCE( Transliteration_u2l )
175 IMPL_CREATEINSTANCE( Transliteration_l2u )
176 IMPL_CREATEINSTANCE( Transliteration_caseignore )
177 IMPL_CREATEINSTANCE( hiraganaToKatakana )
178 IMPL_CREATEINSTANCE( katakanaToHiragana )
179 IMPL_CREATEINSTANCE( ignoreKana )
180 IMPL_CREATEINSTANCE( fullwidthToHalfwidth )
181 IMPL_CREATEINSTANCE( halfwidthToFullwidth )
182 IMPL_CREATEINSTANCE( ignoreWidth )
184 IMPL_CREATEINSTANCE( smallToLarge_ja_JP)
185 IMPL_CREATEINSTANCE( largeToSmall_ja_JP)
186 IMPL_CREATEINSTANCE( ignoreTraditionalKanji_ja_JP)
187 IMPL_CREATEINSTANCE( ignoreTraditionalKana_ja_JP)
188 IMPL_CREATEINSTANCE( ignoreMinusSign_ja_JP)
189 IMPL_CREATEINSTANCE( ignoreIterationMark_ja_JP)
190 IMPL_CREATEINSTANCE( ignoreSeparator_ja_JP)
191 IMPL_CREATEINSTANCE( ignoreZiZu_ja_JP)
192 IMPL_CREATEINSTANCE( ignoreBaFa_ja_JP)
193 IMPL_CREATEINSTANCE( ignoreTiJi_ja_JP)
194 IMPL_CREATEINSTANCE( ignoreHyuByu_ja_JP)
195 IMPL_CREATEINSTANCE( ignoreSeZe_ja_JP)
196 IMPL_CREATEINSTANCE( ignoreIandEfollowedByYa_ja_JP)
197 IMPL_CREATEINSTANCE( ignoreKiKuFollowedBySa_ja_JP)
198 IMPL_CREATEINSTANCE( ignoreSize_ja_JP)
199 IMPL_CREATEINSTANCE( ignoreProlongedSoundMark_ja_JP)
200 IMPL_CREATEINSTANCE( ignoreMiddleDot_ja_JP)
201 IMPL_CREATEINSTANCE( ignoreSpace_ja_JP)
203 IMPL_CREATEINSTANCE( TextToChuyin_zh_TW )
204 IMPL_CREATEINSTANCE( TextToPinyin_zh_CN )
206 IMPL_CREATEINSTANCE( NumToCharLower_zh_CN )
207 IMPL_CREATEINSTANCE( NumToCharUpper_zh_CN )
208 IMPL_CREATEINSTANCE( NumToCharLower_zh_TW )
209 IMPL_CREATEINSTANCE( NumToCharUpper_zh_TW )
210 IMPL_CREATEINSTANCE( NumToCharHalfwidth )
211 IMPL_CREATEINSTANCE( NumToCharFullwidth )
212 IMPL_CREATEINSTANCE( NumToCharKanjiShort_ja_JP )
213 IMPL_CREATEINSTANCE( NumToCharKanjiTraditional_ja_JP )
214 IMPL_CREATEINSTANCE( NumToCharHangul_ko )
215 IMPL_CREATEINSTANCE( NumToCharLower_ko )
216 IMPL_CREATEINSTANCE( NumToCharUpper_ko )
217 IMPL_CREATEINSTANCE( NumToCharIndic_ar )
218 IMPL_CREATEINSTANCE( NumToCharEastIndic_ar )
219 IMPL_CREATEINSTANCE( NumToCharIndic_hi )
220 IMPL_CREATEINSTANCE( NumToChar_th )
222 IMPL_CREATEINSTANCE( CharToNumLower_zh_CN )
223 IMPL_CREATEINSTANCE( CharToNumUpper_zh_CN )
224 IMPL_CREATEINSTANCE( CharToNumLower_zh_TW )
225 IMPL_CREATEINSTANCE( CharToNumUpper_zh_TW )
226 IMPL_CREATEINSTANCE( CharToNumFullwidth )
227 IMPL_CREATEINSTANCE( CharToNumKanjiShort_ja_JP )
228 IMPL_CREATEINSTANCE( CharToNumKanjiTraditional_ja_JP )
229 IMPL_CREATEINSTANCE( CharToNumHangul_ko )
230 IMPL_CREATEINSTANCE( CharToNumLower_ko )
231 IMPL_CREATEINSTANCE( CharToNumUpper_ko )
232 IMPL_CREATEINSTANCE( CharToNumIndic_ar )
233 IMPL_CREATEINSTANCE( CharToNumEastIndic_ar )
234 IMPL_CREATEINSTANCE( CharToNumIndic_hi )
235 IMPL_CREATEINSTANCE( CharToNum_th )
237 IMPL_CREATEINSTANCE( NumToTextLower_zh_CN )
238 IMPL_CREATEINSTANCE( NumToTextUpper_zh_CN )
239 IMPL_CREATEINSTANCE( NumToTextLower_zh_TW )
240 IMPL_CREATEINSTANCE( NumToTextUpper_zh_TW )
241 IMPL_CREATEINSTANCE( NumToTextFullwidth_zh_CN )
242 IMPL_CREATEINSTANCE( NumToTextFullwidth_zh_TW )
243 IMPL_CREATEINSTANCE( NumToTextFullwidth_ja_JP )
244 IMPL_CREATEINSTANCE( NumToTextFullwidth_ko )
245 IMPL_CREATEINSTANCE( NumToTextKanjiLongModern_ja_JP )
246 IMPL_CREATEINSTANCE( NumToTextKanjiLongTraditional_ja_JP )
247 IMPL_CREATEINSTANCE( NumToTextKanjiShortModern_ja_JP )
248 IMPL_CREATEINSTANCE( NumToTextKanjiShortTraditional_ja_JP )
249 IMPL_CREATEINSTANCE( NumToTextFormalHangul_ko )
250 IMPL_CREATEINSTANCE( NumToTextFormalLower_ko )
251 IMPL_CREATEINSTANCE( NumToTextFormalUpper_ko )
252 IMPL_CREATEINSTANCE( NumToTextInformalHangul_ko )
253 IMPL_CREATEINSTANCE( NumToTextInformalUpper_ko )
254 IMPL_CREATEINSTANCE( NumToTextInformalLower_ko )
256 IMPL_CREATEINSTANCE( TextToNumLower_zh_CN )
257 IMPL_CREATEINSTANCE( TextToNumUpper_zh_CN )
258 IMPL_CREATEINSTANCE( TextToNumLower_zh_TW )
259 IMPL_CREATEINSTANCE( TextToNumUpper_zh_TW )
260 IMPL_CREATEINSTANCE( TextToNumKanjiLongModern_ja_JP )
261 IMPL_CREATEINSTANCE( TextToNumKanjiLongTraditional_ja_JP )
262 IMPL_CREATEINSTANCE( TextToNumFormalHangul_ko )
263 IMPL_CREATEINSTANCE( TextToNumFormalLower_ko )
264 IMPL_CREATEINSTANCE( TextToNumFormalUpper_ko )
265 IMPL_CREATEINSTANCE( TextToNumInformalHangul_ko )
266 IMPL_CREATEINSTANCE( TextToNumInformalUpper_ko )
267 IMPL_CREATEINSTANCE( TextToNumInformalLower_ko )
269 IMPL_CREATEINSTANCE( NumToTextDate_zh )
270 IMPL_CREATEINSTANCE( NumToTextAIUFullWidth_ja_JP )
271 IMPL_CREATEINSTANCE( NumToTextAIUHalfWidth_ja_JP )
272 IMPL_CREATEINSTANCE( NumToTextIROHAFullWidth_ja_JP )
273 IMPL_CREATEINSTANCE( NumToTextIROHAHalfWidth_ja_JP )
274 IMPL_CREATEINSTANCE( NumToTextCircledNumber )
275 IMPL_CREATEINSTANCE( NumToTextHangulJamo_ko )
276 IMPL_CREATEINSTANCE( NumToTextHangulSyllable_ko )
277 IMPL_CREATEINSTANCE( NumToTextHangulCircledJamo_ko )
278 IMPL_CREATEINSTANCE( NumToTextHangulCircledSyllable_ko )
279 IMPL_CREATEINSTANCE( NumToTextTianGan_zh )
280 IMPL_CREATEINSTANCE( NumToTextDiZi_zh )
282 IMPL_CREATEINSTANCE( fullwidthKatakanaToHalfwidthKatakana )
283 IMPL_CREATEINSTANCE( halfwidthKatakanaToFullwidthKatakana )
284 IMPL_CREATEINSTANCE( fullwidthToHalfwidthLikeASC )
285 IMPL_CREATEINSTANCE( halfwidthToFullwidthLikeJIS )
287 IMPL_CREATEINSTANCE_MSF( OrdinalSuffix )
289 static const struct InstancesArray {
290 const sal_Char* pServiceNm;
291 const sal_Char* pImplementationNm;
292 FN_CreateInstance pFn;
293 } aInstances[] = {
294 { "com.sun.star.i18n.LocaleData",
295 "com.sun.star.i18n.LocaleData",
296 & LocaleData_CreateInstance },
297 { "com.sun.star.i18n.NumberFormatMapper",
298 "com.sun.star.i18n.NumberFormatCodeMapper",
299 & NumberFormatCodeMapper_CreateInstance },
300 { "com.sun.star.i18n.NativeNumberSupplier",
301 "com.sun.star.i18n.NativeNumberSupplier",
302 & NativeNumberSupplier_CreateInstance },
303 { "com.sun.star.text.DefaultNumberingProvider",
304 "com.sun.star.text.DefaultNumberingProvider",
305 &DefaultNumberingProvider_CreateInstance },
306 { "com.sun.star.i18n.IndexEntrySupplier",
307 "com.sun.star.i18n.IndexEntrySupplier",
308 &IndexEntrySupplier_CreateInstance },
309 { "com.sun.star.i18n.IndexEntrySupplier_asian",
310 "com.sun.star.i18n.IndexEntrySupplier_asian",
311 &IndexEntrySupplier_asian_CreateInstance },
312 { "com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric first)",
313 "com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric first)",
314 &IndexEntrySupplier_ja_phonetic_alphanumeric_first_by_syllable_CreateInstance },
315 { "com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric last)",
316 "com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric last)",
317 &IndexEntrySupplier_ja_phonetic_alphanumeric_last_by_syllable_CreateInstance },
318 { "com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric first) (grouped by syllable)",
319 "com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric first) (grouped by syllable)",
320 &IndexEntrySupplier_ja_phonetic_alphanumeric_first_by_syllable_CreateInstance },
321 { "com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric first) (grouped by consonant)",
322 "com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric first) (grouped by consonant)",
323 &IndexEntrySupplier_ja_phonetic_alphanumeric_first_by_consonant_CreateInstance },
324 { "com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric last) (grouped by syllable)",
325 "com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric last) (grouped by syllable)",
326 &IndexEntrySupplier_ja_phonetic_alphanumeric_last_by_syllable_CreateInstance },
327 { "com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric last) (grouped by consonant)",
328 "com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric last) (grouped by consonant)",
329 &IndexEntrySupplier_ja_phonetic_alphanumeric_last_by_consonant_CreateInstance },
330 { "com.sun.star.i18n.IndexEntrySupplier_Unicode",
331 "com.sun.star.i18n.IndexEntrySupplier_Unicode",
332 &IndexEntrySupplier_Unicode_CreateInstance },
333 { "com.sun.star.i18n.LocaleCalendar",
334 "com.sun.star.i18n.CalendarImpl",
335 &CalendarImpl_CreateInstance },
336 { "com.sun.star.i18n.Calendar_gregorian",
337 "com.sun.star.i18n.Calendar_gregorian",
338 &Calendar_gregorian_CreateInstance },
339 { "com.sun.star.i18n.Calendar_gengou",
340 "com.sun.star.i18n.Calendar_gengou",
341 &Calendar_gengou_CreateInstance },
342 { "com.sun.star.i18n.Calendar_ROC",
343 "com.sun.star.i18n.Calendar_ROC",
344 &Calendar_ROC_CreateInstance },
345 { "com.sun.star.i18n.Calendar_hanja_yoil",
346 "com.sun.star.i18n.Calendar_hanja_yoil",
347 &Calendar_hanja_CreateInstance },
348 { "com.sun.star.i18n.Calendar_hanja",
349 "com.sun.star.i18n.Calendar_hanja",
350 &Calendar_hanja_CreateInstance },
351 { "com.sun.star.i18n.Calendar_hijri",
352 "com.sun.star.i18n.Calendar_hijri",
353 &Calendar_hijri_CreateInstance },
354 { "com.sun.star.i18n.Calendar_jewish",
355 "com.sun.star.i18n.Calendar_jewish",
356 &Calendar_jewish_CreateInstance },
357 { "com.sun.star.i18n.Calendar_buddhist",
358 "com.sun.star.i18n.Calendar_buddhist",
359 &Calendar_buddhist_CreateInstance },
360 { "com.sun.star.i18n.BreakIterator",
361 "com.sun.star.i18n.BreakIterator",
362 &BreakIteratorImpl_CreateInstance },
363 { "com.sun.star.i18n.BreakIterator_Unicode",
364 "com.sun.star.i18n.BreakIterator_Unicode",
365 &BreakIterator_Unicode_CreateInstance },
366 { "com.sun.star.i18n.BreakIterator_ja",
367 "com.sun.star.i18n.BreakIterator_ja",
368 &BreakIterator_ja_CreateInstance },
369 { "com.sun.star.i18n.BreakIterator_zh",
370 "com.sun.star.i18n.BreakIterator_zh",
371 &BreakIterator_zh_CreateInstance },
372 { "com.sun.star.i18n.BreakIterator_zh_TW",
373 "com.sun.star.i18n.BreakIterator_zh_TW",
374 &BreakIterator_zh_TW_CreateInstance },
375 { "com.sun.star.i18n.BreakIterator_ko",
376 "com.sun.star.i18n.BreakIterator_ko",
377 &BreakIterator_ko_CreateInstance },
378 { "com.sun.star.i18n.BreakIterator_th",
379 "com.sun.star.i18n.BreakIterator_th",
380 &BreakIterator_th_CreateInstance },
381 { "com.sun.star.i18n.Collator",
382 "com.sun.star.i18n.Collator",
383 &CollatorImpl_CreateInstance },
384 { "com.sun.star.i18n.ChapterCollator",
385 "com.sun.star.i18n.ChapterCollator",
386 &ChapterCollator_CreateInstance },
387 { "com.sun.star.i18n.Collator_Unicode",
388 "com.sun.star.i18n.Collator_Unicode",
389 &Collator_Unicode_CreateInstance },
390 { "com.sun.star.i18n.ScriptTypeDetector",
391 "com.sun.star.i18n.ScriptTypeDetector",
392 &ScriptTypeDetector_CreateInstance },
393 { "com.sun.star.i18n.CharacterClassification",
394 "com.sun.star.i18n.CharacterClassification",
395 &CharacterClassificationImpl_CreateInstance },
396 { "com.sun.star.i18n.CharacterClassification_Unicode",
397 "com.sun.star.i18n.CharacterClassification_Unicode",
398 &cclass_Unicode_CreateInstance },
399 { "com.sun.star.i18n.InputSequenceChecker",
400 "com.sun.star.i18n.InputSequenceChecker",
401 &InputSequenceCheckerImpl_CreateInstance },
402 { "com.sun.star.i18n.InputSequenceChecker_th",
403 "com.sun.star.i18n.InputSequenceChecker_th",
404 &InputSequenceChecker_th_CreateInstance },
405 { "com.sun.star.i18n.InputSequenceChecker_hi",
406 "com.sun.star.i18n.InputSequenceChecker_hi",
407 &InputSequenceChecker_hi_CreateInstance },
408 { "com.sun.star.i18n.TextConversion",
409 "com.sun.star.i18n.TextConversion",
410 &TextConversionImpl_CreateInstance },
411 { "com.sun.star.i18n.TextConversion_ko",
412 "com.sun.star.i18n.TextConversion_ko",
413 &TextConversion_ko_CreateInstance },
414 { "com.sun.star.i18n.TextConversion_zh",
415 "com.sun.star.i18n.TextConversion_zh",
416 &TextConversion_zh_CreateInstance },
417 { TRLT_SERVICELNAME,
418 TRLT_IMPLNAME ,
419 &TransliterationImpl_CreateInstance },
420 { TRLT_SERVICELNAME_L10N,
421 TRLT_IMPLNAME_PREFIX "UPPERCASE_LOWERCASE",
422 &Transliteration_u2l_CreateInstance },
423 { TRLT_SERVICELNAME_L10N,
424 TRLT_IMPLNAME_PREFIX "LOWERCASE_UPPERCASE",
425 &Transliteration_l2u_CreateInstance },
426 { TRLT_SERVICELNAME_L10N,
427 TRLT_IMPLNAME_PREFIX "IGNORE_CASE",
428 &Transliteration_caseignore_CreateInstance },
429 { TRLT_SERVICELNAME_L10N,
430 TRLT_IMPLNAME_PREFIX "HIRAGANA_KATAKANA",
431 &hiraganaToKatakana_CreateInstance },
432 { TRLT_SERVICELNAME_L10N,
433 TRLT_IMPLNAME_PREFIX "KATAKANA_HIRAGANA",
434 &katakanaToHiragana_CreateInstance },
435 { TRLT_SERVICELNAME_L10N,
436 TRLT_IMPLNAME_PREFIX "IGNORE_KANA",
437 &ignoreKana_CreateInstance },
438 { TRLT_SERVICELNAME_L10N,
439 TRLT_IMPLNAME_PREFIX "FULLWIDTH_HALFWIDTH",
440 &fullwidthToHalfwidth_CreateInstance },
441 { TRLT_SERVICELNAME_L10N,
442 TRLT_IMPLNAME_PREFIX "HALFWIDTH_FULLWIDTH",
443 &halfwidthToFullwidth_CreateInstance },
444 { TRLT_SERVICELNAME_L10N,
445 TRLT_IMPLNAME_PREFIX "IGNORE_WIDTH",
446 &ignoreWidth_CreateInstance },
447 IMPL_TRANSLITERATION_ITEM (smallToLarge_ja_JP),
448 IMPL_TRANSLITERATION_ITEM (largeToSmall_ja_JP),
449 IMPL_TRANSLITERATION_ITEM (ignoreTraditionalKanji_ja_JP),
450 IMPL_TRANSLITERATION_ITEM (ignoreTraditionalKana_ja_JP),
451 IMPL_TRANSLITERATION_ITEM (ignoreKana),
452 IMPL_TRANSLITERATION_ITEM (ignoreMinusSign_ja_JP),
453 IMPL_TRANSLITERATION_ITEM (ignoreIterationMark_ja_JP),
454 IMPL_TRANSLITERATION_ITEM (ignoreSeparator_ja_JP),
455 IMPL_TRANSLITERATION_ITEM (ignoreZiZu_ja_JP),
456 IMPL_TRANSLITERATION_ITEM (ignoreBaFa_ja_JP),
457 IMPL_TRANSLITERATION_ITEM (ignoreTiJi_ja_JP),
458 IMPL_TRANSLITERATION_ITEM (ignoreHyuByu_ja_JP),
459 IMPL_TRANSLITERATION_ITEM (ignoreSeZe_ja_JP),
460 IMPL_TRANSLITERATION_ITEM (ignoreIandEfollowedByYa_ja_JP),
461 IMPL_TRANSLITERATION_ITEM (ignoreKiKuFollowedBySa_ja_JP),
462 IMPL_TRANSLITERATION_ITEM (ignoreSize_ja_JP),
463 IMPL_TRANSLITERATION_ITEM (ignoreProlongedSoundMark_ja_JP),
464 IMPL_TRANSLITERATION_ITEM (ignoreMiddleDot_ja_JP),
465 IMPL_TRANSLITERATION_ITEM (ignoreSpace_ja_JP),
466 IMPL_TRANSLITERATION_ITEM (TextToPinyin_zh_CN),
467 IMPL_TRANSLITERATION_ITEM (TextToChuyin_zh_TW),
469 IMPL_TRANSLITERATION_ITEM (NumToCharUpper_zh_CN),
470 IMPL_TRANSLITERATION_ITEM (NumToCharLower_zh_CN),
471 IMPL_TRANSLITERATION_ITEM (NumToCharUpper_zh_TW),
472 IMPL_TRANSLITERATION_ITEM (NumToCharLower_zh_TW),
473 IMPL_TRANSLITERATION_ITEM (NumToCharHalfwidth),
474 IMPL_TRANSLITERATION_ITEM (NumToCharFullwidth),
475 IMPL_TRANSLITERATION_ITEM (NumToCharKanjiShort_ja_JP),
476 IMPL_TRANSLITERATION_ITEM (NumToCharKanjiTraditional_ja_JP),
477 IMPL_TRANSLITERATION_ITEM (NumToCharLower_ko),
478 IMPL_TRANSLITERATION_ITEM (NumToCharUpper_ko),
479 IMPL_TRANSLITERATION_ITEM (NumToCharHangul_ko),
480 IMPL_TRANSLITERATION_ITEM (NumToCharIndic_ar),
481 IMPL_TRANSLITERATION_ITEM (NumToCharEastIndic_ar),
482 IMPL_TRANSLITERATION_ITEM (NumToCharIndic_hi),
483 IMPL_TRANSLITERATION_ITEM (NumToChar_th),
485 IMPL_TRANSLITERATION_ITEM (CharToNumUpper_zh_CN),
486 IMPL_TRANSLITERATION_ITEM (CharToNumLower_zh_CN),
487 IMPL_TRANSLITERATION_ITEM (CharToNumUpper_zh_TW),
488 IMPL_TRANSLITERATION_ITEM (CharToNumLower_zh_TW),
489 IMPL_TRANSLITERATION_ITEM (CharToNumFullwidth),
490 IMPL_TRANSLITERATION_ITEM (CharToNumKanjiShort_ja_JP),
491 IMPL_TRANSLITERATION_ITEM (CharToNumKanjiTraditional_ja_JP),
492 IMPL_TRANSLITERATION_ITEM (CharToNumLower_ko),
493 IMPL_TRANSLITERATION_ITEM (CharToNumUpper_ko),
494 IMPL_TRANSLITERATION_ITEM (CharToNumHangul_ko),
495 IMPL_TRANSLITERATION_ITEM (CharToNumIndic_ar),
496 IMPL_TRANSLITERATION_ITEM (CharToNumEastIndic_ar),
497 IMPL_TRANSLITERATION_ITEM (CharToNumIndic_hi),
498 IMPL_TRANSLITERATION_ITEM (CharToNum_th),
500 IMPL_TRANSLITERATION_ITEM (NumToTextUpper_zh_CN),
501 IMPL_TRANSLITERATION_ITEM (NumToTextLower_zh_CN),
502 IMPL_TRANSLITERATION_ITEM (NumToTextUpper_zh_TW),
503 IMPL_TRANSLITERATION_ITEM (NumToTextLower_zh_TW),
504 IMPL_TRANSLITERATION_ITEM (NumToTextFullwidth_zh_CN),
505 IMPL_TRANSLITERATION_ITEM (NumToTextFullwidth_zh_TW),
506 IMPL_TRANSLITERATION_ITEM (NumToTextFullwidth_ja_JP),
507 IMPL_TRANSLITERATION_ITEM (NumToTextFullwidth_ko),
508 IMPL_TRANSLITERATION_ITEM (NumToTextKanjiLongModern_ja_JP),
509 IMPL_TRANSLITERATION_ITEM (NumToTextKanjiLongTraditional_ja_JP),
510 IMPL_TRANSLITERATION_ITEM (NumToTextKanjiShortModern_ja_JP),
511 IMPL_TRANSLITERATION_ITEM (NumToTextKanjiShortTraditional_ja_JP),
512 IMPL_TRANSLITERATION_ITEM (NumToTextInformalHangul_ko),
513 IMPL_TRANSLITERATION_ITEM (NumToTextInformalLower_ko),
514 IMPL_TRANSLITERATION_ITEM (NumToTextInformalUpper_ko),
515 IMPL_TRANSLITERATION_ITEM (NumToTextFormalHangul_ko),
516 IMPL_TRANSLITERATION_ITEM (NumToTextFormalLower_ko),
517 IMPL_TRANSLITERATION_ITEM (NumToTextFormalUpper_ko),
519 IMPL_TRANSLITERATION_ITEM (TextToNumUpper_zh_CN),
520 IMPL_TRANSLITERATION_ITEM (TextToNumLower_zh_CN),
521 IMPL_TRANSLITERATION_ITEM (TextToNumUpper_zh_TW),
522 IMPL_TRANSLITERATION_ITEM (TextToNumLower_zh_TW),
523 IMPL_TRANSLITERATION_ITEM (TextToNumKanjiLongModern_ja_JP),
524 IMPL_TRANSLITERATION_ITEM (TextToNumKanjiLongTraditional_ja_JP),
525 IMPL_TRANSLITERATION_ITEM (TextToNumInformalHangul_ko),
526 IMPL_TRANSLITERATION_ITEM (TextToNumInformalLower_ko),
527 IMPL_TRANSLITERATION_ITEM (TextToNumInformalUpper_ko),
528 IMPL_TRANSLITERATION_ITEM (TextToNumFormalHangul_ko),
529 IMPL_TRANSLITERATION_ITEM (TextToNumFormalLower_ko),
530 IMPL_TRANSLITERATION_ITEM (TextToNumFormalUpper_ko),
532 IMPL_TRANSLITERATION_ITEM (NumToTextDate_zh),
533 IMPL_TRANSLITERATION_ITEM (NumToTextAIUFullWidth_ja_JP),
534 IMPL_TRANSLITERATION_ITEM (NumToTextAIUHalfWidth_ja_JP),
535 IMPL_TRANSLITERATION_ITEM (NumToTextIROHAFullWidth_ja_JP),
536 IMPL_TRANSLITERATION_ITEM (NumToTextIROHAHalfWidth_ja_JP),
537 IMPL_TRANSLITERATION_ITEM (NumToTextCircledNumber),
538 IMPL_TRANSLITERATION_ITEM (NumToTextHangulJamo_ko),
539 IMPL_TRANSLITERATION_ITEM (NumToTextHangulSyllable_ko),
540 IMPL_TRANSLITERATION_ITEM (NumToTextHangulCircledJamo_ko),
541 IMPL_TRANSLITERATION_ITEM (NumToTextHangulCircledSyllable_ko),
542 IMPL_TRANSLITERATION_ITEM (NumToTextTianGan_zh),
543 IMPL_TRANSLITERATION_ITEM (NumToTextDiZi_zh),
545 { "com.sun.star.i18n.OrdinalSuffix",
546 "com.sun.star.i18n.OrdinalSuffix",
547 & OrdinalSuffix_CreateInstance },
549 { TRLT_SERVICELNAME_L10N,
550 TRLT_IMPLNAME_PREFIX "FULLWIDTHKATAKANA_HALFWIDTHKATAKANA",
551 &fullwidthKatakanaToHalfwidthKatakana_CreateInstance },
552 { TRLT_SERVICELNAME_L10N,
553 TRLT_IMPLNAME_PREFIX "HALFWIDTHKATAKANA_FULLWIDTHKATAKANA",
554 &halfwidthKatakanaToFullwidthKatakana_CreateInstance },
555 { TRLT_SERVICELNAME_L10N,
556 TRLT_IMPLNAME_PREFIX "FULLWIDTH_HALFWIDTH_LIKE_ASC",
557 &fullwidthToHalfwidthLikeASC_CreateInstance },
558 { TRLT_SERVICELNAME_L10N,
559 TRLT_IMPLNAME_PREFIX "HALFWIDTH_FULLWIDTH_LIKE_JIS",
560 &halfwidthToFullwidthLikeJIS_CreateInstance },
561 // add here new services !!
562 { 0, 0, 0 }
566 extern "C"
569 void SAL_CALL component_getImplementationEnvironment( const sal_Char** ppEnvTypeName, uno_Environment** /*ppEnv*/ )
571 *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
574 sal_Bool SAL_CALL component_writeInfo( void* /*_pServiceManager*/, void* _pRegistryKey )
576 if (_pRegistryKey)
578 ::com::sun::star::registry::XRegistryKey * pRegistryKey =
579 reinterpret_cast< ::com::sun::star::registry::XRegistryKey* >(
580 _pRegistryKey );
581 ::com::sun::star::uno::Reference<
582 ::com::sun::star::registry::XRegistryKey > xNewKey;
584 for( const InstancesArray* pArr = aInstances; pArr->pServiceNm; ++pArr )
586 xNewKey = pRegistryKey->createKey(
587 ::rtl::OUString::createFromAscii( pArr->pImplementationNm ) );
588 xNewKey = xNewKey->createKey(
589 ::rtl::OUString::createFromAscii( "/UNO/SERVICES" ) );
590 xNewKey->createKey(
591 ::rtl::OUString::createFromAscii( pArr->pServiceNm ) );
594 return sal_True;
597 void* SAL_CALL component_getFactory( const sal_Char* sImplementationName, void* _pServiceManager, void* /*_pRegistryKey*/ )
599 void* pRet = NULL;
601 ::com::sun::star::lang::XMultiServiceFactory* pServiceManager =
602 reinterpret_cast< ::com::sun::star::lang::XMultiServiceFactory* >
603 ( _pServiceManager );
604 ::com::sun::star::uno::Reference<
605 ::com::sun::star::lang::XSingleServiceFactory > xFactory;
607 for( const InstancesArray* pArr = aInstances; pArr->pServiceNm; ++pArr )
609 if( 0 == rtl_str_compare( sImplementationName, pArr->pImplementationNm ) )
611 ::com::sun::star::uno::Sequence< ::rtl::OUString > aServiceNames(1);
612 aServiceNames.getArray()[0] =
613 ::rtl::OUString::createFromAscii( pArr->pServiceNm );
614 xFactory = ::cppu::createSingleFactory(
615 pServiceManager, aServiceNames.getArray()[0],
616 *pArr->pFn, aServiceNames );
617 break;
621 if ( xFactory.is() )
623 xFactory->acquire();
624 pRet = xFactory.get();
627 return pRet;
630 } // "C"