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 INCLUDED_I18NPOOL_INC_TRANSLITERATIONIMPL_HXX
20 #define INCLUDED_I18NPOOL_INC_TRANSLITERATIONIMPL_HXX
22 #include <com/sun/star/i18n/XExtendedTransliteration.hpp>
23 #include <cppuhelper/implbase.hxx>
24 #include <com/sun/star/lang/XServiceInfo.hpp>
25 #include <sal/types.h>
27 namespace com::sun::star::i18n
{ class XLocaleData5
; }
28 namespace com::sun::star::uno
{ class XComponentContext
; }
32 class TransliterationImpl
: public cppu::WeakImplHelper
34 css::i18n::XExtendedTransliteration
,
35 css::lang::XServiceInfo
40 TransliterationImpl(const css::uno::Reference
< css::uno::XComponentContext
>& xContext
);
42 virtual ~TransliterationImpl() override
;
45 virtual OUString SAL_CALL
getName( ) override
;
46 virtual sal_Int16 SAL_CALL
getType( ) override
;
48 virtual void SAL_CALL
loadModule( css::i18n::TransliterationModules modName
, const css::lang::Locale
& rLocale
) override
;
49 virtual void SAL_CALL
loadModuleNew( const css::uno::Sequence
< css::i18n::TransliterationModulesNew
>& modName
,
50 const css::lang::Locale
& rLocale
) override
;
51 virtual void SAL_CALL
loadModuleByImplName( const OUString
& implName
,
52 const css::lang::Locale
& rLocale
) override
;
53 virtual void SAL_CALL
loadModulesByImplNames(const css::uno::Sequence
< OUString
>& modNamelist
,
54 const css::lang::Locale
& rLocale
) override
;
56 virtual css::uno::Sequence
< OUString
> SAL_CALL
getAvailableModules(
57 const css::lang::Locale
& rLocale
, sal_Int16 sType
) override
;
59 virtual OUString SAL_CALL
transliterate( const OUString
& inStr
, sal_Int32 startPos
, sal_Int32 nCount
,
60 css::uno::Sequence
< sal_Int32
>& offset
) override
;
62 virtual OUString SAL_CALL
folding( const OUString
& inStr
, sal_Int32 startPos
, sal_Int32 nCount
,
63 css::uno::Sequence
< sal_Int32
>& offset
) override
;
65 // Methods in XExtendedTransliteration
66 virtual OUString SAL_CALL
transliterateString2String( const OUString
& inStr
, sal_Int32 startPos
, sal_Int32 nCount
) override
;
67 virtual OUString SAL_CALL
transliterateChar2String( sal_Unicode inChar
) override
;
68 virtual sal_Unicode SAL_CALL
transliterateChar2Char( sal_Unicode inChar
) override
;
70 virtual sal_Bool SAL_CALL
equals( const OUString
& str1
, sal_Int32 pos1
, sal_Int32 nCount1
,
71 sal_Int32
& nMatch1
, const OUString
& str2
, sal_Int32 pos2
, sal_Int32 nCount2
, sal_Int32
& nMatch2
) override
;
72 virtual css::uno::Sequence
< OUString
> SAL_CALL
transliterateRange( const OUString
& str1
,
73 const OUString
& str2
) override
;
75 virtual sal_Int32 SAL_CALL
compareSubstring( const OUString
& s1
, sal_Int32 off1
, sal_Int32 len1
,
76 const OUString
& s2
, sal_Int32 off2
, sal_Int32 len2
) override
;
78 virtual sal_Int32 SAL_CALL
compareString( const OUString
& s1
, const OUString
& s2
) override
;
81 virtual OUString SAL_CALL
getImplementationName() override
;
82 virtual sal_Bool SAL_CALL
supportsService(const OUString
& ServiceName
) override
;
83 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
87 css::uno::Reference
< css::i18n::XExtendedTransliteration
> bodyCascade
[maxCascade
];
90 css::uno::Reference
< css::uno::XComponentContext
> mxContext
;
91 css::uno::Reference
< css::i18n::XLocaleData5
> mxLocaledata
;
92 css::uno::Reference
< css::i18n::XExtendedTransliteration
> caseignore
;
94 /// @throws css::uno::RuntimeException
95 bool loadModuleByName( const OUString
& implName
,
96 css::uno::Reference
<css::i18n::XExtendedTransliteration
> & body
, const css::lang::Locale
& rLocale
);
100 /// @throws css::uno::RuntimeException
101 void loadBody( OUString
const &implName
,
102 css::uno::Reference
< css::i18n::XExtendedTransliteration
>& body
);
104 /// @throws css::uno::RuntimeException
105 css::uno::Sequence
< OUString
> getRange(
106 const css::uno::Sequence
< OUString
> &inStrs
,
107 sal_Int32 length
, const sal_Int16 _nCascade
);
114 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */