1d1766043SAndrew Rist/**************************************************************
2cdf0e10cSrcweir *
3d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4d1766043SAndrew Rist * or more contributor license agreements.  See the NOTICE file
5d1766043SAndrew Rist * distributed with this work for additional information
6d1766043SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
7d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the
8d1766043SAndrew Rist * "License"); you may not use this file except in compliance
9d1766043SAndrew Rist * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir *
11d1766043SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12d1766043SAndrew Rist *
13d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing,
14d1766043SAndrew Rist * software distributed under the License is distributed on an
15d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16d1766043SAndrew Rist * KIND, either express or implied.  See the License for the
17d1766043SAndrew Rist * specific language governing permissions and limitations
18d1766043SAndrew Rist * under the License.
19d1766043SAndrew Rist *
20d1766043SAndrew Rist *************************************************************/
21d1766043SAndrew Rist
22d1766043SAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir#ifndef __com_sun_star_i18n_XExtendedIndexEntrySupplier_idl__
25cdf0e10cSrcweir#define __com_sun_star_i18n_XExtendedIndexEntrySupplier_idl__
26cdf0e10cSrcweir
27cdf0e10cSrcweir#include <com/sun/star/i18n/XIndexEntrySupplier.idl>
28cdf0e10cSrcweir#include <com/sun/star/lang/Locale.idl>
29cdf0e10cSrcweir
30cdf0e10cSrcweir//=============================================================================
31cdf0e10cSrcweir
32cdf0e10cSrcweirmodule com { module sun { module star { module i18n {
33cdf0e10cSrcweir
34cdf0e10cSrcweir//=============================================================================
35cdf0e10cSrcweir
36cdf0e10cSrcweir
37cdf0e10cSrcweir/**
38cdf0e10cSrcweir    This interface provides information for creating "Table of Index"
39cdf0e10cSrcweir
40cdf0e10cSrcweir    <p> It is derived from
41cdf0e10cSrcweir    <type scope="::com::sun::star::i18n">XIndexEntrySupplier</type> and
42cdf0e10cSrcweir    provides following additional functionalities.</p>
43cdf0e10cSrcweir    <ul>
44cdf0e10cSrcweir    <li>Provide supported language/locale list.
45cdf0e10cSrcweir    <li>Provide supported algorithm list.
46cdf0e10cSrcweir    <li>Provide phonetic entry support for CJK languge.
47cdf0e10cSrcweir    <li>Provide method to compare index entry.
48cdf0e10cSrcweir    </ul>
49cdf0e10cSrcweir
50*d695a2a0SJürgen Schmidt	 @since OpenOffice 1.1.2
51cdf0e10cSrcweir */
52cdf0e10cSrcweirpublished interface XExtendedIndexEntrySupplier : ::com::sun::star::i18n::XIndexEntrySupplier
53cdf0e10cSrcweir{
54cdf0e10cSrcweir    //-------------------------------------------------------------------------
55cdf0e10cSrcweir    /**
56cdf0e10cSrcweir        Returns locale list for which the IndexEntrySupplier provides service.
57cdf0e10cSrcweir     */
58cdf0e10cSrcweir    sequence < com::sun::star::lang::Locale > getLocaleList();
59cdf0e10cSrcweir
60cdf0e10cSrcweir    //-------------------------------------------------------------------------
61cdf0e10cSrcweir    /**
62cdf0e10cSrcweir        Returns index algorithm list for specific locale
63cdf0e10cSrcweir     */
64cdf0e10cSrcweir    sequence < string > getAlgorithmList(
65cdf0e10cSrcweir                        [in] com::sun::star::lang::Locale aLocale );
66cdf0e10cSrcweir
67cdf0e10cSrcweir    //-------------------------------------------------------------------------
68cdf0e10cSrcweir    /**
69cdf0e10cSrcweir        Checks if Phonetic Entry should be used for the locale.
70cdf0e10cSrcweir     */
71cdf0e10cSrcweir    boolean usePhoneticEntry( [in] com::sun::star::lang::Locale aLocale);
72cdf0e10cSrcweir
73cdf0e10cSrcweir    //-------------------------------------------------------------------------
74cdf0e10cSrcweir    /**
75cdf0e10cSrcweir        Returns phonetic candidate for index entry for the locale.
76cdf0e10cSrcweir     */
77cdf0e10cSrcweir    string getPhoneticCandidate( [in] string aIndexEntry,
78cdf0e10cSrcweir                    [in] com::sun::star::lang::Locale aLocale);
79cdf0e10cSrcweir
80cdf0e10cSrcweir    //-------------------------------------------------------------------------
81cdf0e10cSrcweir    /**
82cdf0e10cSrcweir        Loads index algorithm for the locale.
83cdf0e10cSrcweir
84cdf0e10cSrcweir        @param aIndexAlgorithm
85cdf0e10cSrcweir            Index algorithm to be loaded.
86cdf0e10cSrcweir
87cdf0e10cSrcweir        @param nCollatorOptions
88cdf0e10cSrcweir            Sorting option of <type
89cdf0e10cSrcweir            scope="::com::sun::star::i18n">CollatorOptions</type> for
90cdf0e10cSrcweir            comparing index entries
91cdf0e10cSrcweir
92cdf0e10cSrcweir        @return
93cdf0e10cSrcweir            <TRUE/> if algorithm successfully loaded,
94cdf0e10cSrcweir            <FALSE/> else.
95cdf0e10cSrcweir     */
96cdf0e10cSrcweir    boolean loadAlgorithm( [in] com::sun::star::lang::Locale aLocale,
97cdf0e10cSrcweir                    [in] string aIndexAlgorithm,
98cdf0e10cSrcweir                    [in] long nCollatorOptions );
99cdf0e10cSrcweir
100cdf0e10cSrcweir    //-------------------------------------------------------------------------
101cdf0e10cSrcweir    /**
102cdf0e10cSrcweir        Returns index key.
103cdf0e10cSrcweir
104cdf0e10cSrcweir        <p> Note that loadAlgorithm should be called before calling
105cdf0e10cSrcweir        this function. </p>
106cdf0e10cSrcweir
107cdf0e10cSrcweir        @param aIndexEntry
108cdf0e10cSrcweir            Index entry
109cdf0e10cSrcweir
110cdf0e10cSrcweir        @param aPhoneticEntry
111cdf0e10cSrcweir            Phonetic entry
112cdf0e10cSrcweir
113cdf0e10cSrcweir        @param aLocale
114cdf0e10cSrcweir            Language attribute for index and phonetic entry. <br/>
115cdf0e10cSrcweir            aLocale and the locale in loadAlgorithm may be different.
116cdf0e10cSrcweir            In the case they are different, phonetic entry will not
117cdf0e10cSrcweir            be used in the index key generation.
118cdf0e10cSrcweir     */
119cdf0e10cSrcweir    string getIndexKey( [in] string aIndexEntry, [in] string aPhoneticEntry,
120cdf0e10cSrcweir                    [in] com::sun::star::lang::Locale aLocale );
121cdf0e10cSrcweir
122cdf0e10cSrcweir    //-------------------------------------------------------------------------
123cdf0e10cSrcweir    /**
124cdf0e10cSrcweir        Compares index entries
125cdf0e10cSrcweir
126cdf0e10cSrcweir        <p> Note that loadAlgorithm should be called before calling
127cdf0e10cSrcweir        this function. </p>
128cdf0e10cSrcweir
129cdf0e10cSrcweir        @param aIndexEntry1
130cdf0e10cSrcweir        @param aIndexEntry2
131cdf0e10cSrcweir            Index entries to be compared
132cdf0e10cSrcweir
133cdf0e10cSrcweir        @param aPhoneticEntry1
134cdf0e10cSrcweir        @param aPhoneticEntry2
135cdf0e10cSrcweir            Phonetic entries to be compared
136cdf0e10cSrcweir
137cdf0e10cSrcweir        @param aLocale1
138cdf0e10cSrcweir        @param aLocale2
139cdf0e10cSrcweir            Language attribute for index and phonetic entry. <br/>
140cdf0e10cSrcweir            aLocale and the locale in loadAlgorithm may be different.
141cdf0e10cSrcweir            In the case they are different, phonetic entry will not
142cdf0e10cSrcweir            be used in the index key generation.
143cdf0e10cSrcweir     */
144cdf0e10cSrcweir    short compareIndexEntry( [in] string aIndexEntry1, [in] string aPhoneticEntry1,
145cdf0e10cSrcweir                    [in] com::sun::star::lang::Locale aLocale1,
146cdf0e10cSrcweir                    [in] string aIndexEntry2, [in] string aPhoneticEntry2,
147cdf0e10cSrcweir                    [in] com::sun::star::lang::Locale aLocale2 );
148cdf0e10cSrcweir};
149cdf0e10cSrcweir
150cdf0e10cSrcweir//=============================================================================
151cdf0e10cSrcweir}; }; }; };
152cdf0e10cSrcweir
153cdf0e10cSrcweir#endif
154