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#ifndef __com_sun_star_script_XTypeConverter_idl__
24#define __com_sun_star_script_XTypeConverter_idl__
25
26#ifndef __com_sun_star_uno_XInterface_idl__
27#include <com/sun/star/uno/XInterface.idl>
28#endif
29
30#ifndef __com_sun_star_reflection_XIdlClass_idl__
31#include <com/sun/star/reflection/XIdlClass.idl>
32#endif
33
34#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
35#include <com/sun/star/lang/IllegalArgumentException.idl>
36#endif
37
38#ifndef __com_sun_star_script_CannotConvertException_idl__
39#include <com/sun/star/script/CannotConvertException.idl>
40#endif
41
42#ifndef __com_sun_star_uno_TypeClass_idl__
43#include <com/sun/star/uno/TypeClass.idl>
44#endif
45
46
47//=============================================================================
48
49 module com {  module sun {  module star {  module script {
50
51//=============================================================================
52
53/** Interface to provide standard type conversions.
54
55    @see Converter
56*/
57published interface XTypeConverter: com::sun::star::uno::XInterface
58{
59	/** Converts the value <code>aFrom</code> to the specified type
60        <code>xDestinationType</code>.
61        Throws an <type>CannotConvertException</type> if the conversion
62        failed.
63        @param aFrom
64               source value
65        @param xDestinationType
66               destination type
67        @return
68                converted value (any carrying value of type <code>xDestinationType</code>
69    */
70	any convertTo(
71        [in] any aFrom,
72        [in] type xDestinationType )
73        raises( com::sun::star::lang::IllegalArgumentException,
74                com::sun::star::script::CannotConvertException );
75
76	/** Converts the value <code>aFrom</code> to the specified simple type
77        <code>aDestinationType</code>.
78        Throws an <type>CannotConvertException</type> if the conversion
79        failed and an <type scope="com::sun::star::lang">IllegalArgumentException</type>
80        if the destination
81        <type scope="com::sun::star::uno">TypeClass</type> is not simple,
82        e.g. not long or byte.
83
84        @param aFrom
85               source value
86        @param aDestinationType
87               destination type class
88        @return
89                converted value (any carrying value of type <code>aDestinationType</code>
90    */
91	any convertToSimpleType(
92        [in] any aFrom,
93        [in] com::sun::star::uno::TypeClass aDestinationType )
94        raises( com::sun::star::lang::IllegalArgumentException,
95                com::sun::star::script::CannotConvertException );
96};
97
98//=============================================================================
99
100}; }; }; };
101
102/*=============================================================================
103
104=============================================================================*/
105#endif
106