Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / offapi / com / sun / star / linguistic2 / XDictionaryList.idl
blob63ec6a0ae0de827dd26c904ca2c5541bf426d8a6
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_XDictionaryList_idl__
20 #define __com_sun_star_linguistic2_XDictionaryList_idl__
22 #include <com/sun/star/uno/XInterface.idl>
23 #include <com/sun/star/linguistic2/XDictionary.idl>
24 #include <com/sun/star/linguistic2/XDictionaryListEventListener.idl>
27 module com { module sun { module star { module linguistic2 {
29 /** is used to manage and maintain a list of dictionaries.
31 <P>A dictionary-list may be given to a spell checker or hyphenator
32 service implementation on their creation in order to supply a set
33 of dictionaries and additional information to be used for
34 those purposes.</P>
36 @see com::sun::star::linguistic2::XDictionary
37 @see com::sun::star::uno::XInterface
39 published interface XDictionaryList : com::sun::star::uno::XInterface
41 /**
42 @returns
43 the number of dictionaries in the list.
45 short getCount();
47 /**
48 @returns
49 a sequence with an entry for every dictionary
50 in the list.
52 @see com::sun::star::linguistic2::XDictionary
54 sequence<com::sun::star::linguistic2::XDictionary> getDictionaries();
56 /** searches the list for a dictionary with a given name.
58 @returns
59 the XDictionary with the specified name. If no such
60 dictionary exists, `NULL` will be returned.
62 @param aDictionaryName
63 specifies the name of the dictionary to look for.
65 @see com::sun::star::linguistic2::XDictionary
67 com::sun::star::linguistic2::XDictionary getDictionaryByName(
68 [in] string aDictionaryName );
70 /** adds a dictionary to the list.
72 <P>Additionally, the dictionary-list will add itself to the list of dictionary
73 event listeners of that dictionary.</P>
75 @returns
76 `TRUE` if the dictionary was added successfully,
77 `FALSE` otherwise.
79 @param xDictionary
80 the dictionary to be added.
82 @see com::sun::star::linguistic2::XDictionary
84 boolean addDictionary(
85 [in] com::sun::star::linguistic2::XDictionary xDictionary );
87 /** removes a single dictionary from the list.
89 <P>If the dictionary is still active, it will be deactivated
90 first. The dictionary-list will remove itself from the list of
91 dictionary event listeners of the dictionary.</P>
93 @returns
94 `TRUE` if the dictionary was removed successfully, `FALSE`
95 otherwise.
97 @param xDictionary
98 dictionary to be removed from the list of dictionaries.
100 @see com::sun::star::linguistic2::XDictionary
102 boolean removeDictionary(
103 [in] com::sun::star::linguistic2::XDictionary xDictionary );
105 /** adds an entry to the list of dictionary-list event listeners.
107 <P>On dictionary-list events, each entry in the listener list will
108 be notified via a call to
109 com::sun::star::linguistic2::XDictionaryListEventListener::processDictionaryListEvent().</P>
111 @returns
112 `TRUE` if the entry was made, `FALSE` otherwise.
113 If com::sun::star::lang::XEventListener::disposing()
114 was called before, it will always fail.
116 @param xListener
117 the object to be notified of dictionary-list events.
119 @param bReceiveVerbose
120 `TRUE` if the listener requires more detailed event
121 notification than usual.
123 @see com::sun::star::linguistic2::XDictionaryListEventListener
124 @see com::sun::star::linguistic2::XDictionaryListEvent
126 boolean addDictionaryListEventListener(
127 [in] com::sun::star::linguistic2::XDictionaryListEventListener xListener,
128 [in] boolean bReceiveVerbose );
130 /** removes an entry from the list of dictionary-list event listeners.
132 @returns
133 `TRUE` if the object to be removed was found and removed,
134 `FALSE` otherwise.
136 @param xListener
137 the object to be removed from the listener list.
139 @see com::sun::star::linguistic2::XDictionaryListEventListener
140 @see com::sun::star::linguistic2::XDictionaryListEvent
142 boolean removeDictionaryListEventListener(
143 [in] com::sun::star::linguistic2::XDictionaryListEventListener xListener );
145 /** increases request level for event buffering by one.
147 <P>The request level for event buffering is an integer
148 counter that is initially set to 0.
149 As long as the request level is not 0, events will be buffered
150 until the next flushing of the buffer.</P>
152 @returns
153 the current request level for event buffering.
155 @see com::sun::star::linguistic2::XDictionaryListEvent
156 @see com::sun::star::linguistic2::XDictionaryListEventListener
157 @see com::sun::star::linguistic2::XDictionaryList::endCollectEvents()
158 @see com::sun::star::linguistic2::XDictionaryList::flushEvents()
160 short beginCollectEvents();
162 /** flushes the event buffer and decreases the request level for
163 event buffering by one.
165 <P>There should be one matching endCollectEvents call for every
166 beginCollectEvents call. Usually you will group these around
167 some code where you do not wish to get notified of every single
168 event.</P>
170 @returns
171 the current request level for event buffering.
173 @see com::sun::star::linguistic2::XDictionaryListEvent
174 @see com::sun::star::linguistic2::XDictionaryListEventListener
175 @see com::sun::star::linguistic2::XDictionaryList::beginCollectEvents()
176 @see com::sun::star::linguistic2::XDictionaryList::flushEvents()
178 short endCollectEvents();
180 /** notifies the listeners of all buffered events and then clears
181 that buffer.
183 @returns
184 the current request level for event buffering.
186 @see com::sun::star::linguistic2::XDictionaryListEvent
187 @see com::sun::star::linguistic2::XDictionaryListEventListener
188 @see com::sun::star::linguistic2::XDictionaryList::beginCollectEvents()
189 @see com::sun::star::linguistic2::XDictionaryList::endCollectEvents()
191 short flushEvents();
193 /** creates a new dictionary.
195 @returns
196 an empty dictionary with the given name, language and type.
197 `NULL` on failure.
199 @param aName
200 is the name of the dictionary (should be unique).
202 @param aLocale
203 defines the language of the dictionary.
204 Use an empty aLocale for dictionaries which may contain
205 entries of all languages.
207 @param eDicType
208 specifies the type of the dictionary.
210 @param aURL
211 is the URL of the location where the dictionary is persistent,
212 if the XStorable interface is supported.
213 It may be empty, which means the dictionary will not be persistent.
215 @see com::sun::star::linguistic2::XDictionary
216 @see com::sun::star::lang::Locale
217 @see com::sun::star::linguistic2::DictionaryType
219 com::sun::star::linguistic2::XDictionary createDictionary(
220 [in] string aName,
221 [in] com::sun::star::lang::Locale aLocale,
222 [in] com::sun::star::linguistic2::DictionaryType eDicType,
223 [in] string aURL );
228 }; }; }; };
230 #endif
232 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */