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