Line data Source code
1 : #ifndef INCLUDED_COM_SUN_STAR_REFLECTION_XIDLMETHOD_HPP
2 : #define INCLUDED_COM_SUN_STAR_REFLECTION_XIDLMETHOD_HPP
3 :
4 : #include "sal/config.h"
5 :
6 : #include "com/sun/star/reflection/XIdlMethod.hdl"
7 :
8 : #include "com/sun/star/uno/RuntimeException.hpp"
9 : #include "com/sun/star/reflection/InvocationTargetException.hpp"
10 : #include "com/sun/star/reflection/ParamInfo.hpp"
11 : #include "com/sun/star/reflection/MethodMode.hpp"
12 : #include "com/sun/star/reflection/XIdlClass.hpp"
13 : #include "com/sun/star/lang/IllegalArgumentException.hpp"
14 : #include "com/sun/star/reflection/XIdlMember.hpp"
15 : #include "com/sun/star/uno/Any.hxx"
16 : #include "com/sun/star/uno/Reference.hxx"
17 : #include "com/sun/star/uno/Sequence.hxx"
18 : #include "com/sun/star/uno/Type.hxx"
19 : #include "cppu/unotype.hxx"
20 : #include "osl/mutex.hxx"
21 : #include "rtl/instance.hxx"
22 :
23 : namespace com { namespace sun { namespace star { namespace reflection { namespace detail {
24 :
25 : struct theXIdlMethodType : public rtl::StaticWithInit< ::com::sun::star::uno::Type *, theXIdlMethodType >
26 : {
27 12 : ::com::sun::star::uno::Type * operator()() const
28 : {
29 12 : ::rtl::OUString sTypeName( "com.sun.star.reflection.XIdlMethod" );
30 :
31 : // Start inline typedescription generation
32 12 : typelib_InterfaceTypeDescription * pTD = 0;
33 :
34 : typelib_TypeDescriptionReference * aSuperTypes[1];
35 12 : aSuperTypes[0] = ::cppu::UnoType< ::com::sun::star::uno::Reference< css::reflection::XIdlMember > >::get().getTypeLibType();
36 12 : typelib_TypeDescriptionReference * pMembers[6] = { 0,0,0,0,0,0 };
37 12 : ::rtl::OUString sMethodName0( "com.sun.star.reflection.XIdlMethod::getReturnType" );
38 : typelib_typedescriptionreference_new( &pMembers[0],
39 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
40 12 : sMethodName0.pData );
41 12 : ::rtl::OUString sMethodName1( "com.sun.star.reflection.XIdlMethod::getParameterTypes" );
42 : typelib_typedescriptionreference_new( &pMembers[1],
43 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
44 12 : sMethodName1.pData );
45 12 : ::rtl::OUString sMethodName2( "com.sun.star.reflection.XIdlMethod::getParameterInfos" );
46 : typelib_typedescriptionreference_new( &pMembers[2],
47 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
48 12 : sMethodName2.pData );
49 12 : ::rtl::OUString sMethodName3( "com.sun.star.reflection.XIdlMethod::getExceptionTypes" );
50 : typelib_typedescriptionreference_new( &pMembers[3],
51 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
52 12 : sMethodName3.pData );
53 12 : ::rtl::OUString sMethodName4( "com.sun.star.reflection.XIdlMethod::getMode" );
54 : typelib_typedescriptionreference_new( &pMembers[4],
55 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
56 12 : sMethodName4.pData );
57 12 : ::rtl::OUString sMethodName5( "com.sun.star.reflection.XIdlMethod::invoke" );
58 : typelib_typedescriptionreference_new( &pMembers[5],
59 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
60 12 : sMethodName5.pData );
61 :
62 : typelib_typedescription_newMIInterface(
63 : &pTD,
64 : sTypeName.pData, 0x00000000, 0x0000, 0x0000, 0x00000000, 0x00000000,
65 : 1, aSuperTypes,
66 : 6,
67 12 : pMembers );
68 :
69 12 : typelib_typedescription_register( (typelib_TypeDescription**)&pTD );
70 12 : typelib_typedescriptionreference_release( pMembers[0] );
71 12 : typelib_typedescriptionreference_release( pMembers[1] );
72 12 : typelib_typedescriptionreference_release( pMembers[2] );
73 12 : typelib_typedescriptionreference_release( pMembers[3] );
74 12 : typelib_typedescriptionreference_release( pMembers[4] );
75 12 : typelib_typedescriptionreference_release( pMembers[5] );
76 12 : typelib_typedescription_release( (typelib_TypeDescription*)pTD );
77 :
78 12 : return new ::com::sun::star::uno::Type( ::com::sun::star::uno::TypeClass_INTERFACE, sTypeName ); // leaked
79 : }
80 : };
81 :
82 : } } } } }
83 :
84 : namespace com { namespace sun { namespace star { namespace reflection {
85 :
86 24 : inline ::com::sun::star::uno::Type const & cppu_detail_getUnoType(SAL_UNUSED_PARAMETER css::reflection::XIdlMethod const *) {
87 24 : const ::com::sun::star::uno::Type &rRet = *detail::theXIdlMethodType::get();
88 : // End inline typedescription generation
89 : static bool bInitStarted = false;
90 24 : if (!bInitStarted)
91 : {
92 12 : ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
93 12 : if (!bInitStarted)
94 : {
95 : OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
96 12 : bInitStarted = true;
97 12 : ::cppu::UnoType< css::uno::RuntimeException >::get();
98 12 : ::cppu::UnoType< ::com::sun::star::uno::Reference< css::reflection::XIdlClass > >::get();
99 12 : ::cppu::UnoType< ::cppu::UnoSequenceType< ::com::sun::star::uno::Reference< css::reflection::XIdlClass > > >::get();
100 12 : ::cppu::UnoType< ::cppu::UnoSequenceType< css::reflection::ParamInfo > >::get();
101 12 : ::cppu::UnoType< css::reflection::MethodMode >::get();
102 12 : ::cppu::UnoType< ::cppu::UnoSequenceType< ::com::sun::star::uno::Any > >::get();
103 12 : ::cppu::UnoType< css::lang::IllegalArgumentException >::get();
104 12 : ::cppu::UnoType< css::reflection::InvocationTargetException >::get();
105 :
106 12 : typelib_InterfaceMethodTypeDescription * pMethod = 0;
107 : {
108 12 : ::rtl::OUString the_ExceptionName0( "com.sun.star.uno.RuntimeException" );
109 12 : rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData };
110 12 : ::rtl::OUString sReturnType0( "com.sun.star.reflection.XIdlClass" );
111 12 : ::rtl::OUString sMethodName0( "com.sun.star.reflection.XIdlMethod::getReturnType" );
112 : typelib_typedescription_newInterfaceMethod( &pMethod,
113 : 5, sal_False,
114 : sMethodName0.pData,
115 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE, sReturnType0.pData,
116 : 0, 0,
117 12 : 1, the_Exceptions );
118 12 : typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
119 : }
120 : {
121 12 : ::rtl::OUString the_ExceptionName0( "com.sun.star.uno.RuntimeException" );
122 12 : rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData };
123 12 : ::rtl::OUString sReturnType1( "[]com.sun.star.reflection.XIdlClass" );
124 12 : ::rtl::OUString sMethodName1( "com.sun.star.reflection.XIdlMethod::getParameterTypes" );
125 : typelib_typedescription_newInterfaceMethod( &pMethod,
126 : 6, sal_False,
127 : sMethodName1.pData,
128 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_SEQUENCE, sReturnType1.pData,
129 : 0, 0,
130 12 : 1, the_Exceptions );
131 12 : typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
132 : }
133 : {
134 12 : ::rtl::OUString the_ExceptionName0( "com.sun.star.uno.RuntimeException" );
135 12 : rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData };
136 12 : ::rtl::OUString sReturnType2( "[]com.sun.star.reflection.ParamInfo" );
137 12 : ::rtl::OUString sMethodName2( "com.sun.star.reflection.XIdlMethod::getParameterInfos" );
138 : typelib_typedescription_newInterfaceMethod( &pMethod,
139 : 7, sal_False,
140 : sMethodName2.pData,
141 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_SEQUENCE, sReturnType2.pData,
142 : 0, 0,
143 12 : 1, the_Exceptions );
144 12 : typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
145 : }
146 : {
147 12 : ::rtl::OUString the_ExceptionName0( "com.sun.star.uno.RuntimeException" );
148 12 : rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData };
149 12 : ::rtl::OUString sReturnType3( "[]com.sun.star.reflection.XIdlClass" );
150 12 : ::rtl::OUString sMethodName3( "com.sun.star.reflection.XIdlMethod::getExceptionTypes" );
151 : typelib_typedescription_newInterfaceMethod( &pMethod,
152 : 8, sal_False,
153 : sMethodName3.pData,
154 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_SEQUENCE, sReturnType3.pData,
155 : 0, 0,
156 12 : 1, the_Exceptions );
157 12 : typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
158 : }
159 : {
160 12 : ::rtl::OUString the_ExceptionName0( "com.sun.star.uno.RuntimeException" );
161 12 : rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData };
162 12 : ::rtl::OUString sReturnType4( "com.sun.star.reflection.MethodMode" );
163 12 : ::rtl::OUString sMethodName4( "com.sun.star.reflection.XIdlMethod::getMode" );
164 : typelib_typedescription_newInterfaceMethod( &pMethod,
165 : 9, sal_False,
166 : sMethodName4.pData,
167 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_ENUM, sReturnType4.pData,
168 : 0, 0,
169 12 : 1, the_Exceptions );
170 12 : typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
171 : }
172 : {
173 : typelib_Parameter_Init aParameters[2];
174 12 : ::rtl::OUString sParamName0( "obj" );
175 12 : ::rtl::OUString sParamType0( "any" );
176 12 : aParameters[0].pParamName = sParamName0.pData;
177 12 : aParameters[0].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_ANY;
178 12 : aParameters[0].pTypeName = sParamType0.pData;
179 12 : aParameters[0].bIn = sal_True;
180 12 : aParameters[0].bOut = sal_False;
181 12 : ::rtl::OUString sParamName1( "args" );
182 12 : ::rtl::OUString sParamType1( "[]any" );
183 12 : aParameters[1].pParamName = sParamName1.pData;
184 12 : aParameters[1].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_SEQUENCE;
185 12 : aParameters[1].pTypeName = sParamType1.pData;
186 12 : aParameters[1].bIn = sal_True;
187 12 : aParameters[1].bOut = sal_True;
188 12 : ::rtl::OUString the_ExceptionName0( "com.sun.star.lang.IllegalArgumentException" );
189 12 : ::rtl::OUString the_ExceptionName1( "com.sun.star.reflection.InvocationTargetException" );
190 12 : ::rtl::OUString the_ExceptionName2( "com.sun.star.uno.RuntimeException" );
191 12 : rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData, the_ExceptionName1.pData, the_ExceptionName2.pData };
192 12 : ::rtl::OUString sReturnType5( "any" );
193 12 : ::rtl::OUString sMethodName5( "com.sun.star.reflection.XIdlMethod::invoke" );
194 : typelib_typedescription_newInterfaceMethod( &pMethod,
195 : 10, sal_False,
196 : sMethodName5.pData,
197 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_ANY, sReturnType5.pData,
198 : 2, aParameters,
199 12 : 3, the_Exceptions );
200 12 : typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
201 : }
202 12 : typelib_typedescription_release( (typelib_TypeDescription*)pMethod );
203 12 : }
204 : }
205 : else
206 : {
207 : OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
208 : }
209 24 : return rRet;
210 : }
211 :
212 : } } } }
213 :
214 : inline ::com::sun::star::uno::Type const & SAL_CALL getCppuType(SAL_UNUSED_PARAMETER ::com::sun::star::uno::Reference< css::reflection::XIdlMethod > const *) SAL_THROW(()) {
215 : return ::cppu::UnoType< ::com::sun::star::uno::Reference< css::reflection::XIdlMethod > >::get();
216 : }
217 :
218 : ::com::sun::star::uno::Type const & css::reflection::XIdlMethod::static_type(SAL_UNUSED_PARAMETER void *) {
219 : return ::getCppuType(static_cast< ::com::sun::star::uno::Reference< css::reflection::XIdlMethod > * >(0));
220 : }
221 :
222 : #endif // INCLUDED_COM_SUN_STAR_REFLECTION_XIDLMETHOD_HPP
|