1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
19 #ifndef _I18N_TRANSLITERATION_TRANSLITERATION_COMMONCLASS_H_
20 #define _I18N_TRANSLITERATION_TRANSLITERATION_COMMONCLASS_H_
22 #include <com/sun/star/i18n/XExtendedTransliteration.hpp>
23 #include <com/sun/star/i18n/TransliterationType.hpp>
24 #include <cppuhelper/implbase1.hxx>
25 #include <rtl/ustrbuf.h>
26 #include <rtl/ustring.hxx>
28 namespace com
{ namespace sun
{ namespace star
{ namespace i18n
{
30 class transliteration_commonclass
: public cppu::WeakImplHelper1
< com::sun::star::i18n::XExtendedTransliteration
>
33 transliteration_commonclass();
35 // Methods which are shared.
37 loadModule( TransliterationModules modName
, const com::sun::star::lang::Locale
& rLocale
)
38 throw(com::sun::star::uno::RuntimeException
);
41 loadModuleNew( const com::sun::star::uno::Sequence
< TransliterationModulesNew
>& modName
, const com::sun::star::lang::Locale
& rLocale
)
42 throw(com::sun::star::uno::RuntimeException
);
45 loadModuleByImplName( const OUString
& implName
, const com::sun::star::lang::Locale
& rLocale
)
46 throw(com::sun::star::uno::RuntimeException
);
49 loadModulesByImplNames(const com::sun::star::uno::Sequence
< OUString
>& modNamelist
, const com::sun::star::lang::Locale
& rLocale
)
50 throw(com::sun::star::uno::RuntimeException
);
52 com::sun::star::uno::Sequence
< OUString
> SAL_CALL
53 getAvailableModules( const com::sun::star::lang::Locale
& rLocale
, sal_Int16 sType
)
54 throw(com::sun::star::uno::RuntimeException
);
56 // Methods which should be implemented in each transliteration module.
57 virtual OUString SAL_CALL
getName() throw(com::sun::star::uno::RuntimeException
);
59 virtual sal_Int16 SAL_CALL
getType( ) throw(com::sun::star::uno::RuntimeException
) = 0;
61 virtual OUString SAL_CALL
62 transliterate( const OUString
& inStr
, sal_Int32 startPos
, sal_Int32 nCount
, com::sun::star::uno::Sequence
< sal_Int32
>& offset
)
63 throw(com::sun::star::uno::RuntimeException
) = 0;
65 virtual OUString SAL_CALL
66 folding( const OUString
& inStr
, sal_Int32 startPos
, sal_Int32 nCount
, com::sun::star::uno::Sequence
< sal_Int32
>& offset
)
67 throw(com::sun::star::uno::RuntimeException
) = 0;
69 // Methods in XExtendedTransliteration
70 virtual OUString SAL_CALL
71 transliterateString2String( const OUString
& inStr
, sal_Int32 startPos
, sal_Int32 nCount
)
72 throw(com::sun::star::uno::RuntimeException
);
73 virtual OUString SAL_CALL
74 transliterateChar2String( sal_Unicode inChar
)
75 throw(com::sun::star::uno::RuntimeException
);
76 virtual sal_Unicode SAL_CALL
77 transliterateChar2Char( sal_Unicode inChar
)
78 throw(com::sun::star::i18n::MultipleCharsOutputException
,
79 com::sun::star::uno::RuntimeException
) = 0;
81 virtual sal_Bool SAL_CALL
82 equals( const OUString
& str1
, sal_Int32 pos1
, sal_Int32 nCount1
, sal_Int32
& nMatch1
, const OUString
& str2
, sal_Int32 pos2
, sal_Int32 nCount2
, sal_Int32
& nMatch2
)
83 throw(com::sun::star::uno::RuntimeException
) = 0;
85 virtual com::sun::star::uno::Sequence
< OUString
> SAL_CALL
86 transliterateRange( const OUString
& str1
, const OUString
& str2
)
87 throw(com::sun::star::uno::RuntimeException
) = 0;
89 virtual sal_Int32 SAL_CALL
90 compareSubstring( const OUString
& s1
, sal_Int32 off1
, sal_Int32 len1
, const OUString
& s2
, sal_Int32 off2
, sal_Int32 len2
)
91 throw(com::sun::star::uno::RuntimeException
);
93 virtual sal_Int32 SAL_CALL
94 compareString( const OUString
& s1
, const OUString
& s2
)
95 throw(com::sun::star::uno::RuntimeException
);
98 virtual OUString SAL_CALL
getImplementationName()
99 throw( com::sun::star::uno::RuntimeException
);
100 virtual sal_Bool SAL_CALL
supportsService(const OUString
& ServiceName
)
101 throw( com::sun::star::uno::RuntimeException
);
102 virtual com::sun::star::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames()
103 throw( com::sun::star::uno::RuntimeException
);
105 com::sun::star::lang::Locale aLocale
;
106 const sal_Char
* transliterationName
;
107 const sal_Char
* implementationName
;
113 #endif // _I18N_TRANSLITERATION_TRANSLITERATION_COMMONCLASS_H_
115 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */