1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XHyphenator.idl,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef __com_sun_star_linguistic2_XHyphenator_idl__
31 #define __com_sun_star_linguistic2_XHyphenator_idl__
34 #ifndef __com_sun_star_lang_Localeidl__
35 #include
<com
/sun
/star
/lang
/Locale.idl
>
38 #ifndef __com_sun_star_linguistic2_XSupportedLocales_idl__
39 #include
<com
/sun
/star
/linguistic2
/XSupportedLocales.idl
>
42 #ifndef __com_sun_star_linguistic2_XDictionaryList_idl__
43 #include
<com
/sun
/star
/linguistic2
/XDictionaryList.idl
>
46 #ifndef __com_sun_star_linguistic2_XHyphenatedWord_idl__
47 #include
<com
/sun
/star
/linguistic2
/XHyphenatedWord.idl
>
50 #ifndef __com_sun_star_linguistic2_XPossibleHyphens_idl__
51 #include
<com
/sun
/star
/linguistic2
/XPossibleHyphens.idl
>
54 #ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUES_idl_
55 #include
<com
/sun
/star
/beans
/PropertyValues.idl
>
58 #ifndef __com_sun_star_lang_IllegalArgumentException_idl__
59 #include
<com
/sun
/star
/lang
/IllegalArgumentException.idl
>
63 //=============================================================================
65 module com
{ module sun
{ module star
{ module linguistic2
{
67 //=============================================================================
68 /** provides functionality for hyphenation of single words.
70 <P>Its three main functionalities are to provide a suitable position for
71 breaking lines within a word, query about the existence of an alternative
72 spelling at a specific position of a word and provide a list of
73 possible hyphenation positions within a word.</P>
75 <P>A hyphenation position for a word with n characters is represented
76 by a value in the range from 0 to n-2, indicating the position
77 of the character after which the hyphenation is done. That is,
78 it is after the first and before the last character.</P>
80 <P>A valid hyphenation position is a hyphenation position that
81 fulfills all the restrictions implied by the properties
82 MinLeading, MinTrailing and MinWordLength.</P>
84 @see <type scope="com::sun::star::linguistic2">LinguProperties</type>
85 @see <type scope="com::sun::star::linguistic2">XSupportedLocales</type>
87 published
interface XHyphenator
: com
::sun
::star
::linguistic2
::XSupportedLocales
89 //-------------------------------------------------------------------------
90 /** tries to find a valid hyphenation position relative
91 to the beginning of a word.
93 <P>Note: Some languages, for example arabic, are written from right
97 the XHyphenatedWord for the last valid hyphenation position
98 that is less than or equal to nMaxLeading - 1.
99 If there is no such valid hyphenation position, <NULL/> is returned.
102 is the word to be hyphenated.
105 defines the language to be used.
107 <P>If the language is not supported, an IllegalArgumentException
108 exception is raised.</P>
111 specifies the maximum number of characters to remain
112 before the hyphen in the hyphenated word.
114 <P>It has to be greater than or equal to 0.</P>
117 provides property values to be used for this function call only.
118 It is usually empty in order to use the default values supplied
119 with the property set.
121 @see <type scope="com::sun::star::linguistic2">XHyphenatedWord</type>
122 @see <type scope="com::sun::star::lang">Locale</type>
124 com
::sun
::star
::linguistic2
::XHyphenatedWord hyphenate
(
126 [in] com
::sun
::star
::lang
::Locale aLocale
,
127 [in] short nMaxLeading
,
128 [in] com
::sun
::star
::beans
::PropertyValues aProperties
)
129 raises
( com
::sun
::star
::lang
::IllegalArgumentException
);
131 //-------------------------------------------------------------------------
132 /** checks whether hyphenation at a position in a word will result in
133 an alternative spelling or not.
135 <P>An alternative spelling position is a hyphen position where,
136 if hyphenation is done here, the writing of the word changes.
137 Example: "Bäcker" in German pre spelling-reform becomes
138 "Bäkker" if hyphenation is done after the "c".</P>
140 <P>The hyphenation position does not need to be a valid one to be an
141 alternative spelling position.</P>
144 the information about the alternative spelling found at the
145 specified position. Otherwise, if no alternative spelling was
146 found, <NULL/> is returned.
149 is the original word to be looked at for having an alternative
150 spelling, if hyphenation is done at position nIndex.
153 specifies the language to be used.
155 <P>If the language is not supported, an IllegalArgumentException
156 exception is raised.</P>
159 is the position in the word to be looked at.
161 <P>If the length of the word is n, the value of this
162 parameter has to be in the range from 0 to n-2.</P>
165 provides property values to be used for this function call only.
166 It is usually empty in order to use the default values supplied
167 with the property set.
169 @see <type scope="com::sun::star::linguistic2">XHyphenatedWord</type>
170 @see <type scope="com::sun::star::lang">Locale</type>
172 com
::sun
::star
::linguistic2
::XHyphenatedWord queryAlternativeSpelling
(
174 [in] com
::sun
::star
::lang
::Locale aLocale
,
176 [in] com
::sun
::star
::beans
::PropertyValues aProperties
)
177 raises
( com
::sun
::star
::lang
::IllegalArgumentException
);
179 //-------------------------------------------------------------------------
180 /** returns information about all possible hyphenation positions of a word.
183 an <type scope="com::sun::star::linguistic2">XPossibleHyphens</type>
184 for the given word and language if there are any hyphenation
185 positions. <NULL/> otherwise.
188 is the word for which information about the possible
189 hyphenation positions is to be retrieved.
192 defines the language of the word.
194 <P>If the language is not supported, an IllegalArgumentException
195 exception is raised.</P>
198 provides property values to be used for this function call only.
199 It is usually empty in order to use the default values supplied
200 with the property set.
202 @see <type scope="com::sun::star::linguistic2">XPossibleHyphens</type>
203 @see <type scope="com::sun::star::lang">Locale</type>
205 com
::sun
::star
::linguistic2
::XPossibleHyphens createPossibleHyphens
(
207 [in] com
::sun
::star
::lang
::Locale aLocale
,
208 [in] com
::sun
::star
::beans
::PropertyValues aProperties
)
209 raises
( com
::sun
::star
::lang
::IllegalArgumentException
);
213 //=============================================================================