Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / offapi / com / sun / star / linguistic2 / XConversionDictionary.idl
bloba20a4a6130ecf7190dfd4149eb53e78d39aa31ff
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef __com_sun_star_linguistic2_XConversionDictionary_idl__
20 #define __com_sun_star_linguistic2_XConversionDictionary_idl__
23 #include <com/sun/star/uno/XInterface.idl>
24 #include <com/sun/star/lang/Locale.idl>
25 #include <com/sun/star/linguistic2/ConversionDictionaryType.idl>
26 #include <com/sun/star/linguistic2/ConversionDirection.idl>
27 #include <com/sun/star/lang/IllegalArgumentException.idl>
28 #include <com/sun/star/container/ElementExistException.idl>
29 #include <com/sun/star/container/NoSuchElementException.idl>
33 module com { module sun { module star { module linguistic2 {
35 /** Allows the user to access a conversion dictionary.
37 <p>The dictionary consists of entries (pairs) of the form
38 ( aLeftText, aRightText ).
39 Those pairs can be added and removed. Also it can be looked
40 for all entries where the left text or the right text matches
41 a given text. Thus it can be used for conversions in both
42 directions.</p>
44 <p>Restrictions to what has to be the left and right text are usually
45 given by specific services implementing this interface.</p>
47 @see com::sun::star::linguistic2::ConversionDictionary
48 @see com::sun::star::linguistic2::HangulHanjaConversionDictionary
50 @since OOo 1.1.2
52 published interface XConversionDictionary : com::sun::star::uno::XInterface
54 /**
55 @returns
56 the name of the dictionary.
58 string getName();
60 /**
61 @returns
62 the language supported by the dictionary.
64 @see com::sun::star::lang::Locale
66 com::sun::star::lang::Locale getLocale();
68 /**
69 @returns
70 the conversion type supported by the dictionary.
72 @see com::sun::star::linguistic2::ConversionDictionaryType
74 short getConversionType();
76 /** specifies whether the dictionary should be used or not .
78 @param bActivate
79 `TRUE` if the dictionary should be used, `FALSE` otherwise.
82 void setActive( [in] boolean bActivate );
84 /**
85 @returns
86 `TRUE` if the dictionary is active, `FALSE` otherwise.
88 boolean isActive();
90 /** removes all entries from the dictionary.
92 void clear();
94 /** searches for entries or conversions that match the given text.
96 <p>The exact string to be looked for is the substring from the
97 aText parameter that starts at position nStartPos and has the
98 length nLength.</p>
100 @returns
101 the list of conversions found for the supplied text.
102 If no nothing was found, it is empty.
104 @param aText
105 the text where the substring to be looked for will be taken from.
106 Depending on the conversion direction parameter it specifies
107 either the left text or the right text to look for.
108 @param nStartPos
109 the starting pos of the substring to be looked for.
110 @param nLength
111 the length of the substring to be looked for.
113 @param eDirection
114 specifies the direction of the conversion to look for.
115 It is one of
116 com::sun::star::linguistic2::ConversionDirection.
118 @param nTextConversionOptions
119 Combination of com::sun::star::i18n::TextConversionOption
120 values.
122 @throws com::sun::star::lang::IllegalArgumentException
123 if the locale is not supported by the dictionary or if
124 nTextConversionOptions is invalid for the given locale.
126 sequence< string > getConversions(
127 [in] string aText,
128 [in] long nStartPos,
129 [in] long nLength,
130 [in] com::sun::star::linguistic2::ConversionDirection eDirection,
131 [in] long nTextConversionOptions )
132 raises( com::sun::star::lang::IllegalArgumentException );
134 /** is used to add a conversion pair to the dictionary.
136 @param aLeftText
137 the left text of the pair to be added.
139 @param aRightText
140 the right text of the pair to be added.
142 @throws com::sun::star::lang::IllegalArgumentException
143 if the arguments are invalid.
144 For example if the specifications defined by the service
145 implementing this object are not met.
147 @throws com::sun::star::container::ElementExistException
148 if such an entry already exists.
150 void addEntry(
151 [in] string aLeftText,
152 [in] string aRightText )
153 raises( com::sun::star::lang::IllegalArgumentException,
154 com::sun::star::container::ElementExistException);
156 /** removes a conversion pair from the dictionary.
158 @param aLeftText
159 the left text of the pair to be removed.
161 @param aRightText
162 the right text of the pair to be removed.
164 @throws com::sun::star::container::NoSuchElementException
165 if there is no such entry.
167 void removeEntry(
168 [in] string aLeftText,
169 [in] string aRightText )
170 raises( com::sun::star::container::NoSuchElementException );
172 /** returns the maximum number of characters used as left or right text
173 in entries.
175 @param eDirection
176 specifies if the left text or the right text of entries will
177 be used.
179 @see com::sun::star::linguistic2::ConversionDirection
181 short getMaxCharCount(
182 [in] com::sun::star::linguistic2::ConversionDirection eDirection );
185 @returns
186 a list of all left or right parts of the dictionaries entries.
187 @param eDirection
188 specifies if all left or all right parts of the entries
189 should be returned.
192 sequence< string > getConversionEntries(
193 [in] com::sun::star::linguistic2::ConversionDirection eDirection );
198 }; }; }; };
200 #endif
202 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */