update dev300-m58
[ooovba.git] / i18npool / inc / transliteration_commonclass.hxx
blobc75cb0f188cfa4ca632f77a125dc8ff00bb995c0
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: transliteration_commonclass.hxx,v $
10 * $Revision: 1.7 $
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 ************************************************************************/
30 #ifndef _I18N_TRANSLITERATION_TRANSLITERATION_COMMONCLASS_H_
31 #define _I18N_TRANSLITERATION_TRANSLITERATION_COMMONCLASS_H_
33 #include <com/sun/star/i18n/XExtendedTransliteration.hpp>
34 #include <com/sun/star/i18n/TransliterationType.hpp>
35 #include <cppuhelper/implbase1.hxx>
36 #include <rtl/ustrbuf.h>
37 #include <rtl/ustring.hxx>
38 #include <i18nutil/x_rtl_ustring.h>
40 namespace com { namespace sun { namespace star { namespace i18n {
42 class transliteration_commonclass : public cppu::WeakImplHelper1< com::sun::star::i18n::XExtendedTransliteration >
44 public:
45 transliteration_commonclass();
47 // Methods which are shared.
48 void SAL_CALL
49 loadModule( TransliterationModules modName, const com::sun::star::lang::Locale& rLocale )
50 throw(com::sun::star::uno::RuntimeException);
52 void SAL_CALL
53 loadModuleNew( const com::sun::star::uno::Sequence< TransliterationModulesNew >& modName, const com::sun::star::lang::Locale& rLocale )
54 throw(com::sun::star::uno::RuntimeException);
56 void SAL_CALL
57 loadModuleByImplName( const rtl::OUString& implName, const com::sun::star::lang::Locale& rLocale )
58 throw(com::sun::star::uno::RuntimeException);
60 void SAL_CALL
61 loadModulesByImplNames(const com::sun::star::uno::Sequence< rtl::OUString >& modNamelist, const com::sun::star::lang::Locale& rLocale)
62 throw(com::sun::star::uno::RuntimeException);
64 com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL
65 getAvailableModules( const com::sun::star::lang::Locale& rLocale, sal_Int16 sType )
66 throw(com::sun::star::uno::RuntimeException);
68 // Methods which should be implemented in each transliteration module.
69 virtual rtl::OUString SAL_CALL getName() throw(com::sun::star::uno::RuntimeException);
71 virtual sal_Int16 SAL_CALL getType( ) throw(com::sun::star::uno::RuntimeException) = 0;
73 virtual rtl::OUString SAL_CALL
74 transliterate( const rtl::OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, com::sun::star::uno::Sequence< sal_Int32 >& offset )
75 throw(com::sun::star::uno::RuntimeException) = 0;
77 virtual rtl::OUString SAL_CALL
78 folding( const rtl::OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, com::sun::star::uno::Sequence< sal_Int32 >& offset)
79 throw(com::sun::star::uno::RuntimeException) = 0;
81 // Methods in XExtendedTransliteration
82 virtual rtl::OUString SAL_CALL
83 transliterateString2String( const rtl::OUString& inStr, sal_Int32 startPos, sal_Int32 nCount )
84 throw(com::sun::star::uno::RuntimeException);
85 virtual rtl::OUString SAL_CALL
86 transliterateChar2String( sal_Unicode inChar)
87 throw(com::sun::star::uno::RuntimeException);
88 virtual sal_Unicode SAL_CALL
89 transliterateChar2Char( sal_Unicode inChar )
90 throw(com::sun::star::i18n::MultipleCharsOutputException,
91 com::sun::star::uno::RuntimeException) = 0;
93 virtual sal_Bool SAL_CALL
94 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 )
95 throw(com::sun::star::uno::RuntimeException) = 0;
97 virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL
98 transliterateRange( const rtl::OUString& str1, const rtl::OUString& str2 )
99 throw(com::sun::star::uno::RuntimeException) = 0;
101 virtual sal_Int32 SAL_CALL
102 compareSubstring( const rtl::OUString& s1, sal_Int32 off1, sal_Int32 len1, const rtl::OUString& s2, sal_Int32 off2, sal_Int32 len2)
103 throw(com::sun::star::uno::RuntimeException);
105 virtual sal_Int32 SAL_CALL
106 compareString( const rtl::OUString& s1, const rtl::OUString& s2)
107 throw(com::sun::star::uno::RuntimeException);
109 //XServiceInfo
110 virtual rtl::OUString SAL_CALL getImplementationName()
111 throw( com::sun::star::uno::RuntimeException );
112 virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName)
113 throw( com::sun::star::uno::RuntimeException );
114 virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames()
115 throw( com::sun::star::uno::RuntimeException );
116 protected:
117 com::sun::star::lang::Locale aLocale;
118 const sal_Char* transliterationName;
119 const sal_Char* implementationName;
120 sal_Bool useOffset;
123 } } } }
125 #endif // _I18N_TRANSLITERATION_TRANSLITERATION_COMMONCLASS_H_