Line data Source code
1 : #ifndef INCLUDED_COM_SUN_STAR_REFLECTION_XINTERFACETYPEDESCRIPTION_HPP
2 : #define INCLUDED_COM_SUN_STAR_REFLECTION_XINTERFACETYPEDESCRIPTION_HPP
3 :
4 : #include "sal/config.h"
5 :
6 : #include "com/sun/star/reflection/XInterfaceTypeDescription.hdl"
7 :
8 : #include "com/sun/star/uno/Uik.hpp"
9 : #include "com/sun/star/uno/RuntimeException.hpp"
10 : #include "com/sun/star/reflection/XInterfaceMemberTypeDescription.hpp"
11 : #include "com/sun/star/reflection/XTypeDescription.hpp"
12 : #include "com/sun/star/uno/Reference.hxx"
13 : #include "com/sun/star/uno/Sequence.hxx"
14 : #include "com/sun/star/uno/Type.hxx"
15 : #include "cppu/unotype.hxx"
16 : #include "osl/mutex.hxx"
17 : #include "rtl/instance.hxx"
18 :
19 : namespace com { namespace sun { namespace star { namespace reflection { namespace detail {
20 :
21 : struct theXInterfaceTypeDescriptionType : public rtl::StaticWithInit< ::com::sun::star::uno::Type *, theXInterfaceTypeDescriptionType >
22 : {
23 102 : ::com::sun::star::uno::Type * operator()() const
24 : {
25 102 : ::rtl::OUString sTypeName( "com.sun.star.reflection.XInterfaceTypeDescription" );
26 :
27 : // Start inline typedescription generation
28 102 : typelib_InterfaceTypeDescription * pTD = 0;
29 :
30 : typelib_TypeDescriptionReference * aSuperTypes[1];
31 102 : aSuperTypes[0] = ::cppu::UnoType< ::com::sun::star::uno::Reference< css::reflection::XTypeDescription > >::get().getTypeLibType();
32 102 : typelib_TypeDescriptionReference * pMembers[3] = { 0,0,0 };
33 102 : ::rtl::OUString sMethodName0( "com.sun.star.reflection.XInterfaceTypeDescription::getBaseType" );
34 : typelib_typedescriptionreference_new( &pMembers[0],
35 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
36 102 : sMethodName0.pData );
37 102 : ::rtl::OUString sMethodName1( "com.sun.star.reflection.XInterfaceTypeDescription::getUik" );
38 : typelib_typedescriptionreference_new( &pMembers[1],
39 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
40 102 : sMethodName1.pData );
41 102 : ::rtl::OUString sMethodName2( "com.sun.star.reflection.XInterfaceTypeDescription::getMembers" );
42 : typelib_typedescriptionreference_new( &pMembers[2],
43 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
44 102 : sMethodName2.pData );
45 :
46 : typelib_typedescription_newMIInterface(
47 : &pTD,
48 : sTypeName.pData, 0x00000000, 0x0000, 0x0000, 0x00000000, 0x00000000,
49 : 1, aSuperTypes,
50 : 3,
51 102 : pMembers );
52 :
53 102 : typelib_typedescription_register( (typelib_TypeDescription**)&pTD );
54 102 : typelib_typedescriptionreference_release( pMembers[0] );
55 102 : typelib_typedescriptionreference_release( pMembers[1] );
56 102 : typelib_typedescriptionreference_release( pMembers[2] );
57 102 : typelib_typedescription_release( (typelib_TypeDescription*)pTD );
58 :
59 102 : return new ::com::sun::star::uno::Type( ::com::sun::star::uno::TypeClass_INTERFACE, sTypeName ); // leaked
60 : }
61 : };
62 :
63 : } } } } }
64 :
65 : namespace com { namespace sun { namespace star { namespace reflection {
66 :
67 9851 : inline ::com::sun::star::uno::Type const & cppu_detail_getUnoType(SAL_UNUSED_PARAMETER css::reflection::XInterfaceTypeDescription const *) {
68 9851 : const ::com::sun::star::uno::Type &rRet = *detail::theXInterfaceTypeDescriptionType::get();
69 : // End inline typedescription generation
70 : static bool bInitStarted = false;
71 9851 : if (!bInitStarted)
72 : {
73 102 : ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
74 102 : if (!bInitStarted)
75 : {
76 : OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
77 102 : bInitStarted = true;
78 102 : ::cppu::UnoType< css::uno::RuntimeException >::get();
79 102 : ::cppu::UnoType< ::com::sun::star::uno::Reference< css::reflection::XTypeDescription > >::get();
80 102 : ::cppu::UnoType< css::uno::Uik >::get();
81 102 : ::cppu::UnoType< ::cppu::UnoSequenceType< ::com::sun::star::uno::Reference< css::reflection::XInterfaceMemberTypeDescription > > >::get();
82 :
83 102 : typelib_InterfaceMethodTypeDescription * pMethod = 0;
84 : {
85 102 : ::rtl::OUString the_ExceptionName0( "com.sun.star.uno.RuntimeException" );
86 102 : rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData };
87 102 : ::rtl::OUString sReturnType0( "com.sun.star.reflection.XTypeDescription" );
88 102 : ::rtl::OUString sMethodName0( "com.sun.star.reflection.XInterfaceTypeDescription::getBaseType" );
89 : typelib_typedescription_newInterfaceMethod( &pMethod,
90 : 5, sal_False,
91 : sMethodName0.pData,
92 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE, sReturnType0.pData,
93 : 0, 0,
94 102 : 1, the_Exceptions );
95 102 : typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
96 : }
97 : {
98 102 : ::rtl::OUString the_ExceptionName0( "com.sun.star.uno.RuntimeException" );
99 102 : rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData };
100 102 : ::rtl::OUString sReturnType1( "com.sun.star.uno.Uik" );
101 102 : ::rtl::OUString sMethodName1( "com.sun.star.reflection.XInterfaceTypeDescription::getUik" );
102 : typelib_typedescription_newInterfaceMethod( &pMethod,
103 : 6, sal_False,
104 : sMethodName1.pData,
105 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_STRUCT, sReturnType1.pData,
106 : 0, 0,
107 102 : 1, the_Exceptions );
108 102 : typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
109 : }
110 : {
111 102 : ::rtl::OUString the_ExceptionName0( "com.sun.star.uno.RuntimeException" );
112 102 : rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData };
113 102 : ::rtl::OUString sReturnType2( "[]com.sun.star.reflection.XInterfaceMemberTypeDescription" );
114 102 : ::rtl::OUString sMethodName2( "com.sun.star.reflection.XInterfaceTypeDescription::getMembers" );
115 : typelib_typedescription_newInterfaceMethod( &pMethod,
116 : 7, sal_False,
117 : sMethodName2.pData,
118 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_SEQUENCE, sReturnType2.pData,
119 : 0, 0,
120 102 : 1, the_Exceptions );
121 102 : typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
122 : }
123 102 : typelib_typedescription_release( (typelib_TypeDescription*)pMethod );
124 102 : }
125 : }
126 : else
127 : {
128 : OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
129 : }
130 9851 : return rRet;
131 : }
132 :
133 : } } } }
134 :
135 9749 : inline ::com::sun::star::uno::Type const & SAL_CALL getCppuType(SAL_UNUSED_PARAMETER ::com::sun::star::uno::Reference< css::reflection::XInterfaceTypeDescription > const *) SAL_THROW(()) {
136 9749 : return ::cppu::UnoType< ::com::sun::star::uno::Reference< css::reflection::XInterfaceTypeDescription > >::get();
137 : }
138 :
139 9749 : ::com::sun::star::uno::Type const & css::reflection::XInterfaceTypeDescription::static_type(SAL_UNUSED_PARAMETER void *) {
140 9749 : return ::getCppuType(static_cast< ::com::sun::star::uno::Reference< css::reflection::XInterfaceTypeDescription > * >(0));
141 : }
142 :
143 : #endif // INCLUDED_COM_SUN_STAR_REFLECTION_XINTERFACETYPEDESCRIPTION_HPP
|