1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: indexentrysupplier_default.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _I18N_INDEXENTRYSUPPLIER_DEFAULT_HXX_
31 #define _I18N_INDEXENTRYSUPPLIER_DEFAULT_HXX_
33 #include <indexentrysupplier_common.hxx>
35 namespace com
{ namespace sun
{ namespace star
{ namespace i18n
{
39 // ----------------------------------------------------
40 // class IndexEntrySupplier_Unicode
41 // ----------------------------------------------------
42 class IndexEntrySupplier_Unicode
: public IndexEntrySupplier_Common
{
44 IndexEntrySupplier_Unicode( const com::sun::star::uno::Reference
< com::sun::star::lang::XMultiServiceFactory
>& rxMSF
);
45 ~IndexEntrySupplier_Unicode();
47 virtual sal_Bool SAL_CALL
loadAlgorithm(
48 const com::sun::star::lang::Locale
& rLocale
,
49 const rtl::OUString
& SortAlgorithm
, sal_Int32 collatorOptions
)
50 throw (com::sun::star::uno::RuntimeException
);
52 virtual rtl::OUString SAL_CALL
getIndexKey( const rtl::OUString
& IndexEntry
,
53 const rtl::OUString
& PhoneticEntry
, const com::sun::star::lang::Locale
& rLocale
)
54 throw (com::sun::star::uno::RuntimeException
);
56 virtual sal_Int16 SAL_CALL
compareIndexEntry( const rtl::OUString
& IndexEntry1
,
57 const rtl::OUString
& PhoneticEntry1
, const com::sun::star::lang::Locale
& rLocale1
,
58 const rtl::OUString
& IndexEntry2
, const ::rtl::OUString
& PhoneticEntry2
,
59 const com::sun::star::lang::Locale
& rLocale2
)
60 throw (com::sun::star::uno::RuntimeException
);
62 virtual rtl::OUString SAL_CALL
getIndexCharacter( const rtl::OUString
& rIndexEntry
,
63 const com::sun::star::lang::Locale
& rLocale
, const rtl::OUString
& rSortAlgorithm
)
64 throw (com::sun::star::uno::RuntimeException
);
82 void init(sal_Unicode start_
, sal_Unicode end_
, IndexKey
* keys
, sal_Int16 key_count
, Index
*index
);
95 Index(const com::sun::star::uno::Reference
< com::sun::star::lang::XMultiServiceFactory
>& rxMSF
);
98 void init(const com::sun::star::lang::Locale
& rLocale
, const rtl::OUString
& algorithm
) throw (com::sun::star::uno::RuntimeException
);
100 void makeIndexKeys(const com::sun::star::lang::Locale
&rLocale
, const rtl::OUString
&algorithm
) throw (com::sun::star::uno::RuntimeException
);
101 sal_Int16
getIndexWeight(const rtl::OUString
& rIndexEntry
);
102 rtl::OUString
getIndexDescription(const rtl::OUString
& rIndexEntry
);
104 IndexTable tables
[MAX_TABLES
];
105 sal_Int16 table_count
;
106 IndexKey keys
[MAX_KEYS
];
108 sal_Int16 mkeys
[MAX_KEYS
];
109 sal_Int16 mkey_count
;
110 rtl::OUString skipping_chars
;
111 CollatorImpl
*collator
;
112 sal_Int16
compare(sal_Unicode c1
, sal_Unicode c2
);