attempt to fix macos jenkins hangs - part 3
[LibreOffice.git] / i18npool / inc / transliterationImpl.hxx
blob57441067346a058b020753160047af5d8e17c410
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 #pragma once
21 #include <com/sun/star/i18n/XExtendedTransliteration.hpp>
22 #include <cppuhelper/implbase.hxx>
23 #include <com/sun/star/lang/XServiceInfo.hpp>
24 #include <sal/types.h>
26 namespace com::sun::star::i18n { class XLocaleData5; }
27 namespace com::sun::star::uno { class XComponentContext; }
29 namespace i18npool {
31 class TransliterationImpl final : public cppu::WeakImplHelper
33 css::i18n::XExtendedTransliteration,
34 css::lang::XServiceInfo
37 public:
38 // Constructors
39 TransliterationImpl(const css::uno::Reference < css::uno::XComponentContext >& xContext);
40 // Destructor
41 virtual ~TransliterationImpl() override;
43 // Methods
44 virtual OUString SAL_CALL getName( ) override ;
45 virtual sal_Int16 SAL_CALL getType( ) override ;
47 virtual void SAL_CALL loadModule( css::i18n::TransliterationModules modName, const css::lang::Locale& rLocale ) override ;
48 virtual void SAL_CALL loadModuleNew( const css::uno::Sequence< css::i18n::TransliterationModulesNew >& modName,
49 const css::lang::Locale& rLocale ) override ;
50 virtual void SAL_CALL loadModuleByImplName( const OUString& implName,
51 const css::lang::Locale& rLocale ) override;
52 virtual void SAL_CALL loadModulesByImplNames(const css::uno::Sequence< OUString >& modNamelist,
53 const css::lang::Locale& rLocale) override;
55 virtual css::uno::Sequence< OUString > SAL_CALL getAvailableModules(
56 const css::lang::Locale& rLocale, sal_Int16 sType ) override;
58 virtual OUString SAL_CALL transliterate( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount,
59 css::uno::Sequence< sal_Int32 >& offset ) override ;
61 virtual OUString SAL_CALL folding( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount,
62 css::uno::Sequence< sal_Int32 >& offset ) override;
64 // Methods in XExtendedTransliteration
65 virtual OUString SAL_CALL transliterateString2String( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount ) override ;
66 virtual OUString SAL_CALL transliterateChar2String( sal_Unicode inChar ) override ;
67 virtual sal_Unicode SAL_CALL transliterateChar2Char( sal_Unicode inChar ) override ;
69 virtual sal_Bool SAL_CALL equals( const OUString& str1, sal_Int32 pos1, sal_Int32 nCount1,
70 sal_Int32& nMatch1, const OUString& str2, sal_Int32 pos2, sal_Int32 nCount2, sal_Int32& nMatch2 ) override;
71 virtual css::uno::Sequence< OUString > SAL_CALL transliterateRange( const OUString& str1,
72 const OUString& str2 ) override ;
74 virtual sal_Int32 SAL_CALL compareSubstring( const OUString& s1, sal_Int32 off1, sal_Int32 len1,
75 const OUString& s2, sal_Int32 off2, sal_Int32 len2) override;
77 virtual sal_Int32 SAL_CALL compareString( const OUString& s1, const OUString& s2) override;
79 //XServiceInfo
80 virtual OUString SAL_CALL getImplementationName() override;
81 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
82 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
84 private:
85 #define maxCascade 27
86 css::uno::Reference< css::i18n::XExtendedTransliteration > bodyCascade[maxCascade];
87 sal_Int16 numCascade;
88 bool caseignoreOnly;
89 css::uno::Reference< css::uno::XComponentContext > mxContext;
90 css::uno::Reference< css::i18n::XLocaleData5 > mxLocaledata;
91 css::uno::Reference< css::i18n::XExtendedTransliteration > caseignore;
93 /// @throws css::uno::RuntimeException
94 bool loadModuleByName( std::u16string_view implName,
95 css::uno::Reference<css::i18n::XExtendedTransliteration> & body, const css::lang::Locale& rLocale);
97 void clear();
99 /// @throws css::uno::RuntimeException
100 void loadBody( OUString const &implName,
101 css::uno::Reference< css::i18n::XExtendedTransliteration >& body );
103 /// @throws css::uno::RuntimeException
104 css::uno::Sequence< OUString > getRange(
105 const css::uno::Sequence< OUString > &inStrs,
106 sal_Int32 length, const sal_Int16 _nCascade);
111 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */