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