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