Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / offapi / com / sun / star / linguistic2 / XDictionary.idl
blobc184642c769d744f492c872bd13930659c8db1f7
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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
37 for that purpose.
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.
53 @returns
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 .
62 @param bActivate
63 `TRUE` if the dictionary should be used, `FALSE` otherwise.
66 void setActive( [in] boolean bActivate );
68 /**
69 @returns
70 `TRUE` if the dictionary is active, `FALSE` otherwise.
72 boolean isActive();
74 /**
75 @returns
76 the number of entries in the dictionary.
78 long getCount();
80 /**
81 @returns
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.
90 @param aLocale
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.
99 @returns
100 the reference to the entry found. If no entry was found,
101 it is NULL.
103 @param aWord
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>
118 @param xDicEntry
119 the entry to be added.
121 @returns
122 `TRUE` if the entry was successfully added `FALSE` otherwise.
124 @see com::sun::star::linguistic2::XDictionaryEntry
125 @see com::sun::star::linguistic2::DictionaryType
127 boolean addEntry(
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>
138 @param aWord
139 the word to be added.
141 @param bIsNegative
142 specifies whether the entry will be a negative one or not.
144 @param aRplcText
145 in the case of a negative entry, this is the replacement text to
146 be used when replacing aWord. Otherwise, it is undefined.
148 @returns
149 `TRUE` if the entry was successfully added, `FALSE` otherwise.
151 @see com::sun::star::linguistic2::DictionaryType
153 boolean add(
154 [in] string aWord,
155 [in] boolean bIsNegative,
156 [in] string aRplcText );
158 /** removes an entry from the dictionary.
160 @param aWord
161 the word matching the entry to be removed.
163 @returns
164 `TRUE` if the entry was successfully removed, `FALSE`
165 otherwise (especially if the entry was not found).
167 boolean remove( [in] string aWord );
170 @returns
171 `TRUE` if the dictionary is full and no further
172 entry can be made, `FALSE` otherwise.
174 boolean isFull();
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>
180 @returns
181 a sequence with all the entries of the dictionary.
183 @see com::sun::star::linguistic2::XDictionaryEntry
184 @see com::sun::star::linguistic2::XSearchableDictionary
185 @deprecated
188 sequence<com::sun::star::linguistic2::XDictionaryEntry> getEntries();
190 /** removes all entries from the dictionary.
192 void clear();
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>
200 @param xListener
201 the entry to be made, that is, the object that wants notifications.
203 @returns
204 `TRUE` if the entry was successfully made, `FALSE` otherwise.
205 If com::sun::star::lang::XEventListener::disposing() was called before,
206 it will always fail.
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.
216 @param xListener
217 the reference to the listening object to be removed.
219 @returns
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 );
232 }; }; }; };
234 #endif
236 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */