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: XDictionary.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_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
>
37 #ifndef __com_sun_star_lang_Locale_idl__
38 #include
<com
/sun
/star
/lang
/Locale.idl
>
41 #ifndef __com_sun_star_linguistic2_DictionaryType_idl__
42 #include
<com
/sun
/star
/linguistic2
/DictionaryType.idl
>
45 #ifndef __com_sun_star_linguistic2_XDictionaryEntry_idl__
46 #include
<com
/sun
/star
/linguistic2
/XDictionaryEntry.idl
>
49 #ifndef __com_sun_star_linguistic2_XDictionaryEventListener_idl__
50 #include
<com
/sun
/star
/linguistic2
/XDictionaryEventListener.idl
>
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
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.
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 .
92 <TRUE/> if the dictionary should be used, <FALSE/> otherwise.
95 void setActive
( [in] boolean bActivate
);
97 //-------------------------------------------------------------------------
100 <TRUE/> if the dictionary is active, <FALSE/> otherwise.
104 //-------------------------------------------------------------------------
107 the number of entries in the dictionary.
111 //-------------------------------------------------------------------------
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.
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.
134 the reference to the entry found. If no entry was found,
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>
154 the entry to be added.
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>
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>
175 the word to be added.
178 specifies whether the entry will be a negative one or not.
181 in the case of a negative entry, this is the replacement text to
182 be used when replacing aWord. Otherwise, it is undefined.
185 <TRUE/> if the entry was successfully added, <FALSE/> otherwise.
187 @see <type scope="com::sun::star::linguistic2">DictionaryType</type>
191 [in] boolean bIsNegative
,
192 [in] string aRplcText
);
194 //-------------------------------------------------------------------------
195 /** removes an entry from the dictionary.
198 the word matching the entry to be removed.
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 //-------------------------------------------------------------------------
209 <TRUE/> if the dictionary is full and no further
210 entry can be made, <FALSE/> otherwise.
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>
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>
227 sequence
<com
::sun
::star
::linguistic2
::XDictionaryEntry
> getEntries
();
229 //-------------------------------------------------------------------------
230 /** removes all entries from the dictionary.
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>
242 the entry to be made, that is, the object that wants notifications.
245 <TRUE/> if the entry was successfully made, <FALSE/> otherwise.
246 If <member scope="com::sun::star::lang">XEventListener::disposing</member> was called before,
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.
259 the reference to the listening object to be removed.
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 //=============================================================================