Line data Source code
1 : #ifndef INCLUDED_COM_SUN_STAR_LANG_XTYPEPROVIDER_HPP
2 : #define INCLUDED_COM_SUN_STAR_LANG_XTYPEPROVIDER_HPP
3 :
4 : #include "sal/config.h"
5 :
6 : #include "com/sun/star/lang/XTypeProvider.hdl"
7 :
8 : #include "com/sun/star/uno/XInterface.hpp"
9 : #include "com/sun/star/uno/RuntimeException.hpp"
10 : #include "com/sun/star/uno/Reference.hxx"
11 : #include "com/sun/star/uno/Sequence.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 : #include "sal/types.h"
17 :
18 : namespace com { namespace sun { namespace star { namespace lang { namespace detail {
19 :
20 : struct theXTypeProviderType : public rtl::StaticWithInit< ::com::sun::star::uno::Type *, theXTypeProviderType >
21 : {
22 257 : ::com::sun::star::uno::Type * operator()() const
23 : {
24 257 : ::rtl::OUString sTypeName( "com.sun.star.lang.XTypeProvider" );
25 :
26 : // Start inline typedescription generation
27 257 : typelib_InterfaceTypeDescription * pTD = 0;
28 :
29 : typelib_TypeDescriptionReference * aSuperTypes[1];
30 257 : aSuperTypes[0] = ::cppu::UnoType< ::com::sun::star::uno::Reference< css::uno::XInterface > >::get().getTypeLibType();
31 257 : typelib_TypeDescriptionReference * pMembers[2] = { 0,0 };
32 257 : ::rtl::OUString sMethodName0( "com.sun.star.lang.XTypeProvider::getTypes" );
33 : typelib_typedescriptionreference_new( &pMembers[0],
34 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
35 257 : sMethodName0.pData );
36 257 : ::rtl::OUString sMethodName1( "com.sun.star.lang.XTypeProvider::getImplementationId" );
37 : typelib_typedescriptionreference_new( &pMembers[1],
38 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
39 257 : sMethodName1.pData );
40 :
41 : typelib_typedescription_newMIInterface(
42 : &pTD,
43 : sTypeName.pData, 0x00000000, 0x0000, 0x0000, 0x00000000, 0x00000000,
44 : 1, aSuperTypes,
45 : 2,
46 257 : pMembers );
47 :
48 257 : typelib_typedescription_register( (typelib_TypeDescription**)&pTD );
49 257 : typelib_typedescriptionreference_release( pMembers[0] );
50 257 : typelib_typedescriptionreference_release( pMembers[1] );
51 257 : typelib_typedescription_release( (typelib_TypeDescription*)pTD );
52 :
53 257 : return new ::com::sun::star::uno::Type( ::com::sun::star::uno::TypeClass_INTERFACE, sTypeName ); // leaked
54 : }
55 : };
56 :
57 : } } } } }
58 :
59 : namespace com { namespace sun { namespace star { namespace lang {
60 :
61 1574 : inline ::com::sun::star::uno::Type const & cppu_detail_getUnoType(SAL_UNUSED_PARAMETER css::lang::XTypeProvider const *) {
62 1574 : const ::com::sun::star::uno::Type &rRet = *detail::theXTypeProviderType::get();
63 : // End inline typedescription generation
64 : static bool bInitStarted = false;
65 1574 : if (!bInitStarted)
66 : {
67 257 : ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
68 257 : if (!bInitStarted)
69 : {
70 : OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
71 257 : bInitStarted = true;
72 257 : ::cppu::UnoType< css::uno::RuntimeException >::get();
73 257 : ::cppu::UnoType< ::cppu::UnoSequenceType< ::com::sun::star::uno::Type > >::get();
74 257 : ::cppu::UnoType< ::cppu::UnoSequenceType< ::sal_Int8 > >::get();
75 :
76 257 : typelib_InterfaceMethodTypeDescription * pMethod = 0;
77 : {
78 257 : ::rtl::OUString the_ExceptionName0( "com.sun.star.uno.RuntimeException" );
79 257 : rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData };
80 257 : ::rtl::OUString sReturnType0( "[]type" );
81 257 : ::rtl::OUString sMethodName0( "com.sun.star.lang.XTypeProvider::getTypes" );
82 : typelib_typedescription_newInterfaceMethod( &pMethod,
83 : 3, sal_False,
84 : sMethodName0.pData,
85 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_SEQUENCE, sReturnType0.pData,
86 : 0, 0,
87 257 : 1, the_Exceptions );
88 257 : typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
89 : }
90 : {
91 257 : ::rtl::OUString the_ExceptionName0( "com.sun.star.uno.RuntimeException" );
92 257 : rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData };
93 257 : ::rtl::OUString sReturnType1( "[]byte" );
94 257 : ::rtl::OUString sMethodName1( "com.sun.star.lang.XTypeProvider::getImplementationId" );
95 : typelib_typedescription_newInterfaceMethod( &pMethod,
96 : 4, sal_False,
97 : sMethodName1.pData,
98 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_SEQUENCE, sReturnType1.pData,
99 : 0, 0,
100 257 : 1, the_Exceptions );
101 257 : typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
102 : }
103 257 : typelib_typedescription_release( (typelib_TypeDescription*)pMethod );
104 257 : }
105 : }
106 : else
107 : {
108 : OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
109 : }
110 1574 : return rRet;
111 : }
112 :
113 : } } } }
114 :
115 1574 : inline ::com::sun::star::uno::Type const & SAL_CALL getCppuType(SAL_UNUSED_PARAMETER ::com::sun::star::uno::Reference< css::lang::XTypeProvider > const *) SAL_THROW(()) {
116 1574 : return ::cppu::UnoType< ::com::sun::star::uno::Reference< css::lang::XTypeProvider > >::get();
117 : }
118 :
119 1574 : ::com::sun::star::uno::Type const & css::lang::XTypeProvider::static_type(SAL_UNUSED_PARAMETER void *) {
120 1574 : return ::getCppuType(static_cast< ::com::sun::star::uno::Reference< css::lang::XTypeProvider > * >(0));
121 : }
122 :
123 : #endif // INCLUDED_COM_SUN_STAR_LANG_XTYPEPROVIDER_HPP
|