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: XConversionDictionary.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_linguistic2_XConversionDictionary_idl__
31 #define __com_sun_star_linguistic2_XConversionDictionary_idl__
34 #ifndef __com_sun_star_uno_XInterface_idl__
35 #include
<com
/sun
/star
/uno
/XInterface.idl
>
38 #ifndef __com_sun_star_lang_Locale_idl__
39 #include
<com
/sun
/star
/lang
/Locale.idl
>
42 #ifndef __com_sun_star_linguistic2_ConversionDictionaryType_idl__
43 #include
<com
/sun
/star
/linguistic2
/ConversionDictionaryType.idl
>
46 #ifndef __com_sun_star_linguistic2_ConversionDirection_idl__
47 #include
<com
/sun
/star
/linguistic2
/ConversionDirection.idl
>
50 #ifndef __com_sun_star_lang_IllegalArgumentException_idl__
51 #include
<com
/sun
/star
/lang
/IllegalArgumentException.idl
>
54 #ifndef __com_sun_star_container_ElementExistException_idl__
55 #include
<com
/sun
/star
/container
/ElementExistException.idl
>
58 #ifndef __com_sun_star_container_NoSuchElementException_idl__
59 #include
<com
/sun
/star
/container
/NoSuchElementException.idl
>
63 //=============================================================================
65 module com
{ module sun
{ module star
{ module linguistic2
{
67 //=============================================================================
68 /** Allows the user to access a conversion dictionary.
70 <p>The dictionary consists of entries (pairs) of the form
71 ( aLeftText, aRightText ).
72 Those pairs can be added and removed. Also it can be looked
73 for all entries where the left text or the right text matches
74 a given text. Thus it can be used for conversions in both
77 <p>Restrictions to what has to be the left and right text are usually
78 given by specific services implementing this interface.</p>
80 @see com::sun::star::linguistic2::ConversionDictionary
81 @see com::sun::star::linguistic2::HangulHanjaConversionDictionary
85 published
interface XConversionDictionary
: com
::sun
::star
::uno
::XInterface
87 //-------------------------------------------------------------------------
90 the name of the dictionary.
94 //-------------------------------------------------------------------------
97 the language supported by the dictionary.
99 @see com::sun::star::lang::Locale
101 com
::sun
::star
::lang
::Locale getLocale
();
103 //-------------------------------------------------------------------------
106 the conversion type supported by the dictionary.
108 @see com::sun::star::linguistic2::ConversionDictionaryType
110 short getConversionType
();
112 //-------------------------------------------------------------------------
113 /** specifies whether the dictionary should be used or not .
116 <TRUE/> if the dictionary should be used, <FALSE/> otherwise.
119 void setActive
( [in] boolean bActivate
);
121 //-------------------------------------------------------------------------
124 <TRUE/> if the dictionary is active, <FALSE/> otherwise.
128 //-------------------------------------------------------------------------
129 /** removes all entries from the dictionary.
133 //-------------------------------------------------------------------------
134 /** searches for entries or conversions that match the given text.
136 <p>The exact string to be looked for is the substring from the
137 aText parameter that starts at position nStartPos and has the
141 the list of conversions found for the supplied text.
142 If no nothing was found, it is empty.
145 the text where the substring to be looked for will be taken from.
146 Depending on the conversion direction parameter it specifies
147 either the left text or the right text to look for.
149 the starting pos of the substring to be looked for.
151 the length of the substring to be looked for.
153 @param eConversionDirection
154 specifies the direction of the conversion to look for.
156 <type scope="com::sun::star::linguistic2">ConversionDirection</type>.
158 @param nTextConversionOptions
159 Combination of <type scope="com::sun::star::i18n">TextConversionOption</type>
162 @throws com::sun::star::lang::IllegalArgumentException
163 if the locale is not supported by the dictionary or if
164 nTextConversionOptions is invalid for the given locale.
166 sequence
< string > getConversions
(
170 [in] com
::sun
::star
::linguistic2
::ConversionDirection eDirection
,
171 [in] long nTextConversionOptions
)
172 raises
( com
::sun
::star
::lang
::IllegalArgumentException
);
174 //-------------------------------------------------------------------------
175 /** is used to add a conversion pair to the dictionary.
178 the left text of the pair to be added.
181 the right text of the pair to be added.
183 @throws com::sun::star::lang::IllegalArgumentException
184 if the arguments are invalid.
185 For example if the specifications defined by the service
186 implementing this object are not met.
188 @throws com::sun::star::container::ElementExistException
189 if such an entry already exists.
192 [in] string aLeftText
,
193 [in] string aRightText
)
194 raises
( com
::sun
::star
::lang
::IllegalArgumentException
,
195 com
::sun
::star
::container
::ElementExistException
);
197 //-------------------------------------------------------------------------
198 /** removes a conversion pair from the dictionary.
201 the left text of the pair to be removed.
204 the right text of the pair to be removed.
206 @throws com::sun::star::container::NoSuchElementException
207 if there is no such entry.
210 [in] string aLeftText
,
211 [in] string aRightText
)
212 raises
( com
::sun
::star
::container
::NoSuchElementException
);
214 //-------------------------------------------------------------------------
215 /** returns the maximum number of characters used as left or right text
219 specifies if the left text or the right text of entries will
222 @see com::sun::star::linguistic2::ConversionDirection
224 short getMaxCharCount
(
225 [in] com
::sun
::star
::linguistic2
::ConversionDirection eDirection
);
227 //-------------------------------------------------------------------------
230 a list of all left or right parts of the dictionaries entries.
232 specifies if all left or all right parts of the entries
236 sequence
< string > getConversionEntries
(
237 [in] com
::sun
::star
::linguistic2
::ConversionDirection eDirection
);
241 //=============================================================================