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