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 .
20 #ifndef INCLUDED_I18NPOOL_INC_INDEXENTRYSUPPLIER_COMMON_HXX
21 #define INCLUDED_I18NPOOL_INC_INDEXENTRYSUPPLIER_COMMON_HXX
23 #include <com/sun/star/i18n/XExtendedIndexEntrySupplier.hpp>
24 #include <cppuhelper/implbase2.hxx>
25 #include <com/sun/star/lang/XServiceInfo.hpp>
26 #include <collatorImpl.hxx>
28 namespace com
{ namespace sun
{ namespace star
{ namespace i18n
{
31 // class IndexEntrySupplier_Common
34 class IndexEntrySupplier_Common
: public cppu::WeakImplHelper2
36 com::sun::star::i18n::XExtendedIndexEntrySupplier
,
37 com::sun::star::lang::XServiceInfo
41 IndexEntrySupplier_Common( const com::sun::star::uno::Reference
< com::sun::star::uno::XComponentContext
>& rxContext
);
42 virtual ~IndexEntrySupplier_Common();
44 virtual com::sun::star::uno::Sequence
< com::sun::star::lang::Locale
> SAL_CALL
getLocaleList()
45 throw (com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
47 virtual com::sun::star::uno::Sequence
< OUString
> SAL_CALL
getAlgorithmList(
48 const com::sun::star::lang::Locale
& rLocale
)
49 throw (com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
51 virtual sal_Bool SAL_CALL
usePhoneticEntry(
52 const com::sun::star::lang::Locale
& rLocale
)
53 throw (com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
55 virtual OUString SAL_CALL
getPhoneticCandidate( const OUString
& IndexEntry
,
56 const com::sun::star::lang::Locale
& rLocale
)
57 throw (com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
59 virtual sal_Bool SAL_CALL
loadAlgorithm(
60 const com::sun::star::lang::Locale
& rLocale
,
61 const OUString
& SortAlgorithm
, sal_Int32 collatorOptions
)
62 throw (com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
64 virtual OUString SAL_CALL
getIndexKey( const OUString
& IndexEntry
,
65 const OUString
& PhoneticEntry
, const com::sun::star::lang::Locale
& rLocale
)
66 throw (com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
68 virtual sal_Int16 SAL_CALL
compareIndexEntry( const OUString
& IndexEntry1
,
69 const OUString
& PhoneticEntry1
, const com::sun::star::lang::Locale
& rLocale1
,
70 const OUString
& IndexEntry2
, const OUString
& PhoneticEntry2
,
71 const com::sun::star::lang::Locale
& rLocale2
)
72 throw (com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
74 virtual OUString SAL_CALL
getIndexCharacter( const OUString
& rIndexEntry
,
75 const com::sun::star::lang::Locale
& rLocale
, const OUString
& rSortAlgorithm
)
76 throw (com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
78 virtual OUString SAL_CALL
getIndexFollowPageWord( sal_Bool MorePages
,
79 const com::sun::star::lang::Locale
& rLocale
)
80 throw (com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
83 virtual OUString SAL_CALL
getImplementationName()
84 throw( com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
85 virtual sal_Bool SAL_CALL
supportsService(const OUString
& ServiceName
)
86 throw( com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
87 virtual com::sun::star::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames()
88 throw( com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
91 const sal_Char
*implementationName
;
93 CollatorImpl
*collator
;
94 const OUString
& SAL_CALL
getEntry( const OUString
& IndexEntry
,
95 const OUString
& PhoneticEntry
, const com::sun::star::lang::Locale
& rLocale
)
96 throw (com::sun::star::uno::RuntimeException
);
97 com::sun::star::lang::Locale aLocale
;
104 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */