1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #ifndef _I18N_INDEXENTRYSUPPLIER_COMMON_HXX_
30 #define _I18N_INDEXENTRYSUPPLIER_COMMON_HXX_
32 #include <com/sun/star/i18n/XExtendedIndexEntrySupplier.hpp>
33 #include <cppuhelper/implbase2.hxx> // helper for implementations
34 #include <com/sun/star/lang/XServiceInfo.hpp>
35 #include <collatorImpl.hxx>
37 namespace com
{ namespace sun
{ namespace star
{ namespace i18n
{
39 // ----------------------------------------------------
40 // class IndexEntrySupplier_Common
41 // ----------------------------------------------------
43 class IndexEntrySupplier_Common
: public cppu::WeakImplHelper2
45 com::sun::star::i18n::XExtendedIndexEntrySupplier
,
46 com::sun::star::lang::XServiceInfo
50 IndexEntrySupplier_Common( const com::sun::star::uno::Reference
< com::sun::star::lang::XMultiServiceFactory
>& rxMSF
);
51 ~IndexEntrySupplier_Common();
53 virtual com::sun::star::uno::Sequence
< com::sun::star::lang::Locale
> SAL_CALL
getLocaleList()
54 throw (com::sun::star::uno::RuntimeException
);
56 virtual com::sun::star::uno::Sequence
< rtl::OUString
> SAL_CALL
getAlgorithmList(
57 const com::sun::star::lang::Locale
& rLocale
)
58 throw (com::sun::star::uno::RuntimeException
);
60 virtual sal_Bool SAL_CALL
usePhoneticEntry(
61 const com::sun::star::lang::Locale
& rLocale
)
62 throw (com::sun::star::uno::RuntimeException
);
64 virtual rtl::OUString SAL_CALL
getPhoneticCandidate( const rtl::OUString
& IndexEntry
,
65 const com::sun::star::lang::Locale
& rLocale
)
66 throw (com::sun::star::uno::RuntimeException
);
68 virtual sal_Bool SAL_CALL
loadAlgorithm(
69 const com::sun::star::lang::Locale
& rLocale
,
70 const rtl::OUString
& SortAlgorithm
, sal_Int32 collatorOptions
)
71 throw (com::sun::star::uno::RuntimeException
);
73 virtual rtl::OUString SAL_CALL
getIndexKey( const rtl::OUString
& IndexEntry
,
74 const rtl::OUString
& PhoneticEntry
, const com::sun::star::lang::Locale
& rLocale
)
75 throw (com::sun::star::uno::RuntimeException
);
77 virtual sal_Int16 SAL_CALL
compareIndexEntry( const rtl::OUString
& IndexEntry1
,
78 const rtl::OUString
& PhoneticEntry1
, const com::sun::star::lang::Locale
& rLocale1
,
79 const rtl::OUString
& IndexEntry2
, const ::rtl::OUString
& PhoneticEntry2
,
80 const com::sun::star::lang::Locale
& rLocale2
)
81 throw (com::sun::star::uno::RuntimeException
);
83 virtual rtl::OUString SAL_CALL
getIndexCharacter( const rtl::OUString
& rIndexEntry
,
84 const com::sun::star::lang::Locale
& rLocale
, const rtl::OUString
& rSortAlgorithm
)
85 throw (com::sun::star::uno::RuntimeException
);
87 virtual rtl::OUString SAL_CALL
getIndexFollowPageWord( sal_Bool MorePages
,
88 const com::sun::star::lang::Locale
& rLocale
)
89 throw (com::sun::star::uno::RuntimeException
);
92 virtual rtl::OUString SAL_CALL
getImplementationName()
93 throw( com::sun::star::uno::RuntimeException
);
94 virtual sal_Bool SAL_CALL
supportsService(const rtl::OUString
& ServiceName
)
95 throw( com::sun::star::uno::RuntimeException
);
96 virtual com::sun::star::uno::Sequence
< rtl::OUString
> SAL_CALL
getSupportedServiceNames()
97 throw( com::sun::star::uno::RuntimeException
);
100 const sal_Char
*implementationName
;
101 sal_Bool usePhonetic
;
102 CollatorImpl
*collator
;
103 const rtl::OUString
& SAL_CALL
getEntry( const rtl::OUString
& IndexEntry
,
104 const rtl::OUString
& PhoneticEntry
, const com::sun::star::lang::Locale
& rLocale
)
105 throw (com::sun::star::uno::RuntimeException
);
106 com::sun::star::lang::Locale aLocale
;
107 rtl::OUString aAlgorithm
;
113 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */