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_XConversionDictionaryList_idl__ 24#define __com_sun_star_linguistic2_XConversionDictionaryList_idl__ 25 26 27#ifndef __com_sun_star_uno_XInterface_idl__ 28#include <com/sun/star/uno/XInterface.idl> 29#endif 30 31#ifndef __com_sun_star_container_XNameContainer_idl__ 32#include <com/sun/star/container/XNameContainer.idl> 33#endif 34 35#ifndef __com_sun_star_linguistic2_XConversionDictionary_idl__ 36#include <com/sun/star/linguistic2/XConversionDictionary.idl> 37#endif 38 39#ifndef __com_sun_star_lang_IllegalArgumentException_idl__ 40#include <com/sun/star/lang/IllegalArgumentException.idl> 41#endif 42 43#ifndef __com_sun_star_lang_NoSupportException_idl__ 44#include <com/sun/star/lang/NoSupportException.idl> 45#endif 46 47#ifndef __com_sun_star_container_ElementExistException_idl__ 48#include <com/sun/star/container/ElementExistException.idl> 49#endif 50 51 52//============================================================================= 53 54module com { module sun { module star { module linguistic2 { 55 56//============================================================================= 57/** is used to manage and maintain a list of conversion dictionaries. 58 59 <p>The dictionaries added to the list may or may not support the 60 <type scope="com::sun::star::util">XFlushable</type> interface. 61 If they do those dictionaries have to be flushed upon termination 62 of the dictionary list.</p> 63 64 @since OpenOffice 1.1.2 65*/ 66published interface XConversionDictionaryList : com::sun::star::uno::XInterface 67{ 68 //------------------------------------------------------------------------- 69 /** 70 @returns 71 the name container interface to the dictionaries in the list. 72 73 <p>The interface can be used to add, remove or retrieve dictionaries 74 from the list by specifying the name of the dictionary, and 75 (in case of inserting) the interface to the dictionary as second 76 parameter.</p> 77 78 <p>A dictionary to be added must support the 79 <type scope="com::sun::star::linguistic2">XConversionDictionary</type> 80 interface. 81 The dictionary to be added needs not necessarily be created by 82 this service.</p> 83 84 <p>The <member scope="com::sun::star::container::XNameReplace">replaceByName</member> 85 function is implemented empty since renaming of dictionaries 86 is not allowed.</p> 87 */ 88 com::sun::star::container::XNameContainer getDictionaryContainer(); 89 90 //------------------------------------------------------------------------- 91 /** creates a new dictionary and adds it to the dictionary list. 92 93 <p>The dictionary will be empty and active.</p> 94 95 @returns 96 an empty dictionary with the given name, locale and 97 conversion type. 98 <NULL/> on failure. 99 100 @param aName 101 is the name of the dictionary (should be unique). 102 103 @param aLocale 104 defines the language of the dictionary. 105 106 @param nConversionDictionaryType 107 One of <type scope="com::sun::star::linguistic2">ConversionDictionaryType</type> values. 108 109 @throws NoSupportException 110 when <var>nConversionDictionaryType</var> is not known by the implementation. 111 112 @throws ElementExistException 113 when a dictionary with the specified name already exists. 114 */ 115 com::sun::star::linguistic2::XConversionDictionary addNewDictionary( 116 [in] string aName, 117 [in] com::sun::star::lang::Locale aLocale, 118 [in] short nConversionDictionaryType ) 119 raises( com::sun::star::lang::NoSupportException, 120 com::sun::star::container::ElementExistException ); 121 122 //------------------------------------------------------------------------- 123 /** searches for entries that match the given text. 124 125 <p>All active dictionaries with matching locales and conversion 126 type will be searched 127 for entries matching the given text.</p> 128 129 <p>The exact string to be looked for is the substring from the 130 aText parameter that starts at position nStartPos and has the 131 length nLength.</p> 132 133 @returns 134 the list of entries found. If no entry was found, 135 it is empty. 136 137 @param aText 138 the text where the substring to be looked for will be taken from. 139 @param nStartPos 140 the starting pos of the substring to be looked for. 141 @param nLength 142 the length of the substring to be looked for. 143 144 145 @param aLocale 146 Locale the conversion is refered to. 147 148 @param nConversionDictionaryType 149 specifies the type of conversion the dictionary 150 can be used for. It is one of 151 <type scope="com::sun::star::linguistic2">ConversionDictionaryType</type>. 152 153 @param eConversionDirection 154 specifies the direction of the conversion to look for. 155 It is one of 156 <type scope="com::sun::star::linguistic2">ConversionDirection</type>. 157 158 @param nTextConversionOptions 159 Combination of <type scope="com::sun::star::i18n">TextConversionOption</type> 160 values. 161 162 @throws com::sun::star::lang::IllegalArgumentException 163 if the nTextConversionOptions parameter is invalid for 164 the given locale. 165 166 @throws NoSupportException 167 when <var>nConversionDictionaryType</var> is not known by the implementation, 168 or when the locale is not supported (i.e. there are no dictionaries 169 for that locale available). 170 */ 171 sequence< string > queryConversions( 172 [in] string aText, 173 [in] long nStartPos, 174 [in] long nLength, 175 [in] com::sun::star::lang::Locale aLocale, 176 [in] short nConversionDictionaryType, 177 [in] com::sun::star::linguistic2::ConversionDirection eDirection, 178 [in] long nTextConversionOptions ) 179 raises( com::sun::star::lang::IllegalArgumentException, 180 com::sun::star::lang::NoSupportException ); 181 182 //------------------------------------------------------------------------- 183 /** returns the maximum number of characters used as left or right text 184 in entries. 185 186 <p>All active dictionaries of the specified locale and type 187 will be looked up to get the result.</p> 188 <p>The parameter eDirection specifies if only the left text or the 189 right text from entries should be considered.</p> 190 191 @param aLocale 192 Locale the conversion is refered to. 193 @param nConversionDictionaryType 194 specifies the type of conversion dictionaries to be looked up. 195 It is one of 196 <type scope="com::sun::star::linguistic2">ConversionDictionaryType</type>. 197 @param eDirection 198 specifies if the left text or the right text of entries will 199 be used. 200 201 @see com::sun::star::linguistic2::ConversionDirection 202 */ 203 short queryMaxCharCount( 204 [in] com::sun::star::lang::Locale aLocale, 205 [in] short nConversionDictionaryType, 206 [in] com::sun::star::linguistic2::ConversionDirection eDirection ); 207 208}; 209 210//============================================================================= 211 212}; }; }; }; 213 214#endif 215 216