1/*************************************************************************
2 *
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
6 *
7 * OpenOffice.org - a multi-platform office productivity suite
8 *
9 * This file is part of OpenOffice.org.
10 *
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
14 *
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
20 *
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org.  If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
25 *
26 ************************************************************************/
27#ifndef __com_sun_star_linguistic2_XDictionaryList_idl__
28#define __com_sun_star_linguistic2_XDictionaryList_idl__
29
30#ifndef __com_sun_star_uno_XInterface_idl__
31#include <com/sun/star/uno/XInterface.idl>
32#endif
33
34#ifndef __com_sun_star_linguistic2_XDictionary_idl__
35#include <com/sun/star/linguistic2/XDictionary.idl>
36#endif
37
38#ifndef __com_sun_star_linguistic2_XDictionaryListEventListener_idl__
39#include <com/sun/star/linguistic2/XDictionaryListEventListener.idl>
40#endif
41
42//=============================================================================
43
44module com { module sun { module star { module linguistic2 {
45
46//=============================================================================
47/** is used to manage and maintain a list of dictionaries.
48
49	<P>A dictionary-list may be given to a spellchecker or hyphenator
50	service implementation on their creation in order to supply a set
51	of dictionaries and additional information to be used for
52	those purposes.</P>
53
54    @see    <type scope="com::sun::star::linguistic2">XDictionary</type>
55    @see    <type scope="com::sun::star::uno">XInterface</type>
56*/
57published interface XDictionaryList : com::sun::star::uno::XInterface
58{
59	//-------------------------------------------------------------------------
60	/**
61		@returns
62			the number of dictionaries in the list.
63	*/
64	short getCount();
65
66	//-------------------------------------------------------------------------
67	/**
68		@returns
69 			a sequence with an entry for every dictionary
70			in the list.
71
72        @see    <type scope="com::sun::star::linguistic2">XDictionary</type>
73	*/
74	sequence<com::sun::star::linguistic2::XDictionary> getDictionaries();
75
76	//-------------------------------------------------------------------------
77	/** searches the list for a dictionary with a given name.
78
79	 	@returns
80			the XDictionary with the specified name. If no such
81			dictionary exists, <NULL/> will be returned.
82
83		@param	aDictionaryName
84			specifies the name of the dictionary to look for.
85
86        @see    <type scope="com::sun::star::linguistic2">XDictionary</type>
87	*/
88	com::sun::star::linguistic2::XDictionary getDictionaryByName(
89			[in] string aDictionaryName );
90
91	//-------------------------------------------------------------------------
92	/** adds a dictionary to the list.
93
94		<P>Additionally, the dictionary-list will add itself to the list of dictionary
95	 	event listeners of that dictionary.</P>
96
97    	@returns
98		 	<TRUE/> if the dictionary was added successfully,
99			<FALSE/> otherwise.
100
101		@param	xDictionary
102			the dictionary to be added.
103
104        @see    <type scope="com::sun::star::linguistic2">XDictionary</type>
105	*/
106	boolean addDictionary(
107			[in] com::sun::star::linguistic2::XDictionary xDictionary );
108
109	//-------------------------------------------------------------------------
110	/** removes a single dictionary from the list.
111
112		<P>If the dictionary is still active, it will be deactivated
113		first. The dictionary-list will remove itself from the list of
114		dictionary event listeners of the dictionary.</P>
115
116		@returns
117		 	<TRUE/> if the dictionary was removed successfully, <FALSE/>
118		 	otherwise.
119
120		@param	xDictionary
121			dictionary to be removed from the list of dictionaries.
122
123        @see    <type scope="com::sun::star::linguistic2">XDictionary</type>
124	*/
125	boolean removeDictionary(
126			[in] com::sun::star::linguistic2::XDictionary xDictionary );
127
128	//-------------------------------------------------------------------------
129	/** adds an entry to the list of dictionary-list event listeners.
130
131		<P>On dictionary-list events, each entry in the listener list will
132	 	be notified via a call to
133        <member scope="com::sun::star::linguistic2">XDictionaryListEventListener::processDictionaryListEvent</member>.</P>
134
135		@returns
136			<TRUE/> if the entry was made, <FALSE/> otherwise.
137            If <member scope="com::sun::star::lang">XEventListener::disposing</member>
138            was called before, it will always fail.
139
140		@param	xListener
141			the object to be notified of dictionary-list events.
142
143		@param	bReceiveVerbose
144            <TRUE/> if the listener requires more detailed event
145			notification than usual.
146
147        @see    <type scope="com::sun::star::linguistic2">XDictionaryListEventListener</type>
148        @see    <type scope="com::sun::star::linguistic2">XDictionaryListEvent</type>
149	*/
150	boolean addDictionaryListEventListener(
151		[in] com::sun::star::linguistic2::XDictionaryListEventListener xListener,
152		[in] boolean bReceiveVerbose );
153
154	//-------------------------------------------------------------------------
155	/** removes an entry from the list of dictionary-list event listeners.
156
157		@returns
158			<TRUE/> if the object to be removed was found and removed,
159			<FALSE/> otherwise.
160
161		@param	xListener
162			the object to be removed from the listener list.
163
164        @see    <type scope="com::sun::star::linguistic2">XDictionaryListEventListener</type>
165        @see    <type scope="com::sun::star::linguistic2">XDictionaryListEvent</type>
166	*/
167	boolean removeDictionaryListEventListener(
168		[in] com::sun::star::linguistic2::XDictionaryListEventListener xListener );
169
170	//-------------------------------------------------------------------------
171	/** increases request level for event buffering by one.
172
173	 	<P>The request level for event buffering is an integer
174	 	counter that is initially set to 0.
175		As long as the request level is not 0, events will be buffered
176	 	until the next flushing of the buffer.</P>
177
178		@returns
179		 	the current request level for event buffering.
180
181        @see    <type scope="com::sun::star::linguistic2">XDictionaryListEvent</type>
182        @see    <type scope="com::sun::star::linguistic2">XDictionaryListEventListener</type>
183        @see    <member scope="com::sun::star::linguistic2">XDictionaryList::endCollectEvents</member>
184        @see    <member scope="com::sun::star::linguistic2">XDictionaryList::flushEvents</member>
185	*/
186	short beginCollectEvents();
187
188	//-------------------------------------------------------------------------
189	/** flushes the event buffer and decreases the request level for
190	 	event buffering by one.
191
192	 	<P>There should be one matching endCollectEvents call for every
193	 	beginCollectEvents call. Usually you will group these around
194	 	some code where you do not wish to get notfied of every single
195	 	event.</P>
196
197		@returns
198		 	the current request level for event buffering.
199
200        @see    <type scope="com::sun::star::linguistic2">XDictionaryListEvent</type>
201        @see    <type scope="com::sun::star::linguistic2">XDictionaryListEventListener</type>
202        @see    <member scope="com::sun::star::linguistic2">XDictionaryList::beginCollectEvents</member>
203        @see    <member scope="com::sun::star::linguistic2">XDictionaryList::flushEvents</member>
204	*/
205	short endCollectEvents();
206
207	//-------------------------------------------------------------------------
208	/** notifies the listeners of all buffered events and then clears
209	 	that buffer.
210
211		@returns
212		 	the current request level for event buffering.
213
214        @see    <type scope="com::sun::star::linguistic2">XDictionaryListEvent</type>
215        @see    <type scope="com::sun::star::linguistic2">XDictionaryListEventListener</type>
216        @see    <member scope="com::sun::star::linguistic2">XDictionaryList::beginCollectEvents</member>
217        @see    <member scope="com::sun::star::linguistic2">XDictionaryList::endCollectEvents</member>
218	*/
219	short flushEvents();
220
221	//-------------------------------------------------------------------------
222	/** creates a new dictionary.
223
224		@returns
225			an empty dictionary with the given name, language and type.
226		 	<NULL/> on failure.
227
228		@param  aName
229			is the name of the dictionary (should be unique).
230
231		@param  aLocale
232			defines the language of the dictionary.
233		 	Use an empty aLocale for dictionaries which may contain
234			entries of all languages.
235
236		@param	eDicType
237			specifies the type of the dictionary.
238
239	 	@param aURL
240			is the URL of the location where the dictionary is persistent,
241			if the XStorable interface is supported.
242			It may be empty, which means the dictionary will not be persistent.
243
244        @see    <type scope="com::sun::star::linguistic2">XDictionary</type>
245        @see    <type scope="com::sun::star::lang">Locale</type>
246        @see    <type scope="com::sun::star::linguistic2">DictionaryType</type>
247	*/
248	com::sun::star::linguistic2::XDictionary createDictionary(
249			[in] string aName,
250			[in] com::sun::star::lang::Locale aLocale,
251			[in] com::sun::star::linguistic2::DictionaryType eDicType,
252			[in] string aURL );
253
254};
255
256//=============================================================================
257
258}; }; }; };
259
260#endif
261
262