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_XLinguServiceManager_idl__
24#define __com_sun_star_linguistic2_XLinguServiceManager_idl__
25
26
27#ifndef __com_sun_star_linguistic2_XSpellChecker_idl__
28#include <com/sun/star/linguistic2/XSpellChecker.idl>
29#endif
30
31#ifndef __com_sun_star_linguistic2_XHyphenator_idl__
32#include <com/sun/star/linguistic2/XHyphenator.idl>
33#endif
34
35#ifndef __com_sun_star_linguistic2_XThesaurus_idl__
36#include <com/sun/star/linguistic2/XThesaurus.idl>
37#endif
38
39#ifndef __com_sun_star_lang_XEventListener_idl__
40#include <com/sun/star/lang/XEventListener.idl>
41#endif
42
43//=============================================================================
44
45module com { module sun { module star { module linguistic2 {
46
47//=============================================================================
48/** the basic interface to be used to access linguistic functionality.
49
50	<P>This interface is used to access spellchecker, hyphenator, and
51	thesaurus functionality.
52	Additionally, it can query what implementations of those services are
53	available (for specific languages or in general).
54	It can select and query which of those implementations should
55	be used for a specific language.</P>
56
57	<P>
58	For spellchecking and thesaurus, the order in the list defines the order
59	of creation/usage of those services.
60	That is, if the first spellchecker implementation does not recognize
61	the given word as correct, the second service implementation for that
62	language is created and gets queried. If that one fails, the third one
63	gets created and queried and so on.
64	This chain stops if an implementation reports the word as correct or the
65	end of the list is reached, in which case the word is reported as incorrect.
66	</P>
67
68	<P> For the thesaurus, the behavior is the same when no meaning was found.
69	</P>
70
71    @see    <type scope="com::sun::star::linguistic2">SpellChecker</type>
72    @see    <type scope="com::sun::star::linguistic2">Hyphenator</type>
73    @see    <type scope="com::sun::star::linguistic2">Thesaurus</type>
74*/
75published interface XLinguServiceManager : com::sun::star::uno::XInterface
76{
77	//-------------------------------------------------------------------------
78	/**
79		@returns
80			the <type scope="com::sun::star::linguistic2">XSpellChecker</type>
81			interface to be used for spellchecking.
82	*/
83	com::sun::star::linguistic2::XSpellChecker	getSpellChecker();
84
85	//-------------------------------------------------------------------------
86	/**
87		@returns
88			the <type scope="com::sun::star::linguistic2">XHyphenator</type>
89			interface to be used for hyphenation.
90	*/
91	com::sun::star::linguistic2::XHyphenator	getHyphenator();
92
93	//-------------------------------------------------------------------------
94	/**
95		@returns
96			the <type scope="com::sun::star::linguistic2">XThesaurus</type>
97			interface to be used for thesaurus functionality.
98	*/
99	com::sun::star::linguistic2::XThesaurus		getThesaurus();
100
101	//-------------------------------------------------------------------------
102	/** adds a listener to the list of event listeners.
103
104		<P>The listeners may support one or both of
105		<type scope="com::sun::star::linguistic2">XDictionaryEventListener</type>
106		and
107		<type scope="com::sun::star::linguistic2">XLinguServiceEventListener</type>
108		interfaces.
109		</P>
110
111		@returns
112			<TRUE/> if the listener was succesfully added, <FALSE/> otherwise.
113
114		@param xListener
115			the listener to be added.
116	*/
117	boolean		addLinguServiceManagerListener(
118		[in] com::sun::star::lang::XEventListener xListener );
119
120	//-------------------------------------------------------------------------
121	/** removes a listener from the list of event listeners.
122
123		@returns
124			<TRUE/> if the listener was succesfully removed, <FALSE/> otherwise.
125
126		@param xListener
127			the listener to be removed.
128	*/
129	boolean		removeLinguServiceManagerListener(
130		[in] com::sun::star::lang::XEventListener xListener );
131
132	//-------------------------------------------------------------------------
133	/**
134		@returns
135			the list of implementation names of the available services.
136
137		@param aServiceName
138			the name of the service requesting the list of available
139			implementations.
140
141		@param aLocale
142			the language used to query the list of available implementations.
143	*/
144	sequence< string >	getAvailableServices(
145		[in] string 						aServiceName,
146		[in] com::sun::star::lang::Locale 	aLocale );
147
148	//-------------------------------------------------------------------------
149	/** sets the list of service implementations to be used for a
150		given service and language.
151
152		@param aServiceName
153			the name of the service to set the list of implementations
154			to be used.
155
156		@param aLocale
157			the language to set the list.
158
159		@param aServiceImplNames
160			the name of the service to set the list.
161	*/
162	void				setConfiguredServices(
163		[in] string 						aServiceName,
164		[in] com::sun::star::lang::Locale 	aLocale,
165		[in] sequence< string > 			aServiceImplNames );
166
167	//-------------------------------------------------------------------------
168	/** queries the list of service implementations to be used for a
169		given service and language.
170
171		@returns
172			the list of implementation names of the services to be used.
173
174		@param aServiceName
175			the name of the service to get queried.
176
177		@param aLocale
178			the language to get queried.
179	*/
180	sequence< string >	getConfiguredServices(
181		[in] string 						aServiceName,
182		[in] com::sun::star::lang::Locale 	aLocale );
183
184};
185
186//=============================================================================
187
188}; }; }; };
189
190#endif
191