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_XDictionary_idl__
24cdf0e10cSrcweir#define __com_sun_star_linguistic2_XDictionary_idl__
25cdf0e10cSrcweir
26cdf0e10cSrcweir#ifndef __com_sun_star_container_XNamed_idl__
27cdf0e10cSrcweir#include <com/sun/star/container/XNamed.idl>
28cdf0e10cSrcweir#endif
29cdf0e10cSrcweir
30cdf0e10cSrcweir#ifndef __com_sun_star_lang_Locale_idl__
31cdf0e10cSrcweir#include <com/sun/star/lang/Locale.idl>
32cdf0e10cSrcweir#endif
33cdf0e10cSrcweir
34cdf0e10cSrcweir#ifndef __com_sun_star_linguistic2_DictionaryType_idl__
35cdf0e10cSrcweir#include <com/sun/star/linguistic2/DictionaryType.idl>
36cdf0e10cSrcweir#endif
37cdf0e10cSrcweir
38cdf0e10cSrcweir#ifndef __com_sun_star_linguistic2_XDictionaryEntry_idl__
39cdf0e10cSrcweir#include <com/sun/star/linguistic2/XDictionaryEntry.idl>
40cdf0e10cSrcweir#endif
41cdf0e10cSrcweir
42cdf0e10cSrcweir#ifndef __com_sun_star_linguistic2_XDictionaryEventListener_idl__
43cdf0e10cSrcweir#include <com/sun/star/linguistic2/XDictionaryEventListener.idl>
44cdf0e10cSrcweir#endif
45cdf0e10cSrcweir
46cdf0e10cSrcweir//=============================================================================
47cdf0e10cSrcweir
48cdf0e10cSrcweirmodule com { module sun { module star { module linguistic2 {
49cdf0e10cSrcweir
50cdf0e10cSrcweir//=============================================================================
51cdf0e10cSrcweir/** This interfaces enables the object to access personal dictionaries.
52cdf0e10cSrcweir
53cdf0e10cSrcweir	<P>Personal dictionaries are used to supply additional
54cdf0e10cSrcweir	information for spellchecking and hyphenation (see
55cdf0e10cSrcweir	<type scope="com::sun::star::linguistic2">XDictionaryEntry</type>).
56cdf0e10cSrcweir	Only active dictionaries with an appropriate language are used
57cdf0e10cSrcweir	for that purpose.
58cdf0e10cSrcweir	The entries of an active, positive dictionary are words that are
59cdf0e10cSrcweir	required to be recognized as correct during the spellchecking
60cdf0e10cSrcweir	process. Additionally, they will be used for hyphenation.
61cdf0e10cSrcweir	Entries of a negative dictionary are required to be recognized
62cdf0e10cSrcweir	as negative words, for example, words that should not be used, during
63cdf0e10cSrcweir	spellcheck. An entry in a negative dictionary may supply a
64cdf0e10cSrcweir	proposal for a word to be used instead of the one being used.</P>
65cdf0e10cSrcweir
66cdf0e10cSrcweir    @see    <type scope="com::sun::star::linguistic2">XDictionaryEvent</type>
67cdf0e10cSrcweir    @see    <type scope="com::sun::star::container">XNamed</type>
68cdf0e10cSrcweir*/
69cdf0e10cSrcweirpublished interface XDictionary : com::sun::star::container::XNamed
70cdf0e10cSrcweir{
71cdf0e10cSrcweir	//-------------------------------------------------------------------------
72cdf0e10cSrcweir	/** returns the type of the dictionary.
73cdf0e10cSrcweir
74cdf0e10cSrcweir		@returns
75cdf0e10cSrcweir			the type of the dictionary.
76cdf0e10cSrcweir
77cdf0e10cSrcweir        @see    <type scope="com::sun::star::linguistic2">DictionaryType</type>
78cdf0e10cSrcweir	*/
79cdf0e10cSrcweir	com::sun::star::linguistic2::DictionaryType getDictionaryType();
80cdf0e10cSrcweir
81cdf0e10cSrcweir	//-------------------------------------------------------------------------
82cdf0e10cSrcweir	/** specifies whether the dictionary should be used or not .
83cdf0e10cSrcweir
84cdf0e10cSrcweir		@param	bAcvtivate
85cdf0e10cSrcweir            <TRUE/> if the dictionary should be used, <FALSE/> otherwise.
86cdf0e10cSrcweir
87cdf0e10cSrcweir	*/
88cdf0e10cSrcweir	void setActive( [in] boolean bActivate );
89cdf0e10cSrcweir
90cdf0e10cSrcweir	//-------------------------------------------------------------------------
91cdf0e10cSrcweir    /**
92cdf0e10cSrcweir		@returns
93cdf0e10cSrcweir			<TRUE/> if the dictionary is active, <FALSE/> otherwise.
94cdf0e10cSrcweir	*/
95cdf0e10cSrcweir	boolean isActive();
96cdf0e10cSrcweir
97cdf0e10cSrcweir	//-------------------------------------------------------------------------
98cdf0e10cSrcweir    /**
99cdf0e10cSrcweir		@returns
100cdf0e10cSrcweir	   		the number of entries in the dictionary.
101cdf0e10cSrcweir	*/
102cdf0e10cSrcweir    long getCount();
103cdf0e10cSrcweir
104cdf0e10cSrcweir	//-------------------------------------------------------------------------
105cdf0e10cSrcweir	/**
106cdf0e10cSrcweir	 	@returns
107cdf0e10cSrcweir	 		the language of the dictionary.
108cdf0e10cSrcweir
109cdf0e10cSrcweir        @see    <type scope="com::sun::star::lang">Locale</type>
110cdf0e10cSrcweir	*/
111cdf0e10cSrcweir	com::sun::star::lang::Locale getLocale();
112cdf0e10cSrcweir
113cdf0e10cSrcweir	//-------------------------------------------------------------------------
114cdf0e10cSrcweir	/** is used to set the language of the dictionary.
115cdf0e10cSrcweir
116cdf0e10cSrcweir	 	@param aLocale
117cdf0e10cSrcweir            the new language of the dictionary.
118cdf0e10cSrcweir
119cdf0e10cSrcweir        @see    <type scope="com::sun::star::lang">Locale</type>
120cdf0e10cSrcweir	*/
121cdf0e10cSrcweir	void setLocale( [in] com::sun::star::lang::Locale aLocale );
122cdf0e10cSrcweir
123cdf0e10cSrcweir	//-------------------------------------------------------------------------
124cdf0e10cSrcweir	/** searches for an entry that matches the given word.
125cdf0e10cSrcweir
126cdf0e10cSrcweir		@returns
127cdf0e10cSrcweir			the reference to the entry found. If no entry was found,
128cdf0e10cSrcweir			it is NULL.
129cdf0e10cSrcweir
130cdf0e10cSrcweir		@param	aWord
131cdf0e10cSrcweir			the word to be looked for.
132cdf0e10cSrcweir
133cdf0e10cSrcweir        @see    <type scope="com::sun::star::linguistic2">XDictionaryEntry</type>
134cdf0e10cSrcweir	*/
135cdf0e10cSrcweir	com::sun::star::linguistic2::XDictionaryEntry getEntry( [in] string aWord );
136cdf0e10cSrcweir
137cdf0e10cSrcweir	//-------------------------------------------------------------------------
138cdf0e10cSrcweir	/** is used to add an entry to the dictionary.
139cdf0e10cSrcweir
140cdf0e10cSrcweir		<P>If an entry already exists, the dictionary remains unchanged
141cdf0e10cSrcweir	 	and <FALSE/> will be returned.</P>
142cdf0e10cSrcweir
143*a893be29SPedro Giffuni		<P>In positive dictionaries only positive entries
144cdf0e10cSrcweir		can be made, and in negative ones only negative entries.</P>
145cdf0e10cSrcweir
146cdf0e10cSrcweir		@param	xDicEntry
147cdf0e10cSrcweir			the entry to be added.
148cdf0e10cSrcweir
149cdf0e10cSrcweir		@returns
150cdf0e10cSrcweir			<TRUE/> if the entry was successfully added <FALSE/> otherwise.
151cdf0e10cSrcweir
152cdf0e10cSrcweir        @see    <type scope="com::sun::star::linguistic2">XDictionaryEntry</type>
153cdf0e10cSrcweir        @see    <type scope="com::sun::star::linguistic2">DictionaryType</type>
154cdf0e10cSrcweir	*/
155cdf0e10cSrcweir	boolean addEntry(
156cdf0e10cSrcweir		[in] com::sun::star::linguistic2::XDictionaryEntry xDicEntry );
157cdf0e10cSrcweir
158cdf0e10cSrcweir	//-------------------------------------------------------------------------
159cdf0e10cSrcweir	/** is used to make an entry in the dictionary.
160cdf0e10cSrcweir
161cdf0e10cSrcweir		<P>If an entry already exists, the dictionary remains unchanged
162cdf0e10cSrcweir	 	and <FALSE/> will be returned.</P>
163cdf0e10cSrcweir
164*a893be29SPedro Giffuni		<P>In positive dictionaries only positive entries
165cdf0e10cSrcweir		can be made, and in negative ones only negative entries.</P>
166cdf0e10cSrcweir
167cdf0e10cSrcweir		@param	aWord
168cdf0e10cSrcweir			the word to be added.
169cdf0e10cSrcweir
170cdf0e10cSrcweir		@param	bIsNegative
171cdf0e10cSrcweir			specifies whether the entry will be a negative one or not.
172cdf0e10cSrcweir
173cdf0e10cSrcweir		@param	aRplcText
174cdf0e10cSrcweir			in the case of a negative entry, this is the replacement text to
175cdf0e10cSrcweir			be used when replacing aWord. Otherwise, it is undefined.
176cdf0e10cSrcweir
177cdf0e10cSrcweir		@returns
178cdf0e10cSrcweir			<TRUE/> if the entry was successfully added, <FALSE/> otherwise.
179cdf0e10cSrcweir
180cdf0e10cSrcweir        @see    <type scope="com::sun::star::linguistic2">DictionaryType</type>
181cdf0e10cSrcweir	*/
182cdf0e10cSrcweir	boolean add(
183cdf0e10cSrcweir			[in] string aWord,
184cdf0e10cSrcweir			[in] boolean bIsNegative,
185cdf0e10cSrcweir			[in] string aRplcText );
186cdf0e10cSrcweir
187cdf0e10cSrcweir	//-------------------------------------------------------------------------
188cdf0e10cSrcweir	/** removes an entry from the dictionary.
189cdf0e10cSrcweir
190cdf0e10cSrcweir		@param	aWord
191cdf0e10cSrcweir			the word matching the entry to be removed.
192cdf0e10cSrcweir
193cdf0e10cSrcweir		@returns
194cdf0e10cSrcweir			<TRUE/> if the entry was successfully removed, <FALSE/>
195cdf0e10cSrcweir			otherwise (especially if the entry was not found).
196cdf0e10cSrcweir	*/
197cdf0e10cSrcweir	boolean remove( [in] string aWord );
198cdf0e10cSrcweir
199cdf0e10cSrcweir	//-------------------------------------------------------------------------
200cdf0e10cSrcweir	/**
201cdf0e10cSrcweir		@returns
202cdf0e10cSrcweir	 		<TRUE/> if the dictionary is full and no further
203cdf0e10cSrcweir			entry can be made, <FALSE/> otherwise.
204cdf0e10cSrcweir	*/
205cdf0e10cSrcweir	boolean isFull();
206cdf0e10cSrcweir
207cdf0e10cSrcweir	//-------------------------------------------------------------------------
208cdf0e10cSrcweir	/**
209cdf0e10cSrcweir        <p>This function should no longer be used since with the expansion of the
210cdf0e10cSrcweir        maximum number of allowed entries the result may become unreasonable large!</p>
211cdf0e10cSrcweir
212cdf0e10cSrcweir	 	@returns
213cdf0e10cSrcweir	 		a sequence with all the entries of the dictionary.
214cdf0e10cSrcweir
215cdf0e10cSrcweir        @see    <type scope="com::sun::star::linguistic2">XDictionaryEntry</type>
216cdf0e10cSrcweir        @see    <type scope="com::sun::star::linguistic2">XSearchableDictionary</type>
217cdf0e10cSrcweir        @deprecated
218cdf0e10cSrcweir	*/
219cdf0e10cSrcweir
220cdf0e10cSrcweir	sequence<com::sun::star::linguistic2::XDictionaryEntry> getEntries();
221cdf0e10cSrcweir
222cdf0e10cSrcweir	//-------------------------------------------------------------------------
223cdf0e10cSrcweir	/** removes all entries from the dictionary.
224cdf0e10cSrcweir	*/
225cdf0e10cSrcweir	void clear();
226cdf0e10cSrcweir
227cdf0e10cSrcweir	//-------------------------------------------------------------------------
228cdf0e10cSrcweir	/** adds an entry to the list of dictionary event listeners.
229cdf0e10cSrcweir
230cdf0e10cSrcweir		<P>On dictionary events, each entry in the listener list will
231cdf0e10cSrcweir	 	be notified via a call to
232cdf0e10cSrcweir        <member scope="com::sun::star::linguistic2">XDictionaryEventListener::processDictionaryEvent</member>.</P>
233cdf0e10cSrcweir
234cdf0e10cSrcweir		@param	xListener
235cdf0e10cSrcweir			the entry to be made, that is, the object that wants notifications.
236cdf0e10cSrcweir
237cdf0e10cSrcweir		@returns
238cdf0e10cSrcweir			<TRUE/> if the entry was successfully made, <FALSE/> otherwise.
239cdf0e10cSrcweir            If <member scope="com::sun::star::lang">XEventListener::disposing</member> was called before,
240cdf0e10cSrcweir            it will always fail.
241cdf0e10cSrcweir
242cdf0e10cSrcweir        @see    <member scope="com::sun::star::linguistic2">XDictionary::removeDictionaryEventListener</member>
243cdf0e10cSrcweir        @see    <type scope="com::sun::star::linguistic2">XDictionaryEventListener</type>
244cdf0e10cSrcweir	*/
245cdf0e10cSrcweir	boolean addDictionaryEventListener(
246cdf0e10cSrcweir		[in] com::sun::star::linguistic2::XDictionaryEventListener xListener );
247cdf0e10cSrcweir
248cdf0e10cSrcweir	//-------------------------------------------------------------------------
249cdf0e10cSrcweir	/** removes an entry from the list of dictionary event listeners.
250cdf0e10cSrcweir
251cdf0e10cSrcweir		@param	xListener
252cdf0e10cSrcweir			the reference to the listening object to be removed.
253cdf0e10cSrcweir
254cdf0e10cSrcweir		@returns
255cdf0e10cSrcweir			<TRUE/> if the object to be removed was found and removed,
256cdf0e10cSrcweir			<FALSE/> if the object was not found in the list.
257cdf0e10cSrcweir
258cdf0e10cSrcweir        @see    <member scope="com::sun::star::linguistic2">XDictionary::addDictionaryEventListener</member>
259cdf0e10cSrcweir        @see    <type scope="com::sun::star::linguistic2">XDictionaryEventListener</type>
260cdf0e10cSrcweir	*/
261cdf0e10cSrcweir	boolean removeDictionaryEventListener(
262cdf0e10cSrcweir		[in] com::sun::star::linguistic2::XDictionaryEventListener xListener );
263cdf0e10cSrcweir
264cdf0e10cSrcweir};
265cdf0e10cSrcweir
266cdf0e10cSrcweir//=============================================================================
267cdf0e10cSrcweir
268cdf0e10cSrcweir}; }; }; };
269cdf0e10cSrcweir
270cdf0e10cSrcweir#endif
271cdf0e10cSrcweir
272