xref: /AOO41X/main/offapi/com/sun/star/linguistic2/XHyphenator.idl (revision d1766043198e81d0bcfc626e12893e7b4d7e31ca)
1*d1766043SAndrew Rist/**************************************************************
2cdf0e10cSrcweir *
3*d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*d1766043SAndrew Rist * or more contributor license agreements.  See the NOTICE file
5*d1766043SAndrew Rist * distributed with this work for additional information
6*d1766043SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
7*d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*d1766043SAndrew Rist * "License"); you may not use this file except in compliance
9*d1766043SAndrew Rist * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir *
11*d1766043SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir *
13*d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*d1766043SAndrew Rist * software distributed under the License is distributed on an
15*d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*d1766043SAndrew Rist * KIND, either express or implied.  See the License for the
17*d1766043SAndrew Rist * specific language governing permissions and limitations
18*d1766043SAndrew Rist * under the License.
19cdf0e10cSrcweir *
20*d1766043SAndrew Rist *************************************************************/
21*d1766043SAndrew Rist
22*d1766043SAndrew Rist
23cdf0e10cSrcweir#ifndef __com_sun_star_linguistic2_XHyphenator_idl__
24cdf0e10cSrcweir#define __com_sun_star_linguistic2_XHyphenator_idl__
25cdf0e10cSrcweir
26cdf0e10cSrcweir
27cdf0e10cSrcweir#ifndef __com_sun_star_lang_Localeidl__
28cdf0e10cSrcweir#include <com/sun/star/lang/Locale.idl>
29cdf0e10cSrcweir#endif
30cdf0e10cSrcweir
31cdf0e10cSrcweir#ifndef __com_sun_star_linguistic2_XSupportedLocales_idl__
32cdf0e10cSrcweir#include <com/sun/star/linguistic2/XSupportedLocales.idl>
33cdf0e10cSrcweir#endif
34cdf0e10cSrcweir
35cdf0e10cSrcweir#ifndef __com_sun_star_linguistic2_XDictionaryList_idl__
36cdf0e10cSrcweir#include <com/sun/star/linguistic2/XDictionaryList.idl>
37cdf0e10cSrcweir#endif
38cdf0e10cSrcweir
39cdf0e10cSrcweir#ifndef __com_sun_star_linguistic2_XHyphenatedWord_idl__
40cdf0e10cSrcweir#include <com/sun/star/linguistic2/XHyphenatedWord.idl>
41cdf0e10cSrcweir#endif
42cdf0e10cSrcweir
43cdf0e10cSrcweir#ifndef __com_sun_star_linguistic2_XPossibleHyphens_idl__
44cdf0e10cSrcweir#include <com/sun/star/linguistic2/XPossibleHyphens.idl>
45cdf0e10cSrcweir#endif
46cdf0e10cSrcweir
47cdf0e10cSrcweir#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUES_idl_
48cdf0e10cSrcweir#include <com/sun/star/beans/PropertyValues.idl>
49cdf0e10cSrcweir#endif
50cdf0e10cSrcweir
51cdf0e10cSrcweir#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
52cdf0e10cSrcweir#include <com/sun/star/lang/IllegalArgumentException.idl>
53cdf0e10cSrcweir#endif
54cdf0e10cSrcweir
55cdf0e10cSrcweir
56cdf0e10cSrcweir//=============================================================================
57cdf0e10cSrcweir
58cdf0e10cSrcweirmodule com { module sun { module star { module linguistic2 {
59cdf0e10cSrcweir
60cdf0e10cSrcweir//=============================================================================
61cdf0e10cSrcweir/** provides functionality for hyphenation of single words.
62cdf0e10cSrcweir
63cdf0e10cSrcweir	<P>Its three main functionalities are to provide a suitable position for
64cdf0e10cSrcweir	breaking lines within a word, query about the existence of an alternative
65cdf0e10cSrcweir	spelling at a specific position of a word and provide a list of
66cdf0e10cSrcweir	possible hyphenation positions within a word.</P>
67cdf0e10cSrcweir
68cdf0e10cSrcweir	<P>A hyphenation position for a word with n characters is represented
69cdf0e10cSrcweir	by a value in the range from 0 to n-2, indicating the position
70cdf0e10cSrcweir	of the character after which the hyphenation is done. That is,
71cdf0e10cSrcweir	it is after the first and before the last character.</P>
72cdf0e10cSrcweir
73cdf0e10cSrcweir	<P>A valid hyphenation position is a hyphenation position that
74cdf0e10cSrcweir	fulfills all the restrictions implied by the properties
75cdf0e10cSrcweir	MinLeading, MinTrailing and MinWordLength.</P>
76cdf0e10cSrcweir
77cdf0e10cSrcweir    @see    <type scope="com::sun::star::linguistic2">LinguProperties</type>
78cdf0e10cSrcweir    @see    <type scope="com::sun::star::linguistic2">XSupportedLocales</type>
79cdf0e10cSrcweir*/
80cdf0e10cSrcweirpublished interface XHyphenator : com::sun::star::linguistic2::XSupportedLocales
81cdf0e10cSrcweir{
82cdf0e10cSrcweir	//-------------------------------------------------------------------------
83cdf0e10cSrcweir	/** tries to find a valid hyphenation position relative
84cdf0e10cSrcweir		to the beginning of a word.
85cdf0e10cSrcweir
86cdf0e10cSrcweir		<P>Note: Some languages, for example arabic, are written from right
87cdf0e10cSrcweir		to left.</P>
88cdf0e10cSrcweir
89cdf0e10cSrcweir		@returns
90cdf0e10cSrcweir			the XHyphenatedWord for the last valid hyphenation position
91cdf0e10cSrcweir	 		that is less than or equal to nMaxLeading - 1.
92cdf0e10cSrcweir			If there is no such valid hyphenation position, <NULL/> is returned.
93cdf0e10cSrcweir
94cdf0e10cSrcweir		@param  aWord
95cdf0e10cSrcweir			is the word to be hyphenated.
96cdf0e10cSrcweir
97cdf0e10cSrcweir		@param  aLocale
98cdf0e10cSrcweir			defines the language to be used.
99cdf0e10cSrcweir
100cdf0e10cSrcweir			<P>If the language is not supported, an IllegalArgumentException
101cdf0e10cSrcweir			exception is raised.</P>
102cdf0e10cSrcweir
103cdf0e10cSrcweir		@param  nMaxLeading
104cdf0e10cSrcweir			specifies the maximum number of characters to remain
105cdf0e10cSrcweir			before the hyphen in the hyphenated word.
106cdf0e10cSrcweir
107cdf0e10cSrcweir			<P>It has to be greater than or equal to 0.</P>
108cdf0e10cSrcweir
109cdf0e10cSrcweir		@param aProperties
110cdf0e10cSrcweir			provides property values to be used for this function call only.
111cdf0e10cSrcweir			It is usually empty in order to use the default values supplied
112cdf0e10cSrcweir			with the property set.
113cdf0e10cSrcweir
114cdf0e10cSrcweir        @see    <type scope="com::sun::star::linguistic2">XHyphenatedWord</type>
115cdf0e10cSrcweir        @see    <type scope="com::sun::star::lang">Locale</type>
116cdf0e10cSrcweir	*/
117cdf0e10cSrcweir	com::sun::star::linguistic2::XHyphenatedWord hyphenate(
118cdf0e10cSrcweir			[in] string aWord,
119cdf0e10cSrcweir			[in] com::sun::star::lang::Locale aLocale,
120cdf0e10cSrcweir			[in] short nMaxLeading,
121cdf0e10cSrcweir			[in] com::sun::star::beans::PropertyValues aProperties )
122cdf0e10cSrcweir		raises( com::sun::star::lang::IllegalArgumentException );
123cdf0e10cSrcweir
124cdf0e10cSrcweir	//-------------------------------------------------------------------------
125cdf0e10cSrcweir	/** checks whether hyphenation at a position in a word will result in
126cdf0e10cSrcweir		an alternative spelling or not.
127cdf0e10cSrcweir
128cdf0e10cSrcweir		<P>An alternative spelling position is a hyphen position where,
129cdf0e10cSrcweir		if hyphenation is done here, the writing of the word changes.
130cdf0e10cSrcweir		Example: "B&auml;cker" in German pre spelling-reform becomes
131cdf0e10cSrcweir	 	"B&auml;kker" if hyphenation is done after the "c".</P>
132cdf0e10cSrcweir
133cdf0e10cSrcweir		<P>The hyphenation position does not need to be a valid one to be an
134cdf0e10cSrcweir		alternative spelling position.</P>
135cdf0e10cSrcweir
136cdf0e10cSrcweir		@returns
137cdf0e10cSrcweir			the information about the alternative spelling found at the
138cdf0e10cSrcweir			specified position. Otherwise, if no alternative spelling was
139cdf0e10cSrcweir			found, <NULL/> is returned.
140cdf0e10cSrcweir
141cdf0e10cSrcweir		@param  aWord
142cdf0e10cSrcweir			is the original word to be looked at for having an alternative
143cdf0e10cSrcweir			spelling, if hyphenation is done at position nIndex.
144cdf0e10cSrcweir
145cdf0e10cSrcweir		@param aLocale
146cdf0e10cSrcweir			specifies the language to be used.
147cdf0e10cSrcweir
148cdf0e10cSrcweir			<P>If the language is not supported, an IllegalArgumentException
149cdf0e10cSrcweir			exception is raised.</P>
150cdf0e10cSrcweir
151cdf0e10cSrcweir		@param  nIndex
152cdf0e10cSrcweir			is the position in the word to be looked at.
153cdf0e10cSrcweir
154cdf0e10cSrcweir			<P>If the length of the word is n, the value of this
155cdf0e10cSrcweir			parameter has to be in the range from 0 to n-2.</P>
156cdf0e10cSrcweir
157cdf0e10cSrcweir		@param aProperties
158cdf0e10cSrcweir			provides property values to be used for this function call only.
159cdf0e10cSrcweir			It is usually empty in order to use the default values supplied
160cdf0e10cSrcweir			with the property set.
161cdf0e10cSrcweir
162cdf0e10cSrcweir        @see    <type scope="com::sun::star::linguistic2">XHyphenatedWord</type>
163cdf0e10cSrcweir        @see    <type scope="com::sun::star::lang">Locale</type>
164cdf0e10cSrcweir	*/
165cdf0e10cSrcweir	com::sun::star::linguistic2::XHyphenatedWord queryAlternativeSpelling(
166cdf0e10cSrcweir			[in] string aWord,
167cdf0e10cSrcweir			[in] com::sun::star::lang::Locale aLocale,
168cdf0e10cSrcweir			[in] short nIndex,
169cdf0e10cSrcweir			[in] com::sun::star::beans::PropertyValues aProperties )
170cdf0e10cSrcweir		raises( com::sun::star::lang::IllegalArgumentException );
171cdf0e10cSrcweir
172cdf0e10cSrcweir	//-------------------------------------------------------------------------
173cdf0e10cSrcweir	/** returns information about all possible hyphenation positions of a word.
174cdf0e10cSrcweir
175cdf0e10cSrcweir		@returns
176cdf0e10cSrcweir			an <type scope="com::sun::star::linguistic2">XPossibleHyphens</type>
177cdf0e10cSrcweir			for the given word and language if there are any hyphenation
178cdf0e10cSrcweir			positions. <NULL/> otherwise.
179cdf0e10cSrcweir
180cdf0e10cSrcweir		@param  aWord
181cdf0e10cSrcweir			is the word for which information about the possible
182cdf0e10cSrcweir	 		hyphenation positions is to be retrieved.
183cdf0e10cSrcweir
184cdf0e10cSrcweir		@param  aLocale
185cdf0e10cSrcweir			defines the language of the word.
186cdf0e10cSrcweir
187cdf0e10cSrcweir			<P>If the language is not supported, an IllegalArgumentException
188cdf0e10cSrcweir			exception is raised.</P>
189cdf0e10cSrcweir
190cdf0e10cSrcweir		@param aProperties
191cdf0e10cSrcweir			provides property values to be used for this function call only.
192cdf0e10cSrcweir			It is usually empty in order to use the default values supplied
193cdf0e10cSrcweir			with the property set.
194cdf0e10cSrcweir
195cdf0e10cSrcweir        @see    <type scope="com::sun::star::linguistic2">XPossibleHyphens</type>
196cdf0e10cSrcweir        @see    <type scope="com::sun::star::lang">Locale</type>
197cdf0e10cSrcweir	*/
198cdf0e10cSrcweir	com::sun::star::linguistic2::XPossibleHyphens createPossibleHyphens(
199cdf0e10cSrcweir			[in] string aWord,
200cdf0e10cSrcweir			[in] com::sun::star::lang::Locale aLocale,
201cdf0e10cSrcweir			[in] com::sun::star::beans::PropertyValues aProperties )
202cdf0e10cSrcweir		raises( com::sun::star::lang::IllegalArgumentException );
203cdf0e10cSrcweir
204cdf0e10cSrcweir};
205cdf0e10cSrcweir
206cdf0e10cSrcweir//=============================================================================
207cdf0e10cSrcweir
208cdf0e10cSrcweir}; }; }; };
209cdf0e10cSrcweir
210cdf0e10cSrcweir#endif
211cdf0e10cSrcweir
212