Branch libreoffice-5-0-4
[LibreOffice.git] / include / svx / unoapi.hxx
blob076f6295f8952f91861bc780680dbb7628ac48f3
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SVX_UNOAPI_HXX
21 #define INCLUDED_SVX_UNOAPI_HXX
23 #include <com/sun/star/uno/Any.hxx>
24 #include <com/sun/star/drawing/XShape.hpp>
25 #include <com/sun/star/drawing/XDrawPage.hpp>
26 #include <sal/types.h>
27 #include <svtools/grfmgr.hxx>
28 #include <svl/poolitem.hxx>
29 #include <svx/svxdllapi.h>
30 #include <tools/fldunit.hxx>
32 class SvxShape;
33 class SdrObject;
34 class SdrPage;
35 class SvxNumBulletItem;
36 class SfxItemPool;
38 /**
39 * Creates a StarOffice API wrapper with the given type and inventor
40 * Deprecated: This will be replaced with a function returning XShape.
42 SVX_DLLPUBLIC SvxShape* CreateSvxShapeByTypeAndInventor(sal_uInt16 nType, sal_uInt32 nInventor, OUString const & referer)
43 throw (css::uno::RuntimeException, std::exception);
45 /** Returns a StarOffice API wrapper for the given SdrObject */
46 SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > GetXShapeForSdrObject( SdrObject* pObj ) throw ();
48 /** Returns the SdrObject from the given StarOffice API wrapper */
49 SVX_DLLPUBLIC SdrObject* GetSdrObjectFromXShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape ) throw() ;
51 /** Returns a StarOffice API wrapper for the given SdrPage */
52 SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > GetXDrawPageForSdrPage( SdrPage* pPage ) throw ();
54 /** Returns the SdrPage from the given StarOffice API wrapper */
55 SVX_DLLPUBLIC SdrPage* GetSdrPageFromXDrawPage( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > xDrawPage ) throw() ;
57 /**
58 * Returns the SvxNumBulletItem with the given name from the pool or a null if there is no item with that name
60 SvxNumBulletItem* SvxGetNumBulletItemByName( SfxItemPool* pPool, const OUString& aName ) throw();
62 /**
63 * Maps the vcl MapUnit enum to a API constant MeasureUnit.
64 * Returns false if conversion is not supported.
66 SVX_DLLPUBLIC bool SvxMapUnitToMeasureUnit( const MapUnit nVcl, short& eApi ) throw();
68 /**
69 * Maps the API constant MeasureUnit to a vcl MapUnit enum.
70 * Returns false if conversion is not supported.
72 SVX_DLLPUBLIC bool SvxMeasureUnitToFieldUnit( const short eApi, FieldUnit& nVcl ) throw();
74 /**
75 * Maps the vcl MapUnit enum to a API constant MeasureUnit.
76 * Returns false if conversion is not supported.
78 SVX_DLLPUBLIC bool SvxFieldUnitToMeasureUnit( const FieldUnit nVcl, short& eApi ) throw();
80 /**
81 * If the given name is a predefined name for the current language it is replaced by
82 * the corresponding API name.
84 SVX_DLLPUBLIC SAL_WARN_UNUSED_RESULT OUString
85 SvxUnogetApiNameForItem(const sal_Int16 nWhich, const OUString& rInternalName) throw();
87 /**
88 * If the given name is a predefined API name it is replaced by the predefined name
89 * for the current language.
91 SVX_DLLPUBLIC SAL_WARN_UNUSED_RESULT OUString
92 SvxUnogetInternalNameForItem(const sal_Int16 nWhich, const OUString& rApiName) throw();
94 #endif // INCLUDED_SVX_UNOAPI_HXX
96 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */