merge the formfield patch from ooo-build
[ooovba.git] / offapi / com / sun / star / linguistic2 / XDictionary.idl
blob4bf5c39a37d2f1fdd5861bf84dc82309d53ad42c
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: XDictionary.idl,v $
10 * $Revision: 1.12 $
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_XDictionary_idl__
31 #define __com_sun_star_linguistic2_XDictionary_idl__
33 #ifndef __com_sun_star_container_XNamed_idl__
34 #include <com/sun/star/container/XNamed.idl>
35 #endif
37 #ifndef __com_sun_star_lang_Locale_idl__
38 #include <com/sun/star/lang/Locale.idl>
39 #endif
41 #ifndef __com_sun_star_linguistic2_DictionaryType_idl__
42 #include <com/sun/star/linguistic2/DictionaryType.idl>
43 #endif
45 #ifndef __com_sun_star_linguistic2_XDictionaryEntry_idl__
46 #include <com/sun/star/linguistic2/XDictionaryEntry.idl>
47 #endif
49 #ifndef __com_sun_star_linguistic2_XDictionaryEventListener_idl__
50 #include <com/sun/star/linguistic2/XDictionaryEventListener.idl>
51 #endif
53 //=============================================================================
55 module com { module sun { module star { module linguistic2 {
57 //=============================================================================
58 /** This interfaces enables the object to access personal dictionaries.
60 <P>Personal dictionaries are used to supply additional
61 information for spellchecking and hyphenation (see
62 <type scope="com::sun::star::linguistic2">XDictionaryEntry</type>).
63 Only active dictionaries with an appropriate language are used
64 for that purpose.
65 The entries of an active, positive dictionary are words that are
66 required to be recognized as correct during the spellchecking
67 process. Additionally, they will be used for hyphenation.
68 Entries of a negative dictionary are required to be recognized
69 as negative words, for example, words that should not be used, during
70 spellcheck. An entry in a negative dictionary may supply a
71 proposal for a word to be used instead of the one being used.</P>
73 @see <type scope="com::sun::star::linguistic2">XDictionaryEvent</type>
74 @see <type scope="com::sun::star::container">XNamed</type>
76 published interface XDictionary : com::sun::star::container::XNamed
78 //-------------------------------------------------------------------------
79 /** returns the type of the dictionary.
81 @returns
82 the type of the dictionary.
84 @see <type scope="com::sun::star::linguistic2">DictionaryType</type>
86 com::sun::star::linguistic2::DictionaryType getDictionaryType();
88 //-------------------------------------------------------------------------
89 /** specifies whether the dictionary should be used or not .
91 @param bAcvtivate
92 <TRUE/> if the dictionary should be used, <FALSE/> otherwise.
95 void setActive( [in] boolean bActivate );
97 //-------------------------------------------------------------------------
98 /**
99 @returns
100 <TRUE/> if the dictionary is active, <FALSE/> otherwise.
102 boolean isActive();
104 //-------------------------------------------------------------------------
106 @returns
107 the number of entries in the dictionary.
109 long getCount();
111 //-------------------------------------------------------------------------
113 @returns
114 the language of the dictionary.
116 @see <type scope="com::sun::star::lang">Locale</type>
118 com::sun::star::lang::Locale getLocale();
120 //-------------------------------------------------------------------------
121 /** is used to set the language of the dictionary.
123 @param aLocale
124 the new language of the dictionary.
126 @see <type scope="com::sun::star::lang">Locale</type>
128 void setLocale( [in] com::sun::star::lang::Locale aLocale );
130 //-------------------------------------------------------------------------
131 /** searches for an entry that matches the given word.
133 @returns
134 the reference to the entry found. If no entry was found,
135 it is NULL.
137 @param aWord
138 the word to be looked for.
140 @see <type scope="com::sun::star::linguistic2">XDictionaryEntry</type>
142 com::sun::star::linguistic2::XDictionaryEntry getEntry( [in] string aWord );
144 //-------------------------------------------------------------------------
145 /** is used to add an entry to the dictionary.
147 <P>If an entry already exists, the dictionary remains unchanged
148 and <FALSE/> will be returned.</P>
150 <P>In positive dictionaries only postive entries
151 can be made, and in negative ones only negative entries.</P>
153 @param xDicEntry
154 the entry to be added.
156 @returns
157 <TRUE/> if the entry was successfully added <FALSE/> otherwise.
159 @see <type scope="com::sun::star::linguistic2">XDictionaryEntry</type>
160 @see <type scope="com::sun::star::linguistic2">DictionaryType</type>
162 boolean addEntry(
163 [in] com::sun::star::linguistic2::XDictionaryEntry xDicEntry );
165 //-------------------------------------------------------------------------
166 /** is used to make an entry in the dictionary.
168 <P>If an entry already exists, the dictionary remains unchanged
169 and <FALSE/> will be returned.</P>
171 <P>In positive dictionaries only postive entries
172 can be made, and in negative ones only negative entries.</P>
174 @param aWord
175 the word to be added.
177 @param bIsNegative
178 specifies whether the entry will be a negative one or not.
180 @param aRplcText
181 in the case of a negative entry, this is the replacement text to
182 be used when replacing aWord. Otherwise, it is undefined.
184 @returns
185 <TRUE/> if the entry was successfully added, <FALSE/> otherwise.
187 @see <type scope="com::sun::star::linguistic2">DictionaryType</type>
189 boolean add(
190 [in] string aWord,
191 [in] boolean bIsNegative,
192 [in] string aRplcText );
194 //-------------------------------------------------------------------------
195 /** removes an entry from the dictionary.
197 @param aWord
198 the word matching the entry to be removed.
200 @returns
201 <TRUE/> if the entry was successfully removed, <FALSE/>
202 otherwise (especially if the entry was not found).
204 boolean remove( [in] string aWord );
206 //-------------------------------------------------------------------------
208 @returns
209 <TRUE/> if the dictionary is full and no further
210 entry can be made, <FALSE/> otherwise.
212 boolean isFull();
214 //-------------------------------------------------------------------------
216 <p>This function should no longer be used since with the expansion of the
217 maximum number of allowed entries the result may become unreasonable large!</p>
219 @returns
220 a sequence with all the entries of the dictionary.
222 @see <type scope="com::sun::star::linguistic2">XDictionaryEntry</type>
223 @see <type scope="com::sun::star::linguistic2">XSearchableDictionary</type>
224 @deprecated
227 sequence<com::sun::star::linguistic2::XDictionaryEntry> getEntries();
229 //-------------------------------------------------------------------------
230 /** removes all entries from the dictionary.
232 void clear();
234 //-------------------------------------------------------------------------
235 /** adds an entry to the list of dictionary event listeners.
237 <P>On dictionary events, each entry in the listener list will
238 be notified via a call to
239 <member scope="com::sun::star::linguistic2">XDictionaryEventListener::processDictionaryEvent</member>.</P>
241 @param xListener
242 the entry to be made, that is, the object that wants notifications.
244 @returns
245 <TRUE/> if the entry was successfully made, <FALSE/> otherwise.
246 If <member scope="com::sun::star::lang">XEventListener::disposing</member> was called before,
247 it will always fail.
249 @see <member scope="com::sun::star::linguistic2">XDictionary::removeDictionaryEventListener</member>
250 @see <type scope="com::sun::star::linguistic2">XDictionaryEventListener</type>
252 boolean addDictionaryEventListener(
253 [in] com::sun::star::linguistic2::XDictionaryEventListener xListener );
255 //-------------------------------------------------------------------------
256 /** removes an entry from the list of dictionary event listeners.
258 @param xListener
259 the reference to the listening object to be removed.
261 @returns
262 <TRUE/> if the object to be removed was found and removed,
263 <FALSE/> if the object was not found in the list.
265 @see <member scope="com::sun::star::linguistic2">XDictionary::addDictionaryEventListener</member>
266 @see <type scope="com::sun::star::linguistic2">XDictionaryEventListener</type>
268 boolean removeDictionaryEventListener(
269 [in] com::sun::star::linguistic2::XDictionaryEventListener xListener );
273 //=============================================================================
275 }; }; }; };
277 #endif