merge the formfield patch from ooo-build
[ooovba.git] / offapi / com / sun / star / linguistic2 / XConversionDictionary.idl
blobffdc6ff76416a0d96a5c6985063c595a7abb7538
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XConversionDictionary.idl,v $
10 * $Revision: 1.10 $
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>
36 #endif
38 #ifndef __com_sun_star_lang_Locale_idl__
39 #include <com/sun/star/lang/Locale.idl>
40 #endif
42 #ifndef __com_sun_star_linguistic2_ConversionDictionaryType_idl__
43 #include <com/sun/star/linguistic2/ConversionDictionaryType.idl>
44 #endif
46 #ifndef __com_sun_star_linguistic2_ConversionDirection_idl__
47 #include <com/sun/star/linguistic2/ConversionDirection.idl>
48 #endif
50 #ifndef __com_sun_star_lang_IllegalArgumentException_idl__
51 #include <com/sun/star/lang/IllegalArgumentException.idl>
52 #endif
54 #ifndef __com_sun_star_container_ElementExistException_idl__
55 #include <com/sun/star/container/ElementExistException.idl>
56 #endif
58 #ifndef __com_sun_star_container_NoSuchElementException_idl__
59 #include <com/sun/star/container/NoSuchElementException.idl>
60 #endif
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
75 directions.</p>
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
83 @since OOo 1.1.2
85 published interface XConversionDictionary : com::sun::star::uno::XInterface
87 //-------------------------------------------------------------------------
88 /**
89 @returns
90 the name of the dictionary.
92 string getName();
94 //-------------------------------------------------------------------------
95 /**
96 @returns
97 the language supported by the dictionary.
99 @see com::sun::star::lang::Locale
101 com::sun::star::lang::Locale getLocale();
103 //-------------------------------------------------------------------------
105 @returns
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 .
115 @param bAcvtivate
116 <TRUE/> if the dictionary should be used, <FALSE/> otherwise.
119 void setActive( [in] boolean bActivate );
121 //-------------------------------------------------------------------------
123 @returns
124 <TRUE/> if the dictionary is active, <FALSE/> otherwise.
126 boolean isActive();
128 //-------------------------------------------------------------------------
129 /** removes all entries from the dictionary.
131 void clear();
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
138 length nLength.</p>
140 @returns
141 the list of conversions found for the supplied text.
142 If no nothing was found, it is empty.
144 @param aText
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.
148 @param nStartPos
149 the starting pos of the substring to be looked for.
150 @param nLength
151 the length of the substring to be looked for.
153 @param eConversionDirection
154 specifies the direction of the conversion to look for.
155 It is one of
156 <type scope="com::sun::star::linguistic2">ConversionDirection</type>.
158 @param nTextConversionOptions
159 Combination of <type scope="com::sun::star::i18n">TextConversionOption</type>
160 values.
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(
167 [in] string aText,
168 [in] long nStartPos,
169 [in] long nLength,
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.
177 @param aLeftText
178 the left text of the pair to be added.
180 @param aRightText
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.
191 void addEntry(
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.
200 @param aLeftText
201 the left text of the pair to be removed.
203 @param aRightText
204 the right text of the pair to be removed.
206 @throws com::sun::star::container::NoSuchElementException
207 if there is no such entry.
209 void removeEntry(
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
216 in entries.
218 @param eDirection
219 specifies if the left text or the right text of entries will
220 be used.
222 @see com::sun::star::linguistic2::ConversionDirection
224 short getMaxCharCount(
225 [in] com::sun::star::linguistic2::ConversionDirection eDirection );
227 //-------------------------------------------------------------------------
228 /**
229 @returns
230 a list of all left or right parts of the dictionaries entries.
231 @param eDirection
232 specifies if all left or all right parts of the entries
233 should be returned.
236 sequence< string > getConversionEntries(
237 [in] com::sun::star::linguistic2::ConversionDirection eDirection );
241 //=============================================================================
243 }; }; }; };
245 #endif