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