1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #ifndef _I18N_INDEXENTRYSUPPLIER_COMMON_HXX_
29 #define _I18N_INDEXENTRYSUPPLIER_COMMON_HXX_
31 #include <com/sun/star/i18n/XExtendedIndexEntrySupplier.hpp>
32 #include <cppuhelper/implbase2.hxx> // helper for implementations
33 #include <com/sun/star/lang/XServiceInfo.hpp>
34 #include <collatorImpl.hxx>
36 namespace com
{ namespace sun
{ namespace star
{ namespace i18n
{
38 // ----------------------------------------------------
39 // class IndexEntrySupplier_Common
40 // ----------------------------------------------------
42 class IndexEntrySupplier_Common
: public cppu::WeakImplHelper2
44 com::sun::star::i18n::XExtendedIndexEntrySupplier
,
45 com::sun::star::lang::XServiceInfo
49 IndexEntrySupplier_Common( const com::sun::star::uno::Reference
< com::sun::star::lang::XMultiServiceFactory
>& rxMSF
);
50 ~IndexEntrySupplier_Common();
52 virtual com::sun::star::uno::Sequence
< com::sun::star::lang::Locale
> SAL_CALL
getLocaleList()
53 throw (com::sun::star::uno::RuntimeException
);
55 virtual com::sun::star::uno::Sequence
< rtl::OUString
> SAL_CALL
getAlgorithmList(
56 const com::sun::star::lang::Locale
& rLocale
)
57 throw (com::sun::star::uno::RuntimeException
);
59 virtual sal_Bool SAL_CALL
usePhoneticEntry(
60 const com::sun::star::lang::Locale
& rLocale
)
61 throw (com::sun::star::uno::RuntimeException
);
63 virtual rtl::OUString SAL_CALL
getPhoneticCandidate( const rtl::OUString
& IndexEntry
,
64 const com::sun::star::lang::Locale
& rLocale
)
65 throw (com::sun::star::uno::RuntimeException
);
67 virtual sal_Bool SAL_CALL
loadAlgorithm(
68 const com::sun::star::lang::Locale
& rLocale
,
69 const rtl::OUString
& SortAlgorithm
, sal_Int32 collatorOptions
)
70 throw (com::sun::star::uno::RuntimeException
);
72 virtual rtl::OUString SAL_CALL
getIndexKey( const rtl::OUString
& IndexEntry
,
73 const rtl::OUString
& PhoneticEntry
, const com::sun::star::lang::Locale
& rLocale
)
74 throw (com::sun::star::uno::RuntimeException
);
76 virtual sal_Int16 SAL_CALL
compareIndexEntry( const rtl::OUString
& IndexEntry1
,
77 const rtl::OUString
& PhoneticEntry1
, const com::sun::star::lang::Locale
& rLocale1
,
78 const rtl::OUString
& IndexEntry2
, const ::rtl::OUString
& PhoneticEntry2
,
79 const com::sun::star::lang::Locale
& rLocale2
)
80 throw (com::sun::star::uno::RuntimeException
);
82 virtual rtl::OUString SAL_CALL
getIndexCharacter( const rtl::OUString
& rIndexEntry
,
83 const com::sun::star::lang::Locale
& rLocale
, const rtl::OUString
& rSortAlgorithm
)
84 throw (com::sun::star::uno::RuntimeException
);
86 virtual rtl::OUString SAL_CALL
getIndexFollowPageWord( sal_Bool MorePages
,
87 const com::sun::star::lang::Locale
& rLocale
)
88 throw (com::sun::star::uno::RuntimeException
);
91 virtual rtl::OUString SAL_CALL
getImplementationName()
92 throw( com::sun::star::uno::RuntimeException
);
93 virtual sal_Bool SAL_CALL
supportsService(const rtl::OUString
& ServiceName
)
94 throw( com::sun::star::uno::RuntimeException
);
95 virtual com::sun::star::uno::Sequence
< rtl::OUString
> SAL_CALL
getSupportedServiceNames()
96 throw( com::sun::star::uno::RuntimeException
);
99 const sal_Char
*implementationName
;
100 sal_Bool usePhonetic
;
101 CollatorImpl
*collator
;
102 const rtl::OUString
& SAL_CALL
getEntry( const rtl::OUString
& IndexEntry
,
103 const rtl::OUString
& PhoneticEntry
, const com::sun::star::lang::Locale
& rLocale
)
104 throw (com::sun::star::uno::RuntimeException
);
105 com::sun::star::lang::Locale aLocale
;
106 rtl::OUString aAlgorithm
;