LibreOffice Module i18npool (master) 1
indexentrysupplier_common.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
20#pragma once
21
22#include <com/sun/star/i18n/XExtendedIndexEntrySupplier.hpp>
24#include <com/sun/star/lang/XServiceInfo.hpp>
25#include <rtl/ref.hxx>
26
27namespace com::sun::star::uno { class XComponentContext; }
28namespace i18npool { class CollatorImpl; }
29
30namespace i18npool {
31
32
33
34
35class IndexEntrySupplier_Common : public cppu::WeakImplHelper
36<
37 css::i18n::XExtendedIndexEntrySupplier,
38 css::lang::XServiceInfo
39>
40{
41public:
42 IndexEntrySupplier_Common( const css::uno::Reference < css::uno::XComponentContext >& rxContext );
43 virtual ~IndexEntrySupplier_Common() override;
44
45 virtual css::uno::Sequence < css::lang::Locale > SAL_CALL getLocaleList() override;
46
47 virtual css::uno::Sequence < OUString > SAL_CALL getAlgorithmList(
48 const css::lang::Locale& rLocale ) override;
49
50 virtual sal_Bool SAL_CALL usePhoneticEntry(
51 const css::lang::Locale& rLocale ) override;
52
53 virtual OUString SAL_CALL getPhoneticCandidate( const OUString& IndexEntry,
54 const css::lang::Locale& rLocale ) override;
55
56 virtual sal_Bool SAL_CALL loadAlgorithm(
57 const css::lang::Locale& rLocale,
58 const OUString& SortAlgorithm, sal_Int32 collatorOptions ) override;
59
60 virtual OUString SAL_CALL getIndexKey( const OUString& IndexEntry,
61 const OUString& PhoneticEntry, const css::lang::Locale& rLocale ) override;
62
63 virtual sal_Int16 SAL_CALL compareIndexEntry( const OUString& IndexEntry1,
64 const OUString& PhoneticEntry1, const css::lang::Locale& rLocale1,
65 const OUString& IndexEntry2, const OUString& PhoneticEntry2,
66 const css::lang::Locale& rLocale2 ) override;
67
68 virtual OUString SAL_CALL getIndexCharacter( const OUString& rIndexEntry,
69 const css::lang::Locale& rLocale, const OUString& rSortAlgorithm ) override;
70
71 virtual OUString SAL_CALL getIndexFollowPageWord( sal_Bool MorePages,
72 const css::lang::Locale& rLocale ) override;
73
74 //XServiceInfo
75 virtual OUString SAL_CALL getImplementationName() override;
76 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
77 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
78
79protected:
80 const char * implementationName;
84 css::lang::Locale aLocale;
85 OUString aAlgorithm;
86
88 const OUString& getEntry( const OUString& IndexEntry,
89 const OUString& PhoneticEntry, const css::lang::Locale& rLocale ) const;
90};
91
92}
93
94/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual sal_Bool SAL_CALL usePhoneticEntry(const css::lang::Locale &rLocale) override
IndexEntrySupplier_Common(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
virtual css::uno::Sequence< OUString > SAL_CALL getAlgorithmList(const css::lang::Locale &rLocale) override
virtual OUString SAL_CALL getPhoneticCandidate(const OUString &IndexEntry, const css::lang::Locale &rLocale) 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
virtual OUString SAL_CALL getIndexKey(const OUString &IndexEntry, const OUString &PhoneticEntry, 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 css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual OUString SAL_CALL getIndexCharacter(const OUString &rIndexEntry, const css::lang::Locale &rLocale, const OUString &rSortAlgorithm) override
virtual OUString SAL_CALL getIndexFollowPageWord(sal_Bool MorePages, const css::lang::Locale &rLocale) override
const OUString & getEntry(const OUString &IndexEntry, const OUString &PhoneticEntry, const css::lang::Locale &rLocale) const
virtual OUString SAL_CALL getImplementationName() override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual css::uno::Sequence< css::lang::Locale > SAL_CALL getLocaleList() override
Constant values shared between i18npool and, for example, the number formatter.
unsigned char sal_Bool