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_awt_XUnitConversion_idl__ 24#define __com_sun_star_awt_XUnitConversion_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_awt_Point_idl__ 31#include <com/sun/star/awt/Point.idl> 32#endif 33 34#ifndef __com_sun_star_awt_Size_idl__ 35#include <com/sun/star/awt/Size.idl> 36#endif 37 38#ifndef __com_sun_star_lang_IllegalArgumentException_idl__ 39#include <com/sun/star/lang/IllegalArgumentException.idl> 40#endif 41 42//============================================================================= 43 44 module com { module sun { module star { module awt { 45 46//============================================================================= 47 48/** allows converting between different measurement units 49 50 @since OpenOffice 3.0 51 */ 52published interface XUnitConversion: com::sun::star::uno::XInterface 53{ 54 /** converts the given <type>Point</type>, which is specified in pixels, into the given logical unit 55 56 @param Point 57 A given <type>Point</type> in a well known type 58 @param TargetUnit 59 A type from <type scope="com::sun::star::util">MeasureUnit</type> in which the Point will convert to. 60 61 @return 62 Returns a new <type>Point</type> in the TargetUnit type format. 63 */ 64 com::sun::star::awt::Point convertPointToLogic( [in] com::sun::star::awt::Point Point, [in] short TargetUnit ) 65 raises ( com::sun::star::lang::IllegalArgumentException ); 66 67 /** converts the given <type>Point</type>, which is specified in the given logical unit, into pixels 68 69 @param Point 70 A given Point in the SourceUnit type 71 @param SourceUnit 72 The type from <type scope="com::sun::star::util">MeasureUnit</type> of the Point. 73 74 @return 75 Return a new <type>Point</type> in Pixel type format. 76 */ 77 com::sun::star::awt::Point convertPointToPixel( [in] com::sun::star::awt::Point aPoint, [in] short SourceUnit ) 78 raises ( com::sun::star::lang::IllegalArgumentException ); 79 80 81 /** converts the given <type>Size</type>, which is specified in pixels, into the given logical unit 82 83 @param aSize 84 A given <type>Size</type> in a well known type 85 @param TargetUnit 86 A type from <type scope="com::sun::star::util">MeasureUnit</type> in which the Size will convert to. 87 88 @return 89 Returns a new <type>Size</type> in the TargetUnit type format. 90 */ 91 com::sun::star::awt::Size convertSizeToLogic( [in] com::sun::star::awt::Size aSize, [in] short TargetUnit ) 92 raises ( com::sun::star::lang::IllegalArgumentException ); 93 94 /** converts the given <type>Size</type>, which is specified in the given logical unit, into pixels 95 96 @param Size 97 A given <type>Size</type> in a well known type 98 @param TargetUnit 99 The type from <type scope="com::sun::star::util">MeasureUnit</type> of the Size. 100 101 @return 102 Returns a new <type>Size</type> in the TargetUnit type format. 103 */ 104 com::sun::star::awt::Size convertSizeToPixel( [in] com::sun::star::awt::Size aSize, [in] short SourceUnit ) 105 raises ( com::sun::star::lang::IllegalArgumentException ); 106 107 108}; 109 110//============================================================================= 111 112}; }; }; }; 113 114#endif 115