1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef __com_sun_star_linguistic2_XDictionary_idl__
20 #define __com_sun_star_linguistic2_XDictionary_idl__
22 #include
<com
/sun
/star
/container
/XNamed.idl
>
23 #include
<com
/sun
/star
/lang
/Locale.idl
>
24 #include
<com
/sun
/star
/linguistic2
/DictionaryType.idl
>
25 #include
<com
/sun
/star
/linguistic2
/XDictionaryEntry.idl
>
26 #include
<com
/sun
/star
/linguistic2
/XDictionaryEventListener.idl
>
29 module com
{ module sun
{ module star
{ module linguistic2
{
31 /** This interfaces enables the object to access personal dictionaries.
33 <P>Personal dictionaries are used to supply additional
34 information for spell checking and hyphenation (see
35 com::sun::star::linguistic2::XDictionaryEntry).
36 Only active dictionaries with an appropriate language are used
38 The entries of an active, positive dictionary are words that are
39 required to be recognized as correct during the spell checking
40 process. Additionally, they will be used for hyphenation.
41 Entries of a negative dictionary are required to be recognized
42 as negative words, for example, words that should not be used, during
43 SPELLCHECK. An entry in a negative dictionary may supply a
44 proposal for a word to be used instead of the one being used.</P>
46 @see com::sun::star::linguistic2::XDictionaryEvent
47 @see com::sun::star::container::XNamed
49 published
interface XDictionary
: com
::sun
::star
::container
::XNamed
51 /** returns the type of the dictionary.
54 the type of the dictionary.
56 @see com::sun::star::linguistic2::DictionaryType
58 com
::sun
::star
::linguistic2
::DictionaryType getDictionaryType
();
60 /** specifies whether the dictionary should be used or not .
63 `TRUE` if the dictionary should be used, `FALSE` otherwise.
66 void setActive
( [in] boolean bActivate
);
70 `TRUE` if the dictionary is active, `FALSE` otherwise.
76 the number of entries in the dictionary.
82 the language of the dictionary.
84 @see com::sun::star::lang::Locale
86 com
::sun
::star
::lang
::Locale getLocale
();
88 /** is used to set the language of the dictionary.
91 the new language of the dictionary.
93 @see com::sun::star::lang::Locale
95 void setLocale
( [in] com
::sun
::star
::lang
::Locale aLocale
);
97 /** searches for an entry that matches the given word.
100 the reference to the entry found. If no entry was found,
104 the word to be looked for.
106 @see com::sun::star::linguistic2::XDictionaryEntry
108 com
::sun
::star
::linguistic2
::XDictionaryEntry getEntry
( [in] string aWord
);
110 /** is used to add an entry to the dictionary.
112 <P>If an entry already exists, the dictionary remains unchanged
113 and `FALSE` will be returned.</P>
115 <P>In positive dictionaries only positive entries
116 can be made, and in negative ones only negative entries.</P>
119 the entry to be added.
122 `TRUE` if the entry was successfully added `FALSE` otherwise.
124 @see com::sun::star::linguistic2::XDictionaryEntry
125 @see com::sun::star::linguistic2::DictionaryType
128 [in] com
::sun
::star
::linguistic2
::XDictionaryEntry xDicEntry
);
130 /** is used to make an entry in the dictionary.
132 <P>If an entry already exists, the dictionary remains unchanged
133 and `FALSE` will be returned.</P>
135 <P>In positive dictionaries only positive entries
136 can be made, and in negative ones only negative entries.</P>
139 the word to be added.
142 specifies whether the entry will be a negative one or not.
145 in the case of a negative entry, this is the replacement text to
146 be used when replacing aWord. Otherwise, it is undefined.
149 `TRUE` if the entry was successfully added, `FALSE` otherwise.
151 @see com::sun::star::linguistic2::DictionaryType
155 [in] boolean bIsNegative
,
156 [in] string aRplcText
);
158 /** removes an entry from the dictionary.
161 the word matching the entry to be removed.
164 `TRUE` if the entry was successfully removed, `FALSE`
165 otherwise (especially if the entry was not found).
167 boolean remove
( [in] string aWord
);
171 `TRUE` if the dictionary is full and no further
172 entry can be made, `FALSE` otherwise.
177 <p>This function should no longer be used since with the expansion of the
178 maximum number of allowed entries the result may become unreasonable large!</p>
181 a sequence with all the entries of the dictionary.
183 @see com::sun::star::linguistic2::XDictionaryEntry
184 @see com::sun::star::linguistic2::XSearchableDictionary
188 sequence
<com
::sun
::star
::linguistic2
::XDictionaryEntry
> getEntries
();
190 /** removes all entries from the dictionary.
194 /** adds an entry to the list of dictionary event listeners.
196 <P>On dictionary events, each entry in the listener list will
197 be notified via a call to
198 com::sun::star::linguistic2::XDictionaryEventListener::processDictionaryEvent().</P>
201 the entry to be made, that is, the object that wants notifications.
204 `TRUE` if the entry was successfully made, `FALSE` otherwise.
205 If com::sun::star::lang::XEventListener::disposing() was called before,
208 @see com::sun::star::linguistic2::XDictionary::removeDictionaryEventListener()
209 @see com::sun::star::linguistic2::XDictionaryEventListener
211 boolean addDictionaryEventListener
(
212 [in] com
::sun
::star
::linguistic2
::XDictionaryEventListener xListener
);
214 /** removes an entry from the list of dictionary event listeners.
217 the reference to the listening object to be removed.
220 `TRUE` if the object to be removed was found and removed,
221 `FALSE` if the object was not found in the list.
223 @see com::sun::star::linguistic2::XDictionary::addDictionaryEventListener()
224 @see com::sun::star::linguistic2::XDictionaryEventListener
226 boolean removeDictionaryEventListener
(
227 [in] com
::sun
::star
::linguistic2
::XDictionaryEventListener xListener
);
236 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */