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 24 #ifndef _I18N_INDEXENTRYSUPPLIER_COMMON_HXX_ 25 #define _I18N_INDEXENTRYSUPPLIER_COMMON_HXX_ 26 27 #include <com/sun/star/i18n/XExtendedIndexEntrySupplier.hpp> 28 #include <cppuhelper/implbase2.hxx> // helper for implementations 29 #include <com/sun/star/lang/XServiceInfo.hpp> 30 #include <collatorImpl.hxx> 31 32 namespace com { namespace sun { namespace star { namespace i18n { 33 34 // ---------------------------------------------------- 35 // class IndexEntrySupplier_Common 36 // ---------------------------------------------------- 37 38 class IndexEntrySupplier_Common : public cppu::WeakImplHelper2 39 < 40 com::sun::star::i18n::XExtendedIndexEntrySupplier, 41 com::sun::star::lang::XServiceInfo 42 > 43 { 44 public: 45 IndexEntrySupplier_Common( const com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory >& rxMSF ); 46 ~IndexEntrySupplier_Common(); 47 48 virtual com::sun::star::uno::Sequence < com::sun::star::lang::Locale > SAL_CALL getLocaleList(); 49 50 virtual com::sun::star::uno::Sequence < rtl::OUString > SAL_CALL getAlgorithmList( 51 const com::sun::star::lang::Locale& rLocale ); 52 53 virtual sal_Bool SAL_CALL usePhoneticEntry( 54 const com::sun::star::lang::Locale& rLocale ); 55 56 virtual rtl::OUString SAL_CALL getPhoneticCandidate( const rtl::OUString& IndexEntry, 57 const com::sun::star::lang::Locale& rLocale ); 58 59 virtual sal_Bool SAL_CALL loadAlgorithm( 60 const com::sun::star::lang::Locale& rLocale, 61 const rtl::OUString& SortAlgorithm, sal_Int32 collatorOptions ); 62 63 virtual rtl::OUString SAL_CALL getIndexKey( const rtl::OUString& IndexEntry, 64 const rtl::OUString& PhoneticEntry, const com::sun::star::lang::Locale& rLocale ); 65 66 virtual sal_Int16 SAL_CALL compareIndexEntry( const rtl::OUString& IndexEntry1, 67 const rtl::OUString& PhoneticEntry1, const com::sun::star::lang::Locale& rLocale1, 68 const rtl::OUString& IndexEntry2, const ::rtl::OUString& PhoneticEntry2, 69 const com::sun::star::lang::Locale& rLocale2 ); 70 71 virtual rtl::OUString SAL_CALL getIndexCharacter( const rtl::OUString& rIndexEntry, 72 const com::sun::star::lang::Locale& rLocale, const rtl::OUString& rSortAlgorithm ); 73 74 virtual rtl::OUString SAL_CALL getIndexFollowPageWord( sal_Bool MorePages, 75 const com::sun::star::lang::Locale& rLocale ); 76 77 //XServiceInfo 78 virtual rtl::OUString SAL_CALL getImplementationName(); 79 virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName); 80 virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(); 81 82 protected: 83 const sal_Char *implementationName; 84 sal_Bool usePhonetic; 85 CollatorImpl *collator; 86 const rtl::OUString& SAL_CALL getEntry( const rtl::OUString& IndexEntry, 87 const rtl::OUString& PhoneticEntry, const com::sun::star::lang::Locale& rLocale ); 88 com::sun::star::lang::Locale aLocale; 89 rtl::OUString aAlgorithm; 90 }; 91 92 } } } } 93 #endif 94