Version 6.1.4.1, tag libreoffice-6.1.4.1
[LibreOffice.git] / i18npool / inc / indexentrysupplier.hxx
blob088ca721630c794132c99360d83b13018cfcf8c7
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 #ifndef INCLUDED_I18NPOOL_INC_INDEXENTRYSUPPLIER_HXX
20 #define INCLUDED_I18NPOOL_INC_INDEXENTRYSUPPLIER_HXX
22 #include <com/sun/star/i18n/XExtendedIndexEntrySupplier.hpp>
23 #include <cppuhelper/implbase.hxx>
24 #include <com/sun/star/lang/XServiceInfo.hpp>
25 #include <com/sun/star/uno/XComponentContext.hpp>
27 namespace i18npool {
30 // class IndexEntrySupplier
32 class IndexEntrySupplier final : public cppu::WeakImplHelper
34 css::i18n::XExtendedIndexEntrySupplier,
35 css::lang::XServiceInfo
38 public:
39 IndexEntrySupplier( const css::uno::Reference < css::uno::XComponentContext >& rxContext );
41 // Methods
42 virtual css::uno::Sequence < css::lang::Locale > SAL_CALL getLocaleList() override;
44 virtual css::uno::Sequence < OUString > SAL_CALL getAlgorithmList(
45 const css::lang::Locale& rLocale ) override;
47 virtual sal_Bool SAL_CALL loadAlgorithm(
48 const css::lang::Locale& rLocale,
49 const OUString& SortAlgorithm, sal_Int32 collatorOptions ) override;
51 virtual sal_Bool SAL_CALL usePhoneticEntry(
52 const css::lang::Locale& rLocale ) override;
54 virtual OUString SAL_CALL getPhoneticCandidate( const OUString& IndexEntry,
55 const css::lang::Locale& rLocale ) override;
57 virtual OUString SAL_CALL getIndexKey( const OUString& IndexEntry,
58 const OUString& PhoneticEntry, const css::lang::Locale& rLocale ) override;
60 virtual sal_Int16 SAL_CALL compareIndexEntry( const OUString& IndexEntry1,
61 const OUString& PhoneticEntry1, const css::lang::Locale& rLocale1,
62 const OUString& IndexEntry2, const OUString& PhoneticEntry2,
63 const css::lang::Locale& rLocale2 ) override;
65 virtual OUString SAL_CALL getIndexCharacter( const OUString& IndexEntry,
66 const css::lang::Locale& rLocale, const OUString& SortAlgorithm ) override;
68 virtual OUString SAL_CALL getIndexFollowPageWord( sal_Bool MorePages,
69 const css::lang::Locale& rLocale ) override;
71 //XServiceInfo
72 virtual OUString SAL_CALL getImplementationName() override;
73 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
74 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
76 private:
77 css::uno::Reference < css::i18n::XExtendedIndexEntrySupplier > xIES;
78 css::uno::Reference < css::uno::XComponentContext > m_xContext;
79 /// @throws css::uno::RuntimeException
80 bool createLocaleSpecificIndexEntrySupplier(const OUString& name);
81 /// @throws css::uno::RuntimeException
82 css::uno::Reference < css::i18n::XExtendedIndexEntrySupplier > const & getLocaleSpecificIndexEntrySupplier(
83 const css::lang::Locale& rLocale, const OUString& rSortAlgorithm);
85 css::lang::Locale aLocale;
86 OUString aSortAlgorithm;
91 #endif
93 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */