Branch data 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 : 68 : ::com::sun::star::uno::Type * operator()() const
26 : : {
27 [ + - ]: 68 : ::rtl::OUString sTypeName( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.loader.XImplementationLoader") );
28 : :
29 : : // Start inline typedescription generation
30 : 68 : typelib_InterfaceTypeDescription * pTD = 0;
31 : :
32 : : typelib_TypeDescriptionReference * aSuperTypes[1];
33 [ + - ]: 68 : aSuperTypes[0] = ::cppu::UnoType< ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > >::get().getTypeLibType();
34 : 68 : typelib_TypeDescriptionReference * pMembers[2] = { 0,0 };
35 [ + - ]: 68 : ::rtl::OUString sMethodName0( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.loader.XImplementationLoader::activate") );
36 : : typelib_typedescriptionreference_new( &pMembers[0],
37 : : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
38 : 68 : sMethodName0.pData );
39 [ + - ]: 68 : ::rtl::OUString sMethodName1( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.loader.XImplementationLoader::writeRegistryInfo") );
40 : : typelib_typedescriptionreference_new( &pMembers[1],
41 : : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
42 : 68 : sMethodName1.pData );
43 : :
44 : : typelib_typedescription_newMIInterface(
45 : : &pTD,
46 : : sTypeName.pData, 0x00000000, 0x0000, 0x0000, 0x00000000, 0x00000000,
47 : : 1, aSuperTypes,
48 : : 2,
49 : 68 : pMembers );
50 : :
51 : 68 : typelib_typedescription_register( (typelib_TypeDescription**)&pTD );
52 : 68 : typelib_typedescriptionreference_release( pMembers[0] );
53 : 68 : typelib_typedescriptionreference_release( pMembers[1] );
54 : 68 : typelib_typedescription_release( (typelib_TypeDescription*)pTD );
55 : :
56 : 68 : 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 : 72 : inline ::com::sun::star::uno::Type const & cppu_detail_getUnoType(SAL_UNUSED_PARAMETER ::com::sun::star::loader::XImplementationLoader const *) {
65 : 72 : const ::com::sun::star::uno::Type &rRet = *detail::theXImplementationLoaderType::get();
66 : : // End inline typedescription generation
67 : : static bool bInitStarted = false;
68 [ + + ]: 72 : if (!bInitStarted)
69 : : {
70 [ + - ][ + - ]: 68 : ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
71 [ + - ]: 68 : if (!bInitStarted)
72 : : {
73 : : OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
74 : 68 : bInitStarted = true;
75 [ + - ]: 68 : ::cppu::UnoType< ::com::sun::star::uno::RuntimeException >::get();
76 [ + - ]: 68 : ::cppu::UnoType< ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > >::get();
77 [ + - ]: 68 : ::cppu::UnoType< ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > >::get();
78 : 68 : ::cppu::UnoType< ::com::sun::star::loader::CannotActivateFactoryException >::get();
79 : 68 : ::cppu::UnoType< ::com::sun::star::registry::CannotRegisterImplementationException >::get();
80 : :
81 : 68 : typelib_InterfaceMethodTypeDescription * pMethod = 0;
82 : : {
83 : : typelib_Parameter_Init aParameters[4];
84 [ + - ]: 68 : ::rtl::OUString sParamName0( RTL_CONSTASCII_USTRINGPARAM("implementationName") );
85 [ + - ]: 68 : ::rtl::OUString sParamType0( RTL_CONSTASCII_USTRINGPARAM("string") );
86 : 68 : aParameters[0].pParamName = sParamName0.pData;
87 : 68 : aParameters[0].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_STRING;
88 : 68 : aParameters[0].pTypeName = sParamType0.pData;
89 : 68 : aParameters[0].bIn = sal_True;
90 : 68 : aParameters[0].bOut = sal_False;
91 [ + - ]: 68 : ::rtl::OUString sParamName1( RTL_CONSTASCII_USTRINGPARAM("implementationLoaderUrl") );
92 [ + - ]: 68 : ::rtl::OUString sParamType1( RTL_CONSTASCII_USTRINGPARAM("string") );
93 : 68 : aParameters[1].pParamName = sParamName1.pData;
94 : 68 : aParameters[1].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_STRING;
95 : 68 : aParameters[1].pTypeName = sParamType1.pData;
96 : 68 : aParameters[1].bIn = sal_True;
97 : 68 : aParameters[1].bOut = sal_False;
98 [ + - ]: 68 : ::rtl::OUString sParamName2( RTL_CONSTASCII_USTRINGPARAM("locationUrl") );
99 [ + - ]: 68 : ::rtl::OUString sParamType2( RTL_CONSTASCII_USTRINGPARAM("string") );
100 : 68 : aParameters[2].pParamName = sParamName2.pData;
101 : 68 : aParameters[2].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_STRING;
102 : 68 : aParameters[2].pTypeName = sParamType2.pData;
103 : 68 : aParameters[2].bIn = sal_True;
104 : 68 : aParameters[2].bOut = sal_False;
105 [ + - ]: 68 : ::rtl::OUString sParamName3( RTL_CONSTASCII_USTRINGPARAM("xKey") );
106 [ + - ]: 68 : ::rtl::OUString sParamType3( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.registry.XRegistryKey") );
107 : 68 : aParameters[3].pParamName = sParamName3.pData;
108 : 68 : aParameters[3].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE;
109 : 68 : aParameters[3].pTypeName = sParamType3.pData;
110 : 68 : aParameters[3].bIn = sal_True;
111 : 68 : aParameters[3].bOut = sal_False;
112 [ + - ]: 68 : ::rtl::OUString the_ExceptionName0(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.loader.CannotActivateFactoryException"));
113 [ + - ]: 68 : ::rtl::OUString the_ExceptionName1(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.RuntimeException"));
114 : 68 : rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData, the_ExceptionName1.pData };
115 [ + - ]: 68 : ::rtl::OUString sReturnType0( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.XInterface") );
116 [ + - ]: 68 : ::rtl::OUString sMethodName0( RTL_CONSTASCII_USTRINGPARAM("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 : 68 : 2, the_Exceptions );
123 : 68 : typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
124 : : }
125 : : {
126 : : typelib_Parameter_Init aParameters[3];
127 [ + - ]: 68 : ::rtl::OUString sParamName0( RTL_CONSTASCII_USTRINGPARAM("xKey") );
128 [ + - ]: 68 : ::rtl::OUString sParamType0( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.registry.XRegistryKey") );
129 : 68 : aParameters[0].pParamName = sParamName0.pData;
130 : 68 : aParameters[0].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE;
131 : 68 : aParameters[0].pTypeName = sParamType0.pData;
132 : 68 : aParameters[0].bIn = sal_True;
133 : 68 : aParameters[0].bOut = sal_False;
134 [ + - ]: 68 : ::rtl::OUString sParamName1( RTL_CONSTASCII_USTRINGPARAM("implementationLoaderUrl") );
135 [ + - ]: 68 : ::rtl::OUString sParamType1( RTL_CONSTASCII_USTRINGPARAM("string") );
136 : 68 : aParameters[1].pParamName = sParamName1.pData;
137 : 68 : aParameters[1].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_STRING;
138 : 68 : aParameters[1].pTypeName = sParamType1.pData;
139 : 68 : aParameters[1].bIn = sal_True;
140 : 68 : aParameters[1].bOut = sal_False;
141 [ + - ]: 68 : ::rtl::OUString sParamName2( RTL_CONSTASCII_USTRINGPARAM("locationUrl") );
142 [ + - ]: 68 : ::rtl::OUString sParamType2( RTL_CONSTASCII_USTRINGPARAM("string") );
143 : 68 : aParameters[2].pParamName = sParamName2.pData;
144 : 68 : aParameters[2].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_STRING;
145 : 68 : aParameters[2].pTypeName = sParamType2.pData;
146 : 68 : aParameters[2].bIn = sal_True;
147 : 68 : aParameters[2].bOut = sal_False;
148 [ + - ]: 68 : ::rtl::OUString the_ExceptionName0(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.registry.CannotRegisterImplementationException"));
149 [ + - ]: 68 : ::rtl::OUString the_ExceptionName1(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.RuntimeException"));
150 : 68 : rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData, the_ExceptionName1.pData };
151 [ + - ]: 68 : ::rtl::OUString sReturnType1( RTL_CONSTASCII_USTRINGPARAM("boolean") );
152 [ + - ]: 68 : ::rtl::OUString sMethodName1( RTL_CONSTASCII_USTRINGPARAM("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 : 68 : 2, the_Exceptions );
159 : 68 : typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
160 : : }
161 : 68 : typelib_typedescription_release( (typelib_TypeDescription*)pMethod );
162 [ + - ]: 68 : }
163 : : }
164 : : else
165 : : {
166 : : OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
167 : : }
168 : 72 : return rRet;
169 : : }
170 : :
171 : : } } } }
172 : :
173 : 72 : inline ::com::sun::star::uno::Type const & SAL_CALL getCppuType(SAL_UNUSED_PARAMETER ::com::sun::star::uno::Reference< ::com::sun::star::loader::XImplementationLoader > const *) SAL_THROW(()) {
174 : 72 : return ::cppu::UnoType< ::com::sun::star::uno::Reference< ::com::sun::star::loader::XImplementationLoader > >::get();
175 : : }
176 : :
177 : 68 : ::com::sun::star::uno::Type const & ::com::sun::star::loader::XImplementationLoader::static_type(SAL_UNUSED_PARAMETER void *) {
178 : 68 : return ::getCppuType(static_cast< ::com::sun::star::uno::Reference< ::com::sun::star::loader::XImplementationLoader > * >(0));
179 : : }
180 : :
181 : : #endif // INCLUDED_COM_SUN_STAR_LOADER_XIMPLEMENTATIONLOADER_HPP
|