1d1766043SAndrew Rist/**************************************************************
2cdf0e10cSrcweir *
3d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4d1766043SAndrew Rist * or more contributor license agreements.  See the NOTICE file
5d1766043SAndrew Rist * distributed with this work for additional information
6d1766043SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
7d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the
8d1766043SAndrew Rist * "License"); you may not use this file except in compliance
9d1766043SAndrew Rist * with the License.  You may obtain a copy of the License at
10d1766043SAndrew Rist *
11d1766043SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12d1766043SAndrew Rist *
13d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing,
14d1766043SAndrew Rist * software distributed under the License is distributed on an
15d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16d1766043SAndrew Rist * KIND, either express or implied.  See the License for the
17d1766043SAndrew Rist * specific language governing permissions and limitations
18d1766043SAndrew Rist * under the License.
19d1766043SAndrew Rist *
20d1766043SAndrew Rist *************************************************************/
21d1766043SAndrew Rist
22d1766043SAndrew Rist
23cdf0e10cSrcweir#ifndef __com_sun_star_linguistic2_XLinguServiceManager_idl__
24cdf0e10cSrcweir#define __com_sun_star_linguistic2_XLinguServiceManager_idl__
25cdf0e10cSrcweir
26cdf0e10cSrcweir
27cdf0e10cSrcweir#ifndef __com_sun_star_linguistic2_XSpellChecker_idl__
28cdf0e10cSrcweir#include <com/sun/star/linguistic2/XSpellChecker.idl>
29cdf0e10cSrcweir#endif
30cdf0e10cSrcweir
31cdf0e10cSrcweir#ifndef __com_sun_star_linguistic2_XHyphenator_idl__
32cdf0e10cSrcweir#include <com/sun/star/linguistic2/XHyphenator.idl>
33cdf0e10cSrcweir#endif
34cdf0e10cSrcweir
35cdf0e10cSrcweir#ifndef __com_sun_star_linguistic2_XThesaurus_idl__
36cdf0e10cSrcweir#include <com/sun/star/linguistic2/XThesaurus.idl>
37cdf0e10cSrcweir#endif
38cdf0e10cSrcweir
39cdf0e10cSrcweir#ifndef __com_sun_star_lang_XEventListener_idl__
40cdf0e10cSrcweir#include <com/sun/star/lang/XEventListener.idl>
41cdf0e10cSrcweir#endif
42cdf0e10cSrcweir
43cdf0e10cSrcweir//=============================================================================
44cdf0e10cSrcweir
45cdf0e10cSrcweirmodule com { module sun { module star { module linguistic2 {
46cdf0e10cSrcweir
47cdf0e10cSrcweir//=============================================================================
48cdf0e10cSrcweir/** the basic interface to be used to access linguistic functionality.
49cdf0e10cSrcweir
50cdf0e10cSrcweir	<P>This interface is used to access spellchecker, hyphenator, and
51cdf0e10cSrcweir	thesaurus functionality.
52cdf0e10cSrcweir	Additionally, it can query what implementations of those services are
53cdf0e10cSrcweir	available (for specific languages or in general).
54cdf0e10cSrcweir	It can select and query which of those implementations should
55cdf0e10cSrcweir	be used for a specific language.</P>
56cdf0e10cSrcweir
57cdf0e10cSrcweir	<P>
58cdf0e10cSrcweir	For spellchecking and thesaurus, the order in the list defines the order
59cdf0e10cSrcweir	of creation/usage of those services.
60cdf0e10cSrcweir	That is, if the first spellchecker implementation does not recognize
61cdf0e10cSrcweir	the given word as correct, the second service implementation for that
62cdf0e10cSrcweir	language is created and gets queried. If that one fails, the third one
63cdf0e10cSrcweir	gets created and queried and so on.
64cdf0e10cSrcweir	This chain stops if an implementation reports the word as correct or the
65cdf0e10cSrcweir	end of the list is reached, in which case the word is reported as incorrect.
66cdf0e10cSrcweir	</P>
67cdf0e10cSrcweir
68cdf0e10cSrcweir	<P> For the thesaurus, the behavior is the same when no meaning was found.
69cdf0e10cSrcweir	</P>
70cdf0e10cSrcweir
71cdf0e10cSrcweir    @see    <type scope="com::sun::star::linguistic2">SpellChecker</type>
72cdf0e10cSrcweir    @see    <type scope="com::sun::star::linguistic2">Hyphenator</type>
73cdf0e10cSrcweir    @see    <type scope="com::sun::star::linguistic2">Thesaurus</type>
74cdf0e10cSrcweir*/
75cdf0e10cSrcweirpublished interface XLinguServiceManager : com::sun::star::uno::XInterface
76cdf0e10cSrcweir{
77cdf0e10cSrcweir	//-------------------------------------------------------------------------
78cdf0e10cSrcweir	/**
79cdf0e10cSrcweir		@returns
80cdf0e10cSrcweir			the <type scope="com::sun::star::linguistic2">XSpellChecker</type>
81cdf0e10cSrcweir			interface to be used for spellchecking.
82cdf0e10cSrcweir	*/
83cdf0e10cSrcweir	com::sun::star::linguistic2::XSpellChecker	getSpellChecker();
84cdf0e10cSrcweir
85cdf0e10cSrcweir	//-------------------------------------------------------------------------
86cdf0e10cSrcweir	/**
87cdf0e10cSrcweir		@returns
88cdf0e10cSrcweir			the <type scope="com::sun::star::linguistic2">XHyphenator</type>
89cdf0e10cSrcweir			interface to be used for hyphenation.
90cdf0e10cSrcweir	*/
91cdf0e10cSrcweir	com::sun::star::linguistic2::XHyphenator	getHyphenator();
92cdf0e10cSrcweir
93cdf0e10cSrcweir	//-------------------------------------------------------------------------
94cdf0e10cSrcweir	/**
95cdf0e10cSrcweir		@returns
96cdf0e10cSrcweir			the <type scope="com::sun::star::linguistic2">XThesaurus</type>
97cdf0e10cSrcweir			interface to be used for thesaurus functionality.
98cdf0e10cSrcweir	*/
99cdf0e10cSrcweir	com::sun::star::linguistic2::XThesaurus		getThesaurus();
100cdf0e10cSrcweir
101cdf0e10cSrcweir	//-------------------------------------------------------------------------
102cdf0e10cSrcweir	/** adds a listener to the list of event listeners.
103cdf0e10cSrcweir
104cdf0e10cSrcweir		<P>The listeners may support one or both of
105cdf0e10cSrcweir		<type scope="com::sun::star::linguistic2">XDictionaryEventListener</type>
106cdf0e10cSrcweir		and
107cdf0e10cSrcweir		<type scope="com::sun::star::linguistic2">XLinguServiceEventListener</type>
108cdf0e10cSrcweir		interfaces.
109cdf0e10cSrcweir		</P>
110cdf0e10cSrcweir
111cdf0e10cSrcweir		@returns
112*a893be29SPedro Giffuni			<TRUE/> if the listener was successfully added, <FALSE/> otherwise.
113cdf0e10cSrcweir
114cdf0e10cSrcweir		@param xListener
115cdf0e10cSrcweir			the listener to be added.
116cdf0e10cSrcweir	*/
117cdf0e10cSrcweir	boolean		addLinguServiceManagerListener(
118cdf0e10cSrcweir		[in] com::sun::star::lang::XEventListener xListener );
119cdf0e10cSrcweir
120cdf0e10cSrcweir	//-------------------------------------------------------------------------
121cdf0e10cSrcweir	/** removes a listener from the list of event listeners.
122cdf0e10cSrcweir
123cdf0e10cSrcweir		@returns
124*a893be29SPedro Giffuni			<TRUE/> if the listener was successfully removed, <FALSE/> otherwise.
125cdf0e10cSrcweir
126cdf0e10cSrcweir		@param xListener
127cdf0e10cSrcweir			the listener to be removed.
128cdf0e10cSrcweir	*/
129cdf0e10cSrcweir	boolean		removeLinguServiceManagerListener(
130cdf0e10cSrcweir		[in] com::sun::star::lang::XEventListener xListener );
131cdf0e10cSrcweir
132cdf0e10cSrcweir	//-------------------------------------------------------------------------
133cdf0e10cSrcweir	/**
134cdf0e10cSrcweir		@returns
135cdf0e10cSrcweir			the list of implementation names of the available services.
136cdf0e10cSrcweir
137cdf0e10cSrcweir		@param aServiceName
138cdf0e10cSrcweir			the name of the service requesting the list of available
139cdf0e10cSrcweir			implementations.
140cdf0e10cSrcweir
141cdf0e10cSrcweir		@param aLocale
142cdf0e10cSrcweir			the language used to query the list of available implementations.
143cdf0e10cSrcweir	*/
144cdf0e10cSrcweir	sequence< string >	getAvailableServices(
145cdf0e10cSrcweir		[in] string 						aServiceName,
146cdf0e10cSrcweir		[in] com::sun::star::lang::Locale 	aLocale );
147cdf0e10cSrcweir
148cdf0e10cSrcweir	//-------------------------------------------------------------------------
149cdf0e10cSrcweir	/** sets the list of service implementations to be used for a
150cdf0e10cSrcweir		given service and language.
151cdf0e10cSrcweir
152cdf0e10cSrcweir		@param aServiceName
153cdf0e10cSrcweir			the name of the service to set the list of implementations
154cdf0e10cSrcweir			to be used.
155cdf0e10cSrcweir
156cdf0e10cSrcweir		@param aLocale
157cdf0e10cSrcweir			the language to set the list.
158cdf0e10cSrcweir
159cdf0e10cSrcweir		@param aServiceImplNames
160cdf0e10cSrcweir			the name of the service to set the list.
161cdf0e10cSrcweir	*/
162cdf0e10cSrcweir	void				setConfiguredServices(
163cdf0e10cSrcweir		[in] string 						aServiceName,
164cdf0e10cSrcweir		[in] com::sun::star::lang::Locale 	aLocale,
165cdf0e10cSrcweir		[in] sequence< string > 			aServiceImplNames );
166cdf0e10cSrcweir
167cdf0e10cSrcweir	//-------------------------------------------------------------------------
168cdf0e10cSrcweir	/** queries the list of service implementations to be used for a
169cdf0e10cSrcweir		given service and language.
170cdf0e10cSrcweir
171cdf0e10cSrcweir		@returns
172cdf0e10cSrcweir			the list of implementation names of the services to be used.
173cdf0e10cSrcweir
174cdf0e10cSrcweir		@param aServiceName
175cdf0e10cSrcweir			the name of the service to get queried.
176cdf0e10cSrcweir
177cdf0e10cSrcweir		@param aLocale
178cdf0e10cSrcweir			the language to get queried.
179cdf0e10cSrcweir	*/
180cdf0e10cSrcweir	sequence< string >	getConfiguredServices(
181cdf0e10cSrcweir		[in] string 						aServiceName,
182cdf0e10cSrcweir		[in] com::sun::star::lang::Locale 	aLocale );
183cdf0e10cSrcweir
184cdf0e10cSrcweir};
185cdf0e10cSrcweir
186cdf0e10cSrcweir//=============================================================================
187cdf0e10cSrcweir
188cdf0e10cSrcweir}; }; }; };
189cdf0e10cSrcweir
190cdf0e10cSrcweir#endif
191