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