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: XCollator.idl,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 __com_sun_star_i18n_XCollator_idl__
31 #define __com_sun_star_i18n_XCollator_idl__
33 #include
<com
/sun
/star
/uno
/Exception.idl
>
34 #include
<com
/sun
/star
/uno
/XInterface.idl
>
35 #include
<com
/sun
/star
/lang
/Locale.idl
>
36 //=============================================================================
38 module com
{ module sun
{ module star
{ module i18n
{
40 /** provides locale-sensitive collation algorithms for string comparison.
43 published
interface XCollator
: com
::sun
::star
::uno
::XInterface
45 //-------------------------------------------------------------------------
46 /** Compare 2 substrings in specific locale and algorithm.
52 Offset (from 0) of the first string.
55 Length (from offset) of the first substring.
61 Offset (from 0) of the second string.
64 Length (from offset) of the second substring.
67 1 if the first string is greater than the second string <br/>
68 0 if the first string is equal to the second string <br/>
69 -1 if the first string is less than the second string
71 long compareSubstring
( [in] string aStr1
, [in] long nOff1
, [in] long nLen1
,
72 [in] string aStr2
, [in] long nOff2
, [in] long nLen2
);
74 //-------------------------------------------------------------------------
75 /** Compare 2 strings in specific locale and algorithm.
84 1 if the first string is greater than the second string <br/>
85 0 if the first string is equal to the second string <br/>
86 -1 if the first string is less than the second string
88 long compareString
( [in] string aStr1
, [in] string aStr2
);
90 //-------------------------------------------------------------------------
91 /** Load the collator with default algorithm defined in
95 The locale for this collator.
97 @param nCollatorOptions
98 A mask of <type>CollatorOptions</type>.
101 Returns 0 when loading was successful,
102 otherwise throws runtime exception. In fact the return value
103 should be ignored and the exception be caught instead.
105 long loadDefaultCollator
( [in] ::com
::sun
::star
::lang
::Locale aLocale
,
106 [in] long nCollatorOptions
);
108 //-------------------------------------------------------------------------
109 /** Load a particular collator algorithm for the locale.
111 @param aAlgorithmName
112 The algorithm to load.
115 The locale for this collator.
117 @param nCollatorOptions
118 A mask of <type>CollatorOptions</type>.
121 Returns 0 when loading was successful,
122 otherwise throws runtime exception.
124 long loadCollatorAlgorithm
( [in] string aAlgorithmName
,
125 [in] ::com
::sun
::star
::lang
::Locale aLocale
,
126 [in] long nCollatorOptions
);
128 //-------------------------------------------------------------------------
129 /** List all collator algorithms for a given locale.
132 The locale for which to list algorithms.
135 A sequence of algorithm names.
137 sequence
<string> listCollatorAlgorithms
(
138 [in] ::com
::sun
::star
::lang
::Locale aLocale
);
140 //-------------------------------------------------------------------------
141 /** Load a collator algorithm with options chosen by end user.
143 @param aAlgorithmName
144 The algorithm name to load.
147 The locale for this collator.
149 @param aCollatorOptions
150 A sequence of end user collator options like those returned
151 by <member>XCollator::listCollatorOptions()</member>.
153 void loadCollatorAlgorithmWithEndUserOption
(
154 [in] string aAlgorithmName
,
155 [in] ::com
::sun
::star
::lang
::Locale aLocale
,
156 [in] sequence
<long> aCollatorOptions
);
158 //-------------------------------------------------------------------------
159 /** List all end user collator options for a given algorithm.
161 @param aAlgorithmName
162 The algorithm name for this collator.
165 An array of end user options available for the algorithm.
167 sequence
<long> listCollatorOptions
( [in] string aAlgorithmName
);
171 //=============================================================================
175 //=============================================================================