1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23
24#ifndef __com_sun_star_i18n_XTextConversion_idl__
25#define __com_sun_star_i18n_XTextConversion_idl__
26
27#ifndef __com_sun_star_uno_XInterface_idl__
28#include <com/sun/star/uno/XInterface.idl>
29#endif
30
31#ifndef __com_sun_star_lang_Locale_idl__
32#include <com/sun/star/lang/Locale.idl>
33#endif
34
35#ifndef __com_sun_star_i18n_TextConversionResult_idl__
36#include <com/sun/star/i18n/TextConversionResult.idl>
37#endif
38
39#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
40#include <com/sun/star/lang/IllegalArgumentException.idl>
41#endif
42
43#ifndef __com_sun_star_lang_NoSupportException_idl__
44#include <com/sun/star/lang/NoSupportException.idl>
45#endif
46
47
48//=============================================================================
49
50module com {  module sun {  module star {  module i18n {
51
52//=============================================================================
53
54/** Method to convert text from one type to another
55
56	 @since OOo 1.1.2
57*/
58published interface XTextConversion : ::com::sun::star::uno::XInterface
59{
60	//---------------------------------------------------------------------
61	/** Method to search dictionaries for the conversion candidates.
62
63		@param aText
64			Text string to be converted.
65		@param nStartPos
66			The start position in aText for the conversion
67		@param nLength
68			The length of the partion in aText for the conversion
69		@param aLocal
70			Locale the conversion is referring to.
71		@param nTextConversionType
72			One of <type>TextConversionType</type> values.
73		@param nTextConversionOptions
74			Combination of <type>TextConversionOption</type> values.
75        @returns
76            <type>TextConversionResult</type>
77
78        @throws NoSupportException
79            when <var>nConversionDictionaryType</var> is not known by the implementation,
80            or when the locale is not supported.
81	*/
82	TextConversionResult getConversions(
83            [in] string aText,
84            [in] long nStartPos,
85            [in] long nLength,
86            [in] ::com::sun::star::lang::Locale aLocale,
87            [in] short nTextConversionType,
88            [in] long nTextConversionOptions )
89        raises( com::sun::star::lang::IllegalArgumentException,
90                com::sun::star::lang::NoSupportException );
91
92	//---------------------------------------------------------------------
93	/** Method to search dictionaries for the conversion candidate, if there
94        are multiple candidates, it will return first one. This is for the
95        conversion in non-interactive mode.
96
97		@param aText
98			Text string to be converted.
99		@param nStartPos
100			The start position in aText for the conversion
101		@param nLength
102			The length of the partion in aText for the conversion
103		@param aLocal
104			Locale the conversion is referring to.
105		@param nTextConversionType
106			One of <type>TextConversionType</type> values.
107		@param nTextConversionOptions
108			Combination of <type>TextConversionOption</type> values.
109        @returns
110            Converted text
111
112        @throws NoSupportException
113            when <var>nConversionDictionaryType</var> is not known by the implementation,
114            or when the locale is not supported.
115	*/
116	string getConversion(
117            [in] string aText,
118            [in] long nStartPos,
119            [in] long nLength,
120            [in] ::com::sun::star::lang::Locale aLocale,
121            [in] short nTextConversionType,
122            [in] long nTextConversionOptions )
123        raises( com::sun::star::lang::IllegalArgumentException,
124                com::sun::star::lang::NoSupportException );
125
126	//---------------------------------------------------------------------
127    /** Method to query if the conversion type should be interactive or
128        non-interactive mode.
129
130        @param aLocal
131            Locale the conversion is referring to.
132        @param nTextConversionType
133            One of <type>TextConversionType</type> values.
134        @param nTextConversionOptions
135            Combination of <type>TextConversionOption</type> values.
136        @returns
137            <TRUE/> if the entry is a valid entry for the dictionary
138            <FALSE/> otherwise.
139
140        @throws NoSupportException
141            when <var>nConversionDictionaryType</var> is not known by the implementation,
142            or when the locale is not supported.
143    */
144    boolean interactiveConversion(
145            [in] ::com::sun::star::lang::Locale aLocale,
146            [in] short nTextConversionType,
147            [in] long nTextConversionOptions )
148        raises( com::sun::star::lang::IllegalArgumentException,
149                com::sun::star::lang::NoSupportException );
150};
151
152
153//=============================================================================
154
155}; }; }; };
156
157#endif
158