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.
49 Offset (from 0) of the first string.
52 Length (from offset) of the first substring.
58 Offset (from 0) of the second string.
61 Length (from offset) of the second substring.
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.
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
92 The locale for this collator.
94 @param nCollatorOptions
95 A mask of <type>CollatorOptions</type>.
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.
112 The locale for this collator.
114 @param nCollatorOptions
115 A mask of <type>CollatorOptions</type>.
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.
129 The locale for which to list algorithms.
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.
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.
162 An array of end user options available for the algorithm.
164 sequence
<long> listCollatorOptions
( [in] string aAlgorithmName
);
168 //=============================================================================
172 //=============================================================================