xref: /trunk/main/i18npool/inc/indexentrysupplier.hxx (revision 45c5a00162811bd03b87fcb4fe9996782f2b59ec)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _I18N_INDEXENTRYSUPPLIER_HXX_
24 #define _I18N_INDEXENTRYSUPPLIER_HXX_
25 
26 #include <com/sun/star/i18n/XExtendedIndexEntrySupplier.hpp>
27 #include <cppuhelper/implbase2.hxx> // helper for implementations
28 #include <com/sun/star/lang/XServiceInfo.hpp>
29 
30 namespace com { namespace sun { namespace star { namespace i18n {
31 
32 //  ----------------------------------------------------
33 //  class IndexEntrySupplier
34 //  ----------------------------------------------------
35 class IndexEntrySupplier : public cppu::WeakImplHelper2
36 <
37     com::sun::star::i18n::XExtendedIndexEntrySupplier,
38     com::sun::star::lang::XServiceInfo
39 >
40 {
41 public:
42     IndexEntrySupplier( const com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory >& rxMSF );
43 
44     // Methods
45     virtual com::sun::star::uno::Sequence < com::sun::star::lang::Locale > SAL_CALL getLocaleList();
46 
47     virtual com::sun::star::uno::Sequence < rtl::OUString > SAL_CALL getAlgorithmList(
48         const com::sun::star::lang::Locale& rLocale );
49 
50     virtual sal_Bool SAL_CALL loadAlgorithm(
51         const com::sun::star::lang::Locale& rLocale,
52         const rtl::OUString& SortAlgorithm, sal_Int32 collatorOptions );
53 
54     virtual sal_Bool SAL_CALL usePhoneticEntry(
55         const com::sun::star::lang::Locale& rLocale );
56 
57     virtual rtl::OUString SAL_CALL getPhoneticCandidate( const rtl::OUString& IndexEntry,
58         const com::sun::star::lang::Locale& rLocale );
59 
60     virtual rtl::OUString SAL_CALL getIndexKey( const rtl::OUString& IndexEntry,
61         const rtl::OUString& PhoneticEntry, const com::sun::star::lang::Locale& rLocale );
62 
63     virtual sal_Int16 SAL_CALL compareIndexEntry( const rtl::OUString& IndexEntry1,
64         const rtl::OUString& PhoneticEntry1, const com::sun::star::lang::Locale& rLocale1,
65         const rtl::OUString& IndexEntry2, const ::rtl::OUString& PhoneticEntry2,
66         const com::sun::star::lang::Locale& rLocale2 );
67 
68     virtual rtl::OUString SAL_CALL getIndexCharacter( const rtl::OUString& IndexEntry,
69         const com::sun::star::lang::Locale& rLocale, const rtl::OUString& SortAlgorithm );
70 
71     virtual rtl::OUString SAL_CALL getIndexFollowPageWord( sal_Bool MorePages,
72         const com::sun::star::lang::Locale& rLocale );
73 
74     //XServiceInfo
75     virtual rtl::OUString SAL_CALL getImplementationName();
76     virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName);
77     virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames();
78 
79 private:
80     rtl::OUString aServiceName;
81     com::sun::star::uno::Reference < com::sun::star::i18n::XExtendedIndexEntrySupplier > xIES;
82     com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > xMSF;
83     sal_Bool SAL_CALL createLocaleSpecificIndexEntrySupplier(const rtl::OUString& name);
84     com::sun::star::uno::Reference < com::sun::star::i18n::XExtendedIndexEntrySupplier > SAL_CALL getLocaleSpecificIndexEntrySupplier(
85         const com::sun::star::lang::Locale& rLocale, const rtl::OUString& rSortAlgorithm);
86 
87 protected:
88     com::sun::star::lang::Locale aLocale;
89     rtl::OUString aSortAlgorithm;
90 };
91 
92 } } } }
93 
94 #endif
95