summaryrefslogtreecommitdiffstats
path: root/offapi/com/sun/star/linguistic2/XConversionDictionary.idl
blob: a20a4a6130ecf7190dfd4149eb53e78d39aa31ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 */
#ifndef __com_sun_star_linguistic2_XConversionDictionary_idl__
#define __com_sun_star_linguistic2_XConversionDictionary_idl__


#include <com/sun/star/uno/XInterface.idl>
#include <com/sun/star/lang/Locale.idl>
#include <com/sun/star/linguistic2/ConversionDictionaryType.idl>
#include <com/sun/star/linguistic2/ConversionDirection.idl>
#include <com/sun/star/lang/IllegalArgumentException.idl>
#include <com/sun/star/container/ElementExistException.idl>
#include <com/sun/star/container/NoSuchElementException.idl>



module com { module sun { module star { module linguistic2 {

/** Allows the user to access a conversion dictionary.

    <p>The dictionary consists of entries (pairs) of the form
    ( aLeftText, aRightText ).
    Those pairs can be added and removed. Also it can be looked
    for all entries where the left text or the right text matches
    a given text. Thus it can be used for conversions in both
    directions.</p>

    <p>Restrictions to what has to be the left and right text are usually
    given by specific services implementing this interface.</p>

    @see com::sun::star::linguistic2::ConversionDictionary
    @see com::sun::star::linguistic2::HangulHanjaConversionDictionary

     @since OOo 1.1.2
*/
published interface XConversionDictionary : com::sun::star::uno::XInterface
{
    /**
        @returns
            the name of the dictionary.
    */
    string getName();

    /**
        @returns
            the language supported by the dictionary.

        @see    com::sun::star::lang::Locale
    */
    com::sun::star::lang::Locale getLocale();

    /**
        @returns
            the conversion type supported by the dictionary.

        @see    com::sun::star::linguistic2::ConversionDictionaryType
    */
    short getConversionType();

    /** specifies whether the dictionary should be used or not .

        @param  bActivate
            `TRUE` if the dictionary should be used, `FALSE` otherwise.

    */
    void setActive( [in] boolean bActivate );

    /**
        @returns
            `TRUE` if the dictionary is active, `FALSE` otherwise.
    */
    boolean isActive();

    /** removes all entries from the dictionary.
    */
    void clear();

    /** searches for entries or conversions that match the given text.

        <p>The exact string to be looked for is the substring from the
        aText parameter that starts at position nStartPos and has the
        length nLength.</p>

        @returns
            the list of conversions found for the supplied text.
            If no nothing was found, it is empty.

        @param  aText
            the text where the substring to be looked for will be taken from.
            Depending on the conversion direction parameter it specifies
            either the left text or the right text to look for.
        @param  nStartPos
            the starting pos of the substring to be looked for.
        @param  nLength
            the length of the substring to be looked for.

        @param eDirection
            specifies the direction of the conversion to look for.
            It is one of
            com::sun::star::linguistic2::ConversionDirection.

        @param nTextConversionOptions
            Combination of com::sun::star::i18n::TextConversionOption
            values.

        @throws com::sun::star::lang::IllegalArgumentException
            if the locale is not supported by the dictionary or if
            nTextConversionOptions is invalid for the given locale.
    */
    sequence< string > getConversions(
            [in] string aText,
            [in] long nStartPos,
            [in] long nLength,
            [in] com::sun::star::linguistic2::ConversionDirection eDirection,
            [in] long nTextConversionOptions )
        raises( com::sun::star::lang::IllegalArgumentException );

    /** is used to add a conversion pair to the dictionary.

        @param  aLeftText
            the left text of the pair to be added.

        @param  aRightText
            the right text of the pair to be added.

        @throws com::sun::star::lang::IllegalArgumentException
            if the arguments are invalid.
            For example if the specifications defined by the service
            implementing this object are not met.

        @throws com::sun::star::container::ElementExistException
            if such an entry already exists.
    */
    void addEntry(
            [in] string     aLeftText,
            [in] string     aRightText )
        raises( com::sun::star::lang::IllegalArgumentException,
                com::sun::star::container::ElementExistException);

    /** removes a conversion pair from the dictionary.

        @param  aLeftText
            the left text of the pair to be removed.

        @param  aRightText
            the right text of the pair to be removed.

        @throws com::sun::star::container::NoSuchElementException
            if there is no such entry.
    */
    void removeEntry(
            [in] string     aLeftText,
            [in] string     aRightText )
        raises( com::sun::star::container::NoSuchElementException );

    /** returns the maximum number of characters used as left or right text
        in entries.

        @param eDirection
            specifies if the left text or the right text of entries will
            be used.

        @see com::sun::star::linguistic2::ConversionDirection
    */
    short getMaxCharCount(
            [in] com::sun::star::linguistic2::ConversionDirection eDirection );

    /**
        @returns
            a list of all left or right parts of the dictionaries entries.
        @param  eDirection
            specifies if all left or all right parts of the entries
            should be returned.
    */

    sequence< string > getConversionEntries(
            [in] com::sun::star::linguistic2::ConversionDirection eDirection );

};


}; }; }; };

#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */