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 __com_sun_star_i18n_XExtendedIndexEntrySupplier_idl__
25#define __com_sun_star_i18n_XExtendedIndexEntrySupplier_idl__
26
27#include <com/sun/star/i18n/XIndexEntrySupplier.idl>
28#include <com/sun/star/lang/Locale.idl>
29
30//=============================================================================
31
32module com { module sun { module star { module i18n {
33
34//=============================================================================
35
36
37/**
38    This interface provides information for creating "Table of Index"
39
40    <p> It is derived from
41    <type scope="::com::sun::star::i18n">XIndexEntrySupplier</type> and
42    provides following additional functionalities.</p>
43    <ul>
44    <li>Provide supported language/locale list.
45    <li>Provide supported algorithm list.
46    <li>Provide phonetic entry support for CJK languge.
47    <li>Provide method to compare index entry.
48    </ul>
49
50	 @since OpenOffice 1.1.2
51 */
52published interface XExtendedIndexEntrySupplier : ::com::sun::star::i18n::XIndexEntrySupplier
53{
54    //-------------------------------------------------------------------------
55    /**
56        Returns locale list for which the IndexEntrySupplier provides service.
57     */
58    sequence < com::sun::star::lang::Locale > getLocaleList();
59
60    //-------------------------------------------------------------------------
61    /**
62        Returns index algorithm list for specific locale
63     */
64    sequence < string > getAlgorithmList(
65                        [in] com::sun::star::lang::Locale aLocale );
66
67    //-------------------------------------------------------------------------
68    /**
69        Checks if Phonetic Entry should be used for the locale.
70     */
71    boolean usePhoneticEntry( [in] com::sun::star::lang::Locale aLocale);
72
73    //-------------------------------------------------------------------------
74    /**
75        Returns phonetic candidate for index entry for the locale.
76     */
77    string getPhoneticCandidate( [in] string aIndexEntry,
78                    [in] com::sun::star::lang::Locale aLocale);
79
80    //-------------------------------------------------------------------------
81    /**
82        Loads index algorithm for the locale.
83
84        @param aIndexAlgorithm
85            Index algorithm to be loaded.
86
87        @param nCollatorOptions
88            Sorting option of <type
89            scope="::com::sun::star::i18n">CollatorOptions</type> for
90            comparing index entries
91
92        @return
93            <TRUE/> if algorithm successfully loaded,
94            <FALSE/> else.
95     */
96    boolean loadAlgorithm( [in] com::sun::star::lang::Locale aLocale,
97                    [in] string aIndexAlgorithm,
98                    [in] long nCollatorOptions );
99
100    //-------------------------------------------------------------------------
101    /**
102        Returns index key.
103
104        <p> Note that loadAlgorithm should be called before calling
105        this function. </p>
106
107        @param aIndexEntry
108            Index entry
109
110        @param aPhoneticEntry
111            Phonetic entry
112
113        @param aLocale
114            Language attribute for index and phonetic entry. <br/>
115            aLocale and the locale in loadAlgorithm may be different.
116            In the case they are different, phonetic entry will not
117            be used in the index key generation.
118     */
119    string getIndexKey( [in] string aIndexEntry, [in] string aPhoneticEntry,
120                    [in] com::sun::star::lang::Locale aLocale );
121
122    //-------------------------------------------------------------------------
123    /**
124        Compares index entries
125
126        <p> Note that loadAlgorithm should be called before calling
127        this function. </p>
128
129        @param aIndexEntry1
130        @param aIndexEntry2
131            Index entries to be compared
132
133        @param aPhoneticEntry1
134        @param aPhoneticEntry2
135            Phonetic entries to be compared
136
137        @param aLocale1
138        @param aLocale2
139            Language attribute for index and phonetic entry. <br/>
140            aLocale and the locale in loadAlgorithm may be different.
141            In the case they are different, phonetic entry will not
142            be used in the index key generation.
143     */
144    short compareIndexEntry( [in] string aIndexEntry1, [in] string aPhoneticEntry1,
145                    [in] com::sun::star::lang::Locale aLocale1,
146                    [in] string aIndexEntry2, [in] string aPhoneticEntry2,
147                    [in] com::sun::star::lang::Locale aLocale2 );
148};
149
150//=============================================================================
151}; }; }; };
152
153#endif
154