1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
28 #ifndef _I18N_TRANSLITERATION_TRANSLITERATION_COMMONCLASS_H_
29 #define _I18N_TRANSLITERATION_TRANSLITERATION_COMMONCLASS_H_
31 #include <com/sun/star/i18n/XExtendedTransliteration.hpp>
32 #include <com/sun/star/i18n/TransliterationType.hpp>
33 #include <cppuhelper/implbase1.hxx>
34 #include <rtl/ustrbuf.h>
35 #include <rtl/ustring.hxx>
37 namespace com
{ namespace sun
{ namespace star
{ namespace i18n
{
39 class transliteration_commonclass
: public cppu::WeakImplHelper1
< com::sun::star::i18n::XExtendedTransliteration
>
42 transliteration_commonclass();
44 // Methods which are shared.
46 loadModule( TransliterationModules modName
, const com::sun::star::lang::Locale
& rLocale
)
47 throw(com::sun::star::uno::RuntimeException
);
50 loadModuleNew( const com::sun::star::uno::Sequence
< TransliterationModulesNew
>& modName
, const com::sun::star::lang::Locale
& rLocale
)
51 throw(com::sun::star::uno::RuntimeException
);
54 loadModuleByImplName( const rtl::OUString
& implName
, const com::sun::star::lang::Locale
& rLocale
)
55 throw(com::sun::star::uno::RuntimeException
);
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
);
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
);
114 com::sun::star::lang::Locale aLocale
;
115 const sal_Char
* transliterationName
;
116 const sal_Char
* implementationName
;
122 #endif // _I18N_TRANSLITERATION_TRANSLITERATION_COMMONCLASS_H_
124 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */