1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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
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
52 published
interface XConversionDictionary
: com
::sun
::star
::uno
::XInterface
56 the name of the dictionary.
62 the language supported by the dictionary.
64 @see com::sun::star::lang::Locale
66 com
::sun
::star
::lang
::Locale getLocale
();
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 .
79 `TRUE` if the dictionary should be used, `FALSE` otherwise.
82 void setActive
( [in] boolean bActivate
);
86 `TRUE` if the dictionary is active, `FALSE` otherwise.
90 /** removes all entries from the dictionary.
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
101 the list of conversions found for the supplied text.
102 If no nothing was found, it is empty.
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.
109 the starting pos of the substring to be looked for.
111 the length of the substring to be looked for.
114 specifies the direction of the conversion to look for.
116 com::sun::star::linguistic2::ConversionDirection.
118 @param nTextConversionOptions
119 Combination of com::sun::star::i18n::TextConversionOption
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
(
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.
137 the left text of the pair to be added.
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.
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.
159 the left text of the pair to be removed.
162 the right text of the pair to be removed.
164 @throws com::sun::star::container::NoSuchElementException
165 if there is no such entry.
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
176 specifies if the left text or the right text of entries will
179 @see com::sun::star::linguistic2::ConversionDirection
181 short getMaxCharCount
(
182 [in] com
::sun
::star
::linguistic2
::ConversionDirection eDirection
);
186 a list of all left or right parts of the dictionaries entries.
188 specifies if all left or all right parts of the entries
192 sequence
< string > getConversionEntries
(
193 [in] com
::sun
::star
::linguistic2
::ConversionDirection eDirection
);
202 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */