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