merged tag ooo/OOO330_m14
[LibreOffice.git] / offapi / com / sun / star / i18n / XCollator.idl
blob72d32886c299b8cb814091bd851ef90bffd3e522
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
27 #ifndef __com_sun_star_i18n_XCollator_idl__
28 #define __com_sun_star_i18n_XCollator_idl__
30 #include <com/sun/star/uno/Exception.idl>
31 #include <com/sun/star/uno/XInterface.idl>
32 #include <com/sun/star/lang/Locale.idl>
33 //=============================================================================
35 module com { module sun { module star { module i18n {
37 /** provides locale-sensitive collation algorithms for string comparison.
40 published interface XCollator: com::sun::star::uno::XInterface
42 //-------------------------------------------------------------------------
43 /** Compare 2 substrings in specific locale and algorithm.
45 @param aStr1
46 First string.
48 @param nOff1
49 Offset (from 0) of the first string.
51 @param nLen1
52 Length (from offset) of the first substring.
54 @param aStr2
55 Second string
57 @param nOff2
58 Offset (from 0) of the second string.
60 @param nLen2
61 Length (from offset) of the second substring.
63 @returns
64 1 if the first string is greater than the second string <br/>
65 0 if the first string is equal to the second string <br/>
66 -1 if the first string is less than the second string
68 long compareSubstring( [in] string aStr1, [in] long nOff1, [in] long nLen1,
69 [in] string aStr2, [in] long nOff2, [in] long nLen2 );
71 //-------------------------------------------------------------------------
72 /** Compare 2 strings in specific locale and algorithm.
74 @param aStr1
75 First string.
77 @param aStr2
78 Second string.
80 @returns
81 1 if the first string is greater than the second string <br/>
82 0 if the first string is equal to the second string <br/>
83 -1 if the first string is less than the second string
85 long compareString( [in] string aStr1, [in] string aStr2 );
87 //-------------------------------------------------------------------------
88 /** Load the collator with default algorithm defined in
89 locale data.
91 @param aLocale
92 The locale for this collator.
94 @param nCollatorOptions
95 A mask of <type>CollatorOptions</type>.
97 @returns
98 Returns 0 when loading was successful,
99 otherwise throws runtime exception. In fact the return value
100 should be ignored and the exception be caught instead.
102 long loadDefaultCollator( [in] ::com::sun::star::lang::Locale aLocale,
103 [in] long nCollatorOptions );
105 //-------------------------------------------------------------------------
106 /** Load a particular collator algorithm for the locale.
108 @param aAlgorithmName
109 The algorithm to load.
111 @param aLocale
112 The locale for this collator.
114 @param nCollatorOptions
115 A mask of <type>CollatorOptions</type>.
117 @returns
118 Returns 0 when loading was successful,
119 otherwise throws runtime exception.
121 long loadCollatorAlgorithm( [in] string aAlgorithmName,
122 [in] ::com::sun::star::lang::Locale aLocale,
123 [in] long nCollatorOptions );
125 //-------------------------------------------------------------------------
126 /** List all collator algorithms for a given locale.
128 @param aLocale
129 The locale for which to list algorithms.
131 @returns
132 A sequence of algorithm names.
134 sequence <string> listCollatorAlgorithms(
135 [in] ::com::sun::star::lang::Locale aLocale );
137 //-------------------------------------------------------------------------
138 /** Load a collator algorithm with options chosen by end user.
140 @param aAlgorithmName
141 The algorithm name to load.
143 @param aLocale
144 The locale for this collator.
146 @param aCollatorOptions
147 A sequence of end user collator options like those returned
148 by <member>XCollator::listCollatorOptions()</member>.
150 void loadCollatorAlgorithmWithEndUserOption(
151 [in] string aAlgorithmName,
152 [in] ::com::sun::star::lang::Locale aLocale,
153 [in] sequence<long> aCollatorOptions );
155 //-------------------------------------------------------------------------
156 /** List all end user collator options for a given algorithm.
158 @param aAlgorithmName
159 The algorithm name for this collator.
161 @returns
162 An array of end user options available for the algorithm.
164 sequence <long> listCollatorOptions( [in] string aAlgorithmName );
168 //=============================================================================
170 }; }; }; };
172 //=============================================================================
174 #endif