xref: /aoo41x/main/svx/inc/svx/unoapi.hxx (revision 3334a7e6)
1*3334a7e6SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*3334a7e6SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*3334a7e6SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*3334a7e6SAndrew Rist  * distributed with this work for additional information
6*3334a7e6SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*3334a7e6SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*3334a7e6SAndrew Rist  * "License"); you may not use this file except in compliance
9*3334a7e6SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*3334a7e6SAndrew Rist  *
11*3334a7e6SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*3334a7e6SAndrew Rist  *
13*3334a7e6SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*3334a7e6SAndrew Rist  * software distributed under the License is distributed on an
15*3334a7e6SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*3334a7e6SAndrew Rist  * KIND, either express or implied.  See the License for the
17*3334a7e6SAndrew Rist  * specific language governing permissions and limitations
18*3334a7e6SAndrew Rist  * under the License.
19*3334a7e6SAndrew Rist  *
20*3334a7e6SAndrew Rist  *************************************************************/
21*3334a7e6SAndrew Rist 
22*3334a7e6SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _SVX_UNOAPI_HXX_
25cdf0e10cSrcweir #define _SVX_UNOAPI_HXX_
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <com/sun/star/uno/Any.hxx>
28cdf0e10cSrcweir #include <com/sun/star/drawing/XShape.hpp>
29cdf0e10cSrcweir #include <com/sun/star/drawing/XDrawPage.hpp>
30cdf0e10cSrcweir #include <sal/types.h>
31cdf0e10cSrcweir #include <svtools/grfmgr.hxx>
32cdf0e10cSrcweir #include <svl/poolitem.hxx>
33cdf0e10cSrcweir #include "svx/svxdllapi.h"
34cdf0e10cSrcweir 
35cdf0e10cSrcweir class SvxShape;
36cdf0e10cSrcweir class SdrObject;
37cdf0e10cSrcweir class SdrPage;
38cdf0e10cSrcweir class SvxNumBulletItem;
39cdf0e10cSrcweir class SfxItemPool;
40cdf0e10cSrcweir class String;
41cdf0e10cSrcweir 
42cdf0e10cSrcweir /** creates a StarOffice API wrapper with the given type and inventor
43cdf0e10cSrcweir 	Deprecated: This will be replaced with a function returning XShape.
44cdf0e10cSrcweir */
45cdf0e10cSrcweir SVX_DLLPUBLIC SvxShape* CreateSvxShapeByTypeAndInventor( sal_uInt16 nType, sal_uInt32 nInventor ) throw();
46cdf0e10cSrcweir 
47cdf0e10cSrcweir /** returns a StarOffice API wrapper for the given SdrObject */
48cdf0e10cSrcweir SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > GetXShapeForSdrObject( SdrObject* pObj ) throw ();
49cdf0e10cSrcweir 
50cdf0e10cSrcweir /** returns the SdrObject from the given StarOffice API wrapper */
51cdf0e10cSrcweir SVX_DLLPUBLIC SdrObject* GetSdrObjectFromXShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape ) throw() ;
52cdf0e10cSrcweir 
53cdf0e10cSrcweir /** returns a StarOffice API wrapper for the given SdrPage */
54cdf0e10cSrcweir SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > GetXDrawPageForSdrPage( SdrPage* pPage ) throw ();
55cdf0e10cSrcweir 
56cdf0e10cSrcweir /** returns the SdrPage from the given StarOffice API wrapper */
57cdf0e10cSrcweir SVX_DLLPUBLIC SdrPage* GetSdrPageFromXDrawPage( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > xDrawPage ) throw() ;
58cdf0e10cSrcweir 
59cdf0e10cSrcweir /** returns the SvxNumBulletItem with the given name from the pool or a null if there is no item
60cdf0e10cSrcweir     with that name
61cdf0e10cSrcweir */
62cdf0e10cSrcweir SvxNumBulletItem* SvxGetNumBulletItemByName( SfxItemPool* pPool, const ::rtl::OUString& aName ) throw();
63cdf0e10cSrcweir 
64cdf0e10cSrcweir /** maps the API constant MeasureUnit to a vcl MapUnit enum.
65cdf0e10cSrcweir 	Returns false if conversion is not supported.
66cdf0e10cSrcweir 
67cdf0e10cSrcweir 	@cl: for warnings01 I found out that this method never worked so I thin
68cdf0e10cSrcweir 		 it is not used at all
69cdf0e10cSrcweir sal_Bool SvxMeasureUnitToMapUnit( const short eApi, short& nVcl ) throw();
70cdf0e10cSrcweir */
71cdf0e10cSrcweir 
72cdf0e10cSrcweir /** maps the vcl MapUnit enum to a API constant MeasureUnit.
73cdf0e10cSrcweir 	Returns false if conversion is not supported.
74cdf0e10cSrcweir */
75cdf0e10cSrcweir SVX_DLLPUBLIC sal_Bool SvxMapUnitToMeasureUnit( const short nVcl, short& eApi ) throw();
76cdf0e10cSrcweir 
77cdf0e10cSrcweir /** maps the API constant MeasureUnit to a vcl MapUnit enum.
78cdf0e10cSrcweir 	Returns false if conversion is not supported.
79cdf0e10cSrcweir */
80cdf0e10cSrcweir SVX_DLLPUBLIC sal_Bool SvxMeasureUnitToFieldUnit( const short eApi, short& nVcl ) throw();
81cdf0e10cSrcweir 
82cdf0e10cSrcweir /** maps the vcl MapUnit enum to a API constant MeasureUnit.
83cdf0e10cSrcweir 	Returns false if conversion is not supported.
84cdf0e10cSrcweir */
85cdf0e10cSrcweir SVX_DLLPUBLIC sal_Bool SvxFieldUnitToMeasureUnit( const short nVcl, short& eApi ) throw();
86cdf0e10cSrcweir 
87cdf0e10cSrcweir /** if the given name is a predefined name for the current language it is replaced by
88cdf0e10cSrcweir 	the corresponding api name.
89cdf0e10cSrcweir */
90cdf0e10cSrcweir SVX_DLLPUBLIC void SvxUnogetApiNameForItem( const sal_Int16 nWhich, const String& rInternalName, rtl::OUString& rApiName ) throw();
91cdf0e10cSrcweir 
92cdf0e10cSrcweir /** if the given name is a predefined api name it is replaced by the predefined name
93cdf0e10cSrcweir 	for the current	language.
94cdf0e10cSrcweir */
95cdf0e10cSrcweir SVX_DLLPUBLIC void SvxUnogetInternalNameForItem( const sal_Int16 nWhich, const rtl::OUString& rApiName, String& rInternalName ) throw();
96cdf0e10cSrcweir 
97cdf0e10cSrcweir #endif // _SVX_UNOAPI_HXX_
98cdf0e10cSrcweir 
99