Update ooo320-m1
[ooovba.git] / svx / inc / unoapi.hxx
blob6d0720e0e0ff361da03105b7f641b54a90c6c01a
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: unoapi.hxx,v $
10 * $Revision: 1.12 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _SVX_UNOAPI_HXX_
32 #define _SVX_UNOAPI_HXX_
34 #include <com/sun/star/uno/Any.hxx>
35 #include <com/sun/star/drawing/XShape.hpp>
36 #include <com/sun/star/drawing/XDrawPage.hpp>
37 #include <sal/types.h>
38 #include <goodies/grfmgr.hxx>
39 #include <svtools/poolitem.hxx>
40 #include "svx/svxdllapi.h"
42 class SvxShape;
43 class SdrObject;
44 class SdrPage;
45 class SvxNumBulletItem;
46 class SfxItemPool;
47 class String;
49 /** creates a StarOffice API wrapper with the given type and inventor
50 Deprecated: This will be replaced with a function returning XShape.
52 SVX_DLLPUBLIC SvxShape* CreateSvxShapeByTypeAndInventor( sal_uInt16 nType, sal_uInt32 nInventor ) throw();
54 /** returns a StarOffice API wrapper for the given SdrObject */
55 SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > GetXShapeForSdrObject( SdrObject* pObj ) throw ();
57 /** returns the SdrObject from the given StarOffice API wrapper */
58 SVX_DLLPUBLIC SdrObject* GetSdrObjectFromXShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape ) throw() ;
60 /** returns a StarOffice API wrapper for the given SdrPage */
61 SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > GetXDrawPageForSdrPage( SdrPage* pPage ) throw ();
63 /** returns the SdrPage from the given StarOffice API wrapper */
64 SVX_DLLPUBLIC SdrPage* GetSdrPageFromXDrawPage( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > xDrawPage ) throw() ;
66 /** returns a GraphicObject for this URL */
67 SVX_DLLPUBLIC GraphicObject CreateGraphicObjectFromURL( const ::rtl::OUString &rURL ) throw() ;
69 /** returns the SvxNumBulletItem with the given name from the pool or a null if there is no item
70 with that name
72 SvxNumBulletItem* SvxGetNumBulletItemByName( SfxItemPool* pPool, const ::rtl::OUString& aName ) throw();
74 /** maps the API constant MeasureUnit to a vcl MapUnit enum.
75 Returns false if conversion is not supported.
77 @cl: for warnings01 I found out that this method never worked so I thin
78 it is not used at all
79 sal_Bool SvxMeasureUnitToMapUnit( const short eApi, short& nVcl ) throw();
82 /** maps the vcl MapUnit enum to a API constant MeasureUnit.
83 Returns false if conversion is not supported.
85 SVX_DLLPUBLIC sal_Bool SvxMapUnitToMeasureUnit( const short nVcl, short& eApi ) throw();
87 /** maps the API constant MeasureUnit to a vcl MapUnit enum.
88 Returns false if conversion is not supported.
90 SVX_DLLPUBLIC sal_Bool SvxMeasureUnitToFieldUnit( const short eApi, short& nVcl ) throw();
92 /** maps the vcl MapUnit enum to a API constant MeasureUnit.
93 Returns false if conversion is not supported.
95 SVX_DLLPUBLIC sal_Bool SvxFieldUnitToMeasureUnit( const short nVcl, short& eApi ) throw();
97 /** if the given name is a predefined name for the current language it is replaced by
98 the corresponding api name.
100 SVX_DLLPUBLIC void SvxUnogetApiNameForItem( const sal_Int16 nWhich, const String& rInternalName, rtl::OUString& rApiName ) throw();
102 /** if the given name is a predefined api name it is replaced by the predefined name
103 for the current language.
105 SVX_DLLPUBLIC void SvxUnogetInternalNameForItem( const sal_Int16 nWhich, const rtl::OUString& rApiName, String& rInternalName ) throw();
107 /** returns the which id for the given property name. This only works for
108 properties of shapes (map SVXMAP_SHAPE is used for searching)
110 Note: As this function has no access to SvxItemPropertySet but only to
111 SfxItemPropertyMap, the search in the map is not done via bsearch, but by
112 linear search.
114 // os: unused function
115 //SVX_DLLPUBLIC sal_Int16 SvxUnoGetWhichIdForNamedProperty( const ::rtl::OUString & rPropName );
117 /** converts the given any with a metric to 100th/mm if needed */
118 SVX_DLLPUBLIC void SvxUnoConvertToMM( const SfxMapUnit eSourceMapUnit, com::sun::star::uno::Any & rMetric ) throw();
120 /** converts the given any with a metric from 100th/mm to the given metric if needed */
121 SVX_DLLPUBLIC void SvxUnoConvertFromMM( const SfxMapUnit eDestinationMapUnit, com::sun::star::uno::Any & rMetric ) throw();
123 #endif // _SVX_UNOAPI_HXX_