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