Line data Source code
1 : #ifndef INCLUDED_COM_SUN_STAR_LOADER_XIMPLEMENTATIONLOADER_HPP
2 : #define INCLUDED_COM_SUN_STAR_LOADER_XIMPLEMENTATIONLOADER_HPP
3 :
4 : #include "sal/config.h"
5 :
6 : #include "com/sun/star/loader/XImplementationLoader.hdl"
7 :
8 : #include "com/sun/star/uno/RuntimeException.hpp"
9 : #include "com/sun/star/registry/CannotRegisterImplementationException.hpp"
10 : #include "com/sun/star/loader/CannotActivateFactoryException.hpp"
11 : #include "com/sun/star/registry/XRegistryKey.hpp"
12 : #include "com/sun/star/uno/XInterface.hpp"
13 : #include "com/sun/star/uno/Reference.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 loader { namespace detail {
22 :
23 : struct theXImplementationLoaderType : public rtl::StaticWithInit< ::com::sun::star::uno::Type *, theXImplementationLoaderType >
24 : {
25 0 : ::com::sun::star::uno::Type * operator()() const
26 : {
27 0 : ::rtl::OUString sTypeName( "com.sun.star.loader.XImplementationLoader" );
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< css::uno::XInterface > >::get().getTypeLibType();
34 0 : typelib_TypeDescriptionReference * pMembers[2] = { 0,0 };
35 0 : ::rtl::OUString sMethodName0( "com.sun.star.loader.XImplementationLoader::activate" );
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( "com.sun.star.loader.XImplementationLoader::writeRegistryInfo" );
40 : typelib_typedescriptionreference_new( &pMembers[1],
41 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
42 0 : sMethodName1.pData );
43 :
44 : typelib_typedescription_newMIInterface(
45 : &pTD,
46 : sTypeName.pData, 0x00000000, 0x0000, 0x0000, 0x00000000, 0x00000000,
47 : 1, aSuperTypes,
48 : 2,
49 0 : pMembers );
50 :
51 0 : typelib_typedescription_register( (typelib_TypeDescription**)&pTD );
52 0 : typelib_typedescriptionreference_release( pMembers[0] );
53 0 : typelib_typedescriptionreference_release( pMembers[1] );
54 0 : typelib_typedescription_release( (typelib_TypeDescription*)pTD );
55 :
56 0 : return new ::com::sun::star::uno::Type( ::com::sun::star::uno::TypeClass_INTERFACE, sTypeName ); // leaked
57 : }
58 : };
59 :
60 : } } } } }
61 :
62 : namespace com { namespace sun { namespace star { namespace loader {
63 :
64 0 : inline ::com::sun::star::uno::Type const & cppu_detail_getUnoType(SAL_UNUSED_PARAMETER css::loader::XImplementationLoader const *) {
65 0 : const ::com::sun::star::uno::Type &rRet = *detail::theXImplementationLoaderType::get();
66 : // End inline typedescription generation
67 : static bool bInitStarted = false;
68 0 : if (!bInitStarted)
69 : {
70 0 : ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
71 0 : if (!bInitStarted)
72 : {
73 : OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
74 0 : bInitStarted = true;
75 0 : ::cppu::UnoType< css::uno::RuntimeException >::get();
76 0 : ::cppu::UnoType< ::com::sun::star::uno::Reference< css::uno::XInterface > >::get();
77 0 : ::cppu::UnoType< ::com::sun::star::uno::Reference< css::registry::XRegistryKey > >::get();
78 0 : ::cppu::UnoType< css::loader::CannotActivateFactoryException >::get();
79 0 : ::cppu::UnoType< css::registry::CannotRegisterImplementationException >::get();
80 :
81 0 : typelib_InterfaceMethodTypeDescription * pMethod = 0;
82 : {
83 : typelib_Parameter_Init aParameters[4];
84 0 : ::rtl::OUString sParamName0( "implementationName" );
85 0 : ::rtl::OUString sParamType0( "string" );
86 0 : aParameters[0].pParamName = sParamName0.pData;
87 0 : aParameters[0].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_STRING;
88 0 : aParameters[0].pTypeName = sParamType0.pData;
89 0 : aParameters[0].bIn = sal_True;
90 0 : aParameters[0].bOut = sal_False;
91 0 : ::rtl::OUString sParamName1( "implementationLoaderUrl" );
92 0 : ::rtl::OUString sParamType1( "string" );
93 0 : aParameters[1].pParamName = sParamName1.pData;
94 0 : aParameters[1].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_STRING;
95 0 : aParameters[1].pTypeName = sParamType1.pData;
96 0 : aParameters[1].bIn = sal_True;
97 0 : aParameters[1].bOut = sal_False;
98 0 : ::rtl::OUString sParamName2( "locationUrl" );
99 0 : ::rtl::OUString sParamType2( "string" );
100 0 : aParameters[2].pParamName = sParamName2.pData;
101 0 : aParameters[2].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_STRING;
102 0 : aParameters[2].pTypeName = sParamType2.pData;
103 0 : aParameters[2].bIn = sal_True;
104 0 : aParameters[2].bOut = sal_False;
105 0 : ::rtl::OUString sParamName3( "xKey" );
106 0 : ::rtl::OUString sParamType3( "com.sun.star.registry.XRegistryKey" );
107 0 : aParameters[3].pParamName = sParamName3.pData;
108 0 : aParameters[3].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE;
109 0 : aParameters[3].pTypeName = sParamType3.pData;
110 0 : aParameters[3].bIn = sal_True;
111 0 : aParameters[3].bOut = sal_False;
112 0 : ::rtl::OUString the_ExceptionName0( "com.sun.star.loader.CannotActivateFactoryException" );
113 0 : ::rtl::OUString the_ExceptionName1( "com.sun.star.uno.RuntimeException" );
114 0 : rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData, the_ExceptionName1.pData };
115 0 : ::rtl::OUString sReturnType0( "com.sun.star.uno.XInterface" );
116 0 : ::rtl::OUString sMethodName0( "com.sun.star.loader.XImplementationLoader::activate" );
117 : typelib_typedescription_newInterfaceMethod( &pMethod,
118 : 3, sal_False,
119 : sMethodName0.pData,
120 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE, sReturnType0.pData,
121 : 4, aParameters,
122 0 : 2, the_Exceptions );
123 0 : typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
124 : }
125 : {
126 : typelib_Parameter_Init aParameters[3];
127 0 : ::rtl::OUString sParamName0( "xKey" );
128 0 : ::rtl::OUString sParamType0( "com.sun.star.registry.XRegistryKey" );
129 0 : aParameters[0].pParamName = sParamName0.pData;
130 0 : aParameters[0].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE;
131 0 : aParameters[0].pTypeName = sParamType0.pData;
132 0 : aParameters[0].bIn = sal_True;
133 0 : aParameters[0].bOut = sal_False;
134 0 : ::rtl::OUString sParamName1( "implementationLoaderUrl" );
135 0 : ::rtl::OUString sParamType1( "string" );
136 0 : aParameters[1].pParamName = sParamName1.pData;
137 0 : aParameters[1].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_STRING;
138 0 : aParameters[1].pTypeName = sParamType1.pData;
139 0 : aParameters[1].bIn = sal_True;
140 0 : aParameters[1].bOut = sal_False;
141 0 : ::rtl::OUString sParamName2( "locationUrl" );
142 0 : ::rtl::OUString sParamType2( "string" );
143 0 : aParameters[2].pParamName = sParamName2.pData;
144 0 : aParameters[2].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_STRING;
145 0 : aParameters[2].pTypeName = sParamType2.pData;
146 0 : aParameters[2].bIn = sal_True;
147 0 : aParameters[2].bOut = sal_False;
148 0 : ::rtl::OUString the_ExceptionName0( "com.sun.star.registry.CannotRegisterImplementationException" );
149 0 : ::rtl::OUString the_ExceptionName1( "com.sun.star.uno.RuntimeException" );
150 0 : rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData, the_ExceptionName1.pData };
151 0 : ::rtl::OUString sReturnType1( "boolean" );
152 0 : ::rtl::OUString sMethodName1( "com.sun.star.loader.XImplementationLoader::writeRegistryInfo" );
153 : typelib_typedescription_newInterfaceMethod( &pMethod,
154 : 4, sal_False,
155 : sMethodName1.pData,
156 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_BOOLEAN, sReturnType1.pData,
157 : 3, aParameters,
158 0 : 2, the_Exceptions );
159 0 : typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
160 : }
161 0 : typelib_typedescription_release( (typelib_TypeDescription*)pMethod );
162 0 : }
163 : }
164 : else
165 : {
166 : OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
167 : }
168 0 : return rRet;
169 : }
170 :
171 : } } } }
172 :
173 0 : inline ::com::sun::star::uno::Type const & SAL_CALL getCppuType(SAL_UNUSED_PARAMETER ::com::sun::star::uno::Reference< css::loader::XImplementationLoader > const *) SAL_THROW(()) {
174 0 : return ::cppu::UnoType< ::com::sun::star::uno::Reference< css::loader::XImplementationLoader > >::get();
175 : }
176 :
177 0 : ::com::sun::star::uno::Type const & css::loader::XImplementationLoader::static_type(SAL_UNUSED_PARAMETER void *) {
178 0 : return ::getCppuType(static_cast< ::com::sun::star::uno::Reference< css::loader::XImplementationLoader > * >(0));
179 : }
180 :
181 : #endif // INCLUDED_COM_SUN_STAR_LOADER_XIMPLEMENTATIONLOADER_HPP
|