merge the formfield patch from ooo-build
[ooovba.git] / configmgr / source / inc / apitypes.hxx
bloba6518d86f8d9e47ba35c3d0670b49b1f809379bd
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: apitypes.hxx,v $
10 * $Revision: 1.9 $
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 CONFIGMGR_API_APITYPES_HXX_
32 #define CONFIGMGR_API_APITYPES_HXX_
34 #include <com/sun/star/uno/Type.hxx>
35 #include <com/sun/star/uno/Reference.hxx>
36 #include <com/sun/star/uno/Any.hxx>
37 #include <com/sun/star/uno/Sequence.hxx>
38 #include <com/sun/star/uno/XInterface.hpp>
39 #include <rtl/ustring.hxx>
41 #ifndef INCLUDED_VECTOR
42 #include <vector>
43 #define INCLUDED_VECTOR
44 #endif // INCLUDED_VECTOR
46 namespace configmgr
48 namespace configapi
50 namespace uno = ::com::sun::star::uno;
52 inline
53 uno::Type getAnyType( )
55 return ::getCppuType( static_cast< uno::Any const * >(0) );
58 inline
59 uno::Type getUnoInterfaceType( )
61 return ::getCppuType( static_cast< uno::Reference< uno::XInterface > const * >(0) );
64 template <typename Interface>
65 inline
66 uno::Type getReferenceType( Interface const* )
68 return ::getCppuType( static_cast< uno::Reference<Interface> const * >(0) );
71 template <typename Type>
72 inline
73 uno::Type getSequenceType( Type const* )
75 return ::getCppuType( static_cast< uno::Sequence<Type> const * >(0) );
78 template <typename T>
79 inline
80 uno::Sequence<T> makeSequence(::std::vector<T> const& aVector)
82 if (aVector.empty())
83 return uno::Sequence<T>();
84 return uno::Sequence<T>(&aVector[0],aVector.size());
90 #endif // CONFIGMGR_API_APITYPES_HXX_