LibreOffice Module i18npool (master)  1
indexentrysupplier.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 #ifndef INCLUDED_I18NPOOL_INC_INDEXENTRYSUPPLIER_HXX
20 #define INCLUDED_I18NPOOL_INC_INDEXENTRYSUPPLIER_HXX
21 
22 #include <sal/config.h>
23 
24 #include <string_view>
25 
26 #include <com/sun/star/i18n/XExtendedIndexEntrySupplier.hpp>
27 #include <cppuhelper/implbase.hxx>
28 #include <com/sun/star/lang/XServiceInfo.hpp>
29 
30 namespace com::sun::star::uno { class XComponentContext; }
31 
32 namespace i18npool {
33 
34 
35 
36 class IndexEntrySupplier final : public cppu::WeakImplHelper
37 <
38  css::i18n::XExtendedIndexEntrySupplier,
39  css::lang::XServiceInfo
40 >
41 {
42 public:
43  IndexEntrySupplier( const css::uno::Reference < css::uno::XComponentContext >& rxContext );
44 
45  // Methods
46  virtual css::uno::Sequence < css::lang::Locale > SAL_CALL getLocaleList() override;
47 
48  virtual css::uno::Sequence < OUString > SAL_CALL getAlgorithmList(
49  const css::lang::Locale& rLocale ) override;
50 
51  virtual sal_Bool SAL_CALL loadAlgorithm(
52  const css::lang::Locale& rLocale,
53  const OUString& SortAlgorithm, sal_Int32 collatorOptions ) override;
54 
55  virtual sal_Bool SAL_CALL usePhoneticEntry(
56  const css::lang::Locale& rLocale ) override;
57 
58  virtual OUString SAL_CALL getPhoneticCandidate( const OUString& IndexEntry,
59  const css::lang::Locale& rLocale ) override;
60 
61  virtual OUString SAL_CALL getIndexKey( const OUString& IndexEntry,
62  const OUString& PhoneticEntry, const css::lang::Locale& rLocale ) override;
63 
64  virtual sal_Int16 SAL_CALL compareIndexEntry( const OUString& IndexEntry1,
65  const OUString& PhoneticEntry1, const css::lang::Locale& rLocale1,
66  const OUString& IndexEntry2, const OUString& PhoneticEntry2,
67  const css::lang::Locale& rLocale2 ) override;
68 
69  virtual OUString SAL_CALL getIndexCharacter( const OUString& IndexEntry,
70  const css::lang::Locale& rLocale, const OUString& SortAlgorithm ) override;
71 
72  virtual OUString SAL_CALL getIndexFollowPageWord( sal_Bool MorePages,
73  const css::lang::Locale& rLocale ) override;
74 
75  //XServiceInfo
76  virtual OUString SAL_CALL getImplementationName() override;
77  virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
78  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
79 
80 private:
81  css::uno::Reference < css::i18n::XExtendedIndexEntrySupplier > xIES;
82  css::uno::Reference < css::uno::XComponentContext > m_xContext;
84  bool createLocaleSpecificIndexEntrySupplier(std::u16string_view name);
86  css::uno::Reference < css::i18n::XExtendedIndexEntrySupplier > const & getLocaleSpecificIndexEntrySupplier(
87  const css::lang::Locale& rLocale, const OUString& rSortAlgorithm);
88 
89  css::lang::Locale aLocale;
90  OUString aSortAlgorithm;
91 };
92 
93 }
94 
95 #endif
96 
97 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual css::uno::Sequence< OUString > SAL_CALL getAlgorithmList(const css::lang::Locale &rLocale) override
virtual OUString SAL_CALL getImplementationName() override
css::uno::Reference< css::uno::XComponentContext > m_xContext
virtual css::uno::Sequence< css::lang::Locale > SAL_CALL getLocaleList() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
bool createLocaleSpecificIndexEntrySupplier(std::u16string_view name)
virtual OUString SAL_CALL getPhoneticCandidate(const OUString &IndexEntry, const css::lang::Locale &rLocale) override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual sal_Int16 SAL_CALL compareIndexEntry(const OUString &IndexEntry1, const OUString &PhoneticEntry1, const css::lang::Locale &rLocale1, const OUString &IndexEntry2, const OUString &PhoneticEntry2, const css::lang::Locale &rLocale2) override
unsigned char sal_Bool
Constant values shared between i18npool and, for example, the number formatter.
IndexEntrySupplier(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
virtual sal_Bool SAL_CALL usePhoneticEntry(const css::lang::Locale &rLocale) override
virtual sal_Bool SAL_CALL loadAlgorithm(const css::lang::Locale &rLocale, const OUString &SortAlgorithm, sal_Int32 collatorOptions) override
virtual OUString SAL_CALL getIndexFollowPageWord(sal_Bool MorePages, const css::lang::Locale &rLocale) override
css::uno::Reference< css::i18n::XExtendedIndexEntrySupplier > xIES
css::uno::Reference< css::i18n::XExtendedIndexEntrySupplier > const & getLocaleSpecificIndexEntrySupplier(const css::lang::Locale &rLocale, const OUString &rSortAlgorithm)
virtual OUString SAL_CALL getIndexKey(const OUString &IndexEntry, const OUString &PhoneticEntry, const css::lang::Locale &rLocale) override
virtual OUString SAL_CALL getIndexCharacter(const OUString &IndexEntry, const css::lang::Locale &rLocale, const OUString &SortAlgorithm) override