Line data Source code
1 : #ifndef INCLUDED_COM_SUN_STAR_UTIL_XNUMBERFORMATTER2_HPP
2 : #define INCLUDED_COM_SUN_STAR_UTIL_XNUMBERFORMATTER2_HPP
3 :
4 : #include "sal/config.h"
5 :
6 : #include "com/sun/star/util/XNumberFormatter2.hdl"
7 :
8 : #include "com/sun/star/uno/RuntimeException.hpp"
9 : #include "com/sun/star/util/XNumberFormatPreviewer.hpp"
10 : #include "com/sun/star/util/XNumberFormatter.hpp"
11 : #include "com/sun/star/uno/Reference.hxx"
12 : #include "com/sun/star/uno/Type.hxx"
13 : #include "cppu/unotype.hxx"
14 : #include "osl/mutex.hxx"
15 : #include "rtl/instance.hxx"
16 :
17 : namespace com { namespace sun { namespace star { namespace util { namespace detail {
18 :
19 : struct theXNumberFormatter2Type : public rtl::StaticWithInit< ::com::sun::star::uno::Type *, theXNumberFormatter2Type >
20 : {
21 3 : ::com::sun::star::uno::Type * operator()() const
22 : {
23 3 : ::rtl::OUString sTypeName( "com.sun.star.util.XNumberFormatter2" );
24 :
25 : // Start inline typedescription generation
26 3 : typelib_InterfaceTypeDescription * pTD = 0;
27 :
28 : typelib_TypeDescriptionReference * aSuperTypes[2];
29 3 : aSuperTypes[0] = ::cppu::UnoType< ::com::sun::star::uno::Reference< css::util::XNumberFormatter > >::get().getTypeLibType();
30 3 : aSuperTypes[1] = ::cppu::UnoType< ::com::sun::star::uno::Reference< css::util::XNumberFormatPreviewer > >::get().getTypeLibType();
31 :
32 : typelib_typedescription_newMIInterface(
33 : &pTD,
34 : sTypeName.pData, 0x00000000, 0x0000, 0x0000, 0x00000000, 0x00000000,
35 : 2, aSuperTypes,
36 : 0,
37 3 : 0 );
38 :
39 3 : typelib_typedescription_register( (typelib_TypeDescription**)&pTD );
40 3 : typelib_typedescription_release( (typelib_TypeDescription*)pTD );
41 :
42 3 : return new ::com::sun::star::uno::Type( ::com::sun::star::uno::TypeClass_INTERFACE, sTypeName ); // leaked
43 : }
44 : };
45 :
46 : } } } } }
47 :
48 : namespace com { namespace sun { namespace star { namespace util {
49 :
50 3 : inline ::com::sun::star::uno::Type const & cppu_detail_getUnoType(SAL_UNUSED_PARAMETER css::util::XNumberFormatter2 const *) {
51 3 : const ::com::sun::star::uno::Type &rRet = *detail::theXNumberFormatter2Type::get();
52 : // End inline typedescription generation
53 : static bool bInitStarted = false;
54 3 : if (!bInitStarted)
55 : {
56 3 : ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
57 3 : if (!bInitStarted)
58 : {
59 : OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
60 3 : bInitStarted = true;
61 3 : ::cppu::UnoType< css::uno::RuntimeException >::get();
62 3 : }
63 : }
64 : else
65 : {
66 : OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
67 : }
68 3 : return rRet;
69 : }
70 :
71 : } } } }
72 :
73 3 : inline ::com::sun::star::uno::Type const & SAL_CALL getCppuType(SAL_UNUSED_PARAMETER ::com::sun::star::uno::Reference< css::util::XNumberFormatter2 > const *) SAL_THROW(()) {
74 3 : return ::cppu::UnoType< ::com::sun::star::uno::Reference< css::util::XNumberFormatter2 > >::get();
75 : }
76 :
77 3 : ::com::sun::star::uno::Type const & css::util::XNumberFormatter2::static_type(SAL_UNUSED_PARAMETER void *) {
78 3 : return ::getCppuType(static_cast< ::com::sun::star::uno::Reference< css::util::XNumberFormatter2 > * >(0));
79 : }
80 :
81 : #endif // INCLUDED_COM_SUN_STAR_UTIL_XNUMBERFORMATTER2_HPP
|