merged tag ooo/OOO330_m14
[LibreOffice.git] / i18npool / inc / transliteration_commonclass.hxx
blob57de252f1721cb6457caaf429c20297368d653f1
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
27 #ifndef _I18N_TRANSLITERATION_TRANSLITERATION_COMMONCLASS_H_
28 #define _I18N_TRANSLITERATION_TRANSLITERATION_COMMONCLASS_H_
30 #include <com/sun/star/i18n/XExtendedTransliteration.hpp>
31 #include <com/sun/star/i18n/TransliterationType.hpp>
32 #include <cppuhelper/implbase1.hxx>
33 #include <rtl/ustrbuf.h>
34 #include <rtl/ustring.hxx>
35 #include <i18nutil/x_rtl_ustring.h>
37 namespace com { namespace sun { namespace star { namespace i18n {
39 class transliteration_commonclass : public cppu::WeakImplHelper1< com::sun::star::i18n::XExtendedTransliteration >
41 public:
42 transliteration_commonclass();
44 // Methods which are shared.
45 void SAL_CALL
46 loadModule( TransliterationModules modName, const com::sun::star::lang::Locale& rLocale )
47 throw(com::sun::star::uno::RuntimeException);
49 void SAL_CALL
50 loadModuleNew( const com::sun::star::uno::Sequence< TransliterationModulesNew >& modName, const com::sun::star::lang::Locale& rLocale )
51 throw(com::sun::star::uno::RuntimeException);
53 void SAL_CALL
54 loadModuleByImplName( const rtl::OUString& implName, const com::sun::star::lang::Locale& rLocale )
55 throw(com::sun::star::uno::RuntimeException);
57 void SAL_CALL
58 loadModulesByImplNames(const com::sun::star::uno::Sequence< rtl::OUString >& modNamelist, const com::sun::star::lang::Locale& rLocale)
59 throw(com::sun::star::uno::RuntimeException);
61 com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL
62 getAvailableModules( const com::sun::star::lang::Locale& rLocale, sal_Int16 sType )
63 throw(com::sun::star::uno::RuntimeException);
65 // Methods which should be implemented in each transliteration module.
66 virtual rtl::OUString SAL_CALL getName() throw(com::sun::star::uno::RuntimeException);
68 virtual sal_Int16 SAL_CALL getType( ) throw(com::sun::star::uno::RuntimeException) = 0;
70 virtual rtl::OUString SAL_CALL
71 transliterate( const rtl::OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, com::sun::star::uno::Sequence< sal_Int32 >& offset )
72 throw(com::sun::star::uno::RuntimeException) = 0;
74 virtual rtl::OUString SAL_CALL
75 folding( const rtl::OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, com::sun::star::uno::Sequence< sal_Int32 >& offset)
76 throw(com::sun::star::uno::RuntimeException) = 0;
78 // Methods in XExtendedTransliteration
79 virtual rtl::OUString SAL_CALL
80 transliterateString2String( const rtl::OUString& inStr, sal_Int32 startPos, sal_Int32 nCount )
81 throw(com::sun::star::uno::RuntimeException);
82 virtual rtl::OUString SAL_CALL
83 transliterateChar2String( sal_Unicode inChar)
84 throw(com::sun::star::uno::RuntimeException);
85 virtual sal_Unicode SAL_CALL
86 transliterateChar2Char( sal_Unicode inChar )
87 throw(com::sun::star::i18n::MultipleCharsOutputException,
88 com::sun::star::uno::RuntimeException) = 0;
90 virtual sal_Bool SAL_CALL
91 equals( const rtl::OUString& str1, sal_Int32 pos1, sal_Int32 nCount1, sal_Int32& nMatch1, const rtl::OUString& str2, sal_Int32 pos2, sal_Int32 nCount2, sal_Int32& nMatch2 )
92 throw(com::sun::star::uno::RuntimeException) = 0;
94 virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL
95 transliterateRange( const rtl::OUString& str1, const rtl::OUString& str2 )
96 throw(com::sun::star::uno::RuntimeException) = 0;
98 virtual sal_Int32 SAL_CALL
99 compareSubstring( const rtl::OUString& s1, sal_Int32 off1, sal_Int32 len1, const rtl::OUString& s2, sal_Int32 off2, sal_Int32 len2)
100 throw(com::sun::star::uno::RuntimeException);
102 virtual sal_Int32 SAL_CALL
103 compareString( const rtl::OUString& s1, const rtl::OUString& s2)
104 throw(com::sun::star::uno::RuntimeException);
106 //XServiceInfo
107 virtual rtl::OUString SAL_CALL getImplementationName()
108 throw( com::sun::star::uno::RuntimeException );
109 virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName)
110 throw( com::sun::star::uno::RuntimeException );
111 virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames()
112 throw( com::sun::star::uno::RuntimeException );
113 protected:
114 com::sun::star::lang::Locale aLocale;
115 const sal_Char* transliterationName;
116 const sal_Char* implementationName;
117 sal_Bool useOffset;
120 } } } }
122 #endif // _I18N_TRANSLITERATION_TRANSLITERATION_COMMONCLASS_H_