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 10cdf0e10cSrcweir * 11d1766043SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 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. 19cdf0e10cSrcweir * 20d1766043SAndrew Rist *************************************************************/ 21d1766043SAndrew Rist 22d1766043SAndrew Rist 23cdf0e10cSrcweir#ifndef __com_sun_star_linguistic2_XConversionDictionary_idl__ 24cdf0e10cSrcweir#define __com_sun_star_linguistic2_XConversionDictionary_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_lang_Locale_idl__ 32cdf0e10cSrcweir#include <com/sun/star/lang/Locale.idl> 33cdf0e10cSrcweir#endif 34cdf0e10cSrcweir 35cdf0e10cSrcweir#ifndef __com_sun_star_linguistic2_ConversionDictionaryType_idl__ 36cdf0e10cSrcweir#include <com/sun/star/linguistic2/ConversionDictionaryType.idl> 37cdf0e10cSrcweir#endif 38cdf0e10cSrcweir 39cdf0e10cSrcweir#ifndef __com_sun_star_linguistic2_ConversionDirection_idl__ 40cdf0e10cSrcweir#include <com/sun/star/linguistic2/ConversionDirection.idl> 41cdf0e10cSrcweir#endif 42cdf0e10cSrcweir 43cdf0e10cSrcweir#ifndef __com_sun_star_lang_IllegalArgumentException_idl__ 44cdf0e10cSrcweir#include <com/sun/star/lang/IllegalArgumentException.idl> 45cdf0e10cSrcweir#endif 46cdf0e10cSrcweir 47cdf0e10cSrcweir#ifndef __com_sun_star_container_ElementExistException_idl__ 48cdf0e10cSrcweir#include <com/sun/star/container/ElementExistException.idl> 49cdf0e10cSrcweir#endif 50cdf0e10cSrcweir 51cdf0e10cSrcweir#ifndef __com_sun_star_container_NoSuchElementException_idl__ 52cdf0e10cSrcweir#include <com/sun/star/container/NoSuchElementException.idl> 53cdf0e10cSrcweir#endif 54cdf0e10cSrcweir 55cdf0e10cSrcweir 56cdf0e10cSrcweir//============================================================================= 57cdf0e10cSrcweir 58cdf0e10cSrcweirmodule com { module sun { module star { module linguistic2 { 59cdf0e10cSrcweir 60cdf0e10cSrcweir//============================================================================= 61cdf0e10cSrcweir/** Allows the user to access a conversion dictionary. 62cdf0e10cSrcweir 63cdf0e10cSrcweir <p>The dictionary consists of entries (pairs) of the form 64cdf0e10cSrcweir ( aLeftText, aRightText ). 65cdf0e10cSrcweir Those pairs can be added and removed. Also it can be looked 66cdf0e10cSrcweir for all entries where the left text or the right text matches 67cdf0e10cSrcweir a given text. Thus it can be used for conversions in both 68cdf0e10cSrcweir directions.</p> 69cdf0e10cSrcweir 70cdf0e10cSrcweir <p>Restrictions to what has to be the left and right text are usually 71cdf0e10cSrcweir given by specific services implementing this interface.</p> 72cdf0e10cSrcweir 73cdf0e10cSrcweir @see com::sun::star::linguistic2::ConversionDictionary 74cdf0e10cSrcweir @see com::sun::star::linguistic2::HangulHanjaConversionDictionary 75cdf0e10cSrcweir 76*d695a2a0SJürgen Schmidt @since OpenOffice 1.1.2 77cdf0e10cSrcweir*/ 78cdf0e10cSrcweirpublished interface XConversionDictionary : com::sun::star::uno::XInterface 79cdf0e10cSrcweir{ 80cdf0e10cSrcweir //------------------------------------------------------------------------- 81cdf0e10cSrcweir /** 82cdf0e10cSrcweir @returns 83cdf0e10cSrcweir the name of the dictionary. 84cdf0e10cSrcweir */ 85cdf0e10cSrcweir string getName(); 86cdf0e10cSrcweir 87cdf0e10cSrcweir //------------------------------------------------------------------------- 88cdf0e10cSrcweir /** 89cdf0e10cSrcweir @returns 90cdf0e10cSrcweir the language supported by the dictionary. 91cdf0e10cSrcweir 92cdf0e10cSrcweir @see com::sun::star::lang::Locale 93cdf0e10cSrcweir */ 94cdf0e10cSrcweir com::sun::star::lang::Locale getLocale(); 95cdf0e10cSrcweir 96cdf0e10cSrcweir //------------------------------------------------------------------------- 97cdf0e10cSrcweir /** 98cdf0e10cSrcweir @returns 99cdf0e10cSrcweir the conversion type supported by the dictionary. 100cdf0e10cSrcweir 101cdf0e10cSrcweir @see com::sun::star::linguistic2::ConversionDictionaryType 102cdf0e10cSrcweir */ 103cdf0e10cSrcweir short getConversionType(); 104cdf0e10cSrcweir 105cdf0e10cSrcweir //------------------------------------------------------------------------- 106cdf0e10cSrcweir /** specifies whether the dictionary should be used or not . 107cdf0e10cSrcweir 108cdf0e10cSrcweir @param bAcvtivate 109cdf0e10cSrcweir <TRUE/> if the dictionary should be used, <FALSE/> otherwise. 110cdf0e10cSrcweir 111cdf0e10cSrcweir */ 112cdf0e10cSrcweir void setActive( [in] boolean bActivate ); 113cdf0e10cSrcweir 114cdf0e10cSrcweir //------------------------------------------------------------------------- 115cdf0e10cSrcweir /** 116cdf0e10cSrcweir @returns 117cdf0e10cSrcweir <TRUE/> if the dictionary is active, <FALSE/> otherwise. 118cdf0e10cSrcweir */ 119cdf0e10cSrcweir boolean isActive(); 120cdf0e10cSrcweir 121cdf0e10cSrcweir //------------------------------------------------------------------------- 122cdf0e10cSrcweir /** removes all entries from the dictionary. 123cdf0e10cSrcweir */ 124cdf0e10cSrcweir void clear(); 125cdf0e10cSrcweir 126cdf0e10cSrcweir //------------------------------------------------------------------------- 127cdf0e10cSrcweir /** searches for entries or conversions that match the given text. 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 conversions found for the supplied text. 135cdf0e10cSrcweir If no nothing was found, it is empty. 136cdf0e10cSrcweir 137cdf0e10cSrcweir @param aText 138cdf0e10cSrcweir the text where the substring to be looked for will be taken from. 139cdf0e10cSrcweir Depending on the conversion direction parameter it specifies 140cdf0e10cSrcweir either the left text or the right text to look for. 141cdf0e10cSrcweir @param nStartPos 142cdf0e10cSrcweir the starting pos of the substring to be looked for. 143cdf0e10cSrcweir @param nLength 144cdf0e10cSrcweir the length of the substring to be looked for. 145cdf0e10cSrcweir 146cdf0e10cSrcweir @param eConversionDirection 147cdf0e10cSrcweir specifies the direction of the conversion to look for. 148cdf0e10cSrcweir It is one of 149cdf0e10cSrcweir <type scope="com::sun::star::linguistic2">ConversionDirection</type>. 150cdf0e10cSrcweir 151cdf0e10cSrcweir @param nTextConversionOptions 152cdf0e10cSrcweir Combination of <type scope="com::sun::star::i18n">TextConversionOption</type> 153cdf0e10cSrcweir values. 154cdf0e10cSrcweir 155cdf0e10cSrcweir @throws com::sun::star::lang::IllegalArgumentException 156cdf0e10cSrcweir if the locale is not supported by the dictionary or if 157cdf0e10cSrcweir nTextConversionOptions is invalid for the given locale. 158cdf0e10cSrcweir */ 159cdf0e10cSrcweir sequence< string > getConversions( 160cdf0e10cSrcweir [in] string aText, 161cdf0e10cSrcweir [in] long nStartPos, 162cdf0e10cSrcweir [in] long nLength, 163cdf0e10cSrcweir [in] com::sun::star::linguistic2::ConversionDirection eDirection, 164cdf0e10cSrcweir [in] long nTextConversionOptions ) 165cdf0e10cSrcweir raises( com::sun::star::lang::IllegalArgumentException ); 166cdf0e10cSrcweir 167cdf0e10cSrcweir //------------------------------------------------------------------------- 168cdf0e10cSrcweir /** is used to add a conversion pair to the dictionary. 169cdf0e10cSrcweir 170cdf0e10cSrcweir @param aLeftText 171cdf0e10cSrcweir the left text of the pair to be added. 172cdf0e10cSrcweir 173cdf0e10cSrcweir @param aRightText 174cdf0e10cSrcweir the right text of the pair to be added. 175cdf0e10cSrcweir 176cdf0e10cSrcweir @throws com::sun::star::lang::IllegalArgumentException 177cdf0e10cSrcweir if the arguments are invalid. 178cdf0e10cSrcweir For example if the specifications defined by the service 179cdf0e10cSrcweir implementing this object are not met. 180cdf0e10cSrcweir 181cdf0e10cSrcweir @throws com::sun::star::container::ElementExistException 182cdf0e10cSrcweir if such an entry already exists. 183cdf0e10cSrcweir */ 184cdf0e10cSrcweir void addEntry( 185cdf0e10cSrcweir [in] string aLeftText, 186cdf0e10cSrcweir [in] string aRightText ) 187cdf0e10cSrcweir raises( com::sun::star::lang::IllegalArgumentException, 188cdf0e10cSrcweir com::sun::star::container::ElementExistException); 189cdf0e10cSrcweir 190cdf0e10cSrcweir //------------------------------------------------------------------------- 191cdf0e10cSrcweir /** removes a conversion pair from the dictionary. 192cdf0e10cSrcweir 193cdf0e10cSrcweir @param aLeftText 194cdf0e10cSrcweir the left text of the pair to be removed. 195cdf0e10cSrcweir 196cdf0e10cSrcweir @param aRightText 197cdf0e10cSrcweir the right text of the pair to be removed. 198cdf0e10cSrcweir 199cdf0e10cSrcweir @throws com::sun::star::container::NoSuchElementException 200cdf0e10cSrcweir if there is no such entry. 201cdf0e10cSrcweir */ 202cdf0e10cSrcweir void removeEntry( 203cdf0e10cSrcweir [in] string aLeftText, 204cdf0e10cSrcweir [in] string aRightText ) 205cdf0e10cSrcweir raises( com::sun::star::container::NoSuchElementException ); 206cdf0e10cSrcweir 207cdf0e10cSrcweir //------------------------------------------------------------------------- 208cdf0e10cSrcweir /** returns the maximum number of characters used as left or right text 209cdf0e10cSrcweir in entries. 210cdf0e10cSrcweir 211cdf0e10cSrcweir @param eDirection 212cdf0e10cSrcweir specifies if the left text or the right text of entries will 213cdf0e10cSrcweir be used. 214cdf0e10cSrcweir 215cdf0e10cSrcweir @see com::sun::star::linguistic2::ConversionDirection 216cdf0e10cSrcweir */ 217cdf0e10cSrcweir short getMaxCharCount( 218cdf0e10cSrcweir [in] com::sun::star::linguistic2::ConversionDirection eDirection ); 219cdf0e10cSrcweir 220cdf0e10cSrcweir //------------------------------------------------------------------------- 221cdf0e10cSrcweir /** 222cdf0e10cSrcweir @returns 223cdf0e10cSrcweir a list of all left or right parts of the dictionaries entries. 224cdf0e10cSrcweir @param eDirection 225cdf0e10cSrcweir specifies if all left or all right parts of the entries 226cdf0e10cSrcweir should be returned. 227cdf0e10cSrcweir */ 228cdf0e10cSrcweir 229cdf0e10cSrcweir sequence< string > getConversionEntries( 230cdf0e10cSrcweir [in] com::sun::star::linguistic2::ConversionDirection eDirection ); 231cdf0e10cSrcweir 232cdf0e10cSrcweir}; 233cdf0e10cSrcweir 234cdf0e10cSrcweir//============================================================================= 235cdf0e10cSrcweir 236cdf0e10cSrcweir}; }; }; }; 237cdf0e10cSrcweir 238cdf0e10cSrcweir#endif 239cdf0e10cSrcweir 240