Branch data 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 : 742 : ::com::sun::star::uno::Type * operator()() const
25 : : {
26 [ + - ]: 742 : ::rtl::OUString sTypeName( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.lang.XMultiServiceFactory") );
27 : :
28 : : // Start inline typedescription generation
29 : 742 : typelib_InterfaceTypeDescription * pTD = 0;
30 : :
31 : : typelib_TypeDescriptionReference * aSuperTypes[1];
32 [ + - ]: 742 : aSuperTypes[0] = ::cppu::UnoType< ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > >::get().getTypeLibType();
33 : 742 : typelib_TypeDescriptionReference * pMembers[3] = { 0,0,0 };
34 [ + - ]: 742 : ::rtl::OUString sMethodName0( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.lang.XMultiServiceFactory::createInstance") );
35 : : typelib_typedescriptionreference_new( &pMembers[0],
36 : : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
37 : 742 : sMethodName0.pData );
38 [ + - ]: 742 : ::rtl::OUString sMethodName1( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.lang.XMultiServiceFactory::createInstanceWithArguments") );
39 : : typelib_typedescriptionreference_new( &pMembers[1],
40 : : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
41 : 742 : sMethodName1.pData );
42 [ + - ]: 742 : ::rtl::OUString sMethodName2( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.lang.XMultiServiceFactory::getAvailableServiceNames") );
43 : : typelib_typedescriptionreference_new( &pMembers[2],
44 : : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
45 : 742 : sMethodName2.pData );
46 : :
47 : : typelib_typedescription_newMIInterface(
48 : : &pTD,
49 : : sTypeName.pData, 0x00000000, 0x0000, 0x0000, 0x00000000, 0x00000000,
50 : : 1, aSuperTypes,
51 : : 3,
52 : 742 : pMembers );
53 : :
54 : 742 : typelib_typedescription_register( (typelib_TypeDescription**)&pTD );
55 : 742 : typelib_typedescriptionreference_release( pMembers[0] );
56 : 742 : typelib_typedescriptionreference_release( pMembers[1] );
57 : 742 : typelib_typedescriptionreference_release( pMembers[2] );
58 : 742 : typelib_typedescription_release( (typelib_TypeDescription*)pTD );
59 : :
60 : 742 : 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 : 1578 : inline ::com::sun::star::uno::Type const & cppu_detail_getUnoType(SAL_UNUSED_PARAMETER ::com::sun::star::lang::XMultiServiceFactory const *) {
69 : 1578 : const ::com::sun::star::uno::Type &rRet = *detail::theXMultiServiceFactoryType::get();
70 : : // End inline typedescription generation
71 : : static bool bInitStarted = false;
72 [ + + ]: 1578 : if (!bInitStarted)
73 : : {
74 [ + - ][ + - ]: 742 : ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
75 [ + - ]: 742 : if (!bInitStarted)
76 : : {
77 : : OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
78 : 742 : bInitStarted = true;
79 [ + - ]: 742 : ::cppu::UnoType< ::com::sun::star::uno::RuntimeException >::get();
80 [ + - ]: 742 : ::cppu::UnoType< ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > >::get();
81 : 742 : ::cppu::UnoType< ::com::sun::star::uno::Exception >::get();
82 [ + - ]: 742 : ::cppu::UnoType< ::cppu::UnoSequenceType< ::com::sun::star::uno::Any > >::get();
83 [ + - ]: 742 : ::cppu::UnoType< ::cppu::UnoSequenceType< ::rtl::OUString > >::get();
84 : :
85 : 742 : typelib_InterfaceMethodTypeDescription * pMethod = 0;
86 : : {
87 : : typelib_Parameter_Init aParameters[1];
88 [ + - ]: 742 : ::rtl::OUString sParamName0( RTL_CONSTASCII_USTRINGPARAM("aServiceSpecifier") );
89 [ + - ]: 742 : ::rtl::OUString sParamType0( RTL_CONSTASCII_USTRINGPARAM("string") );
90 : 742 : aParameters[0].pParamName = sParamName0.pData;
91 : 742 : aParameters[0].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_STRING;
92 : 742 : aParameters[0].pTypeName = sParamType0.pData;
93 : 742 : aParameters[0].bIn = sal_True;
94 : 742 : aParameters[0].bOut = sal_False;
95 [ + - ]: 742 : ::rtl::OUString the_ExceptionName0(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.Exception"));
96 [ + - ]: 742 : ::rtl::OUString the_ExceptionName1(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.RuntimeException"));
97 : 742 : rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData, the_ExceptionName1.pData };
98 [ + - ]: 742 : ::rtl::OUString sReturnType0( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.XInterface") );
99 [ + - ]: 742 : ::rtl::OUString sMethodName0( RTL_CONSTASCII_USTRINGPARAM("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 : 742 : 2, the_Exceptions );
106 : 742 : typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
107 : : }
108 : : {
109 : : typelib_Parameter_Init aParameters[2];
110 [ + - ]: 742 : ::rtl::OUString sParamName0( RTL_CONSTASCII_USTRINGPARAM("ServiceSpecifier") );
111 [ + - ]: 742 : ::rtl::OUString sParamType0( RTL_CONSTASCII_USTRINGPARAM("string") );
112 : 742 : aParameters[0].pParamName = sParamName0.pData;
113 : 742 : aParameters[0].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_STRING;
114 : 742 : aParameters[0].pTypeName = sParamType0.pData;
115 : 742 : aParameters[0].bIn = sal_True;
116 : 742 : aParameters[0].bOut = sal_False;
117 [ + - ]: 742 : ::rtl::OUString sParamName1( RTL_CONSTASCII_USTRINGPARAM("Arguments") );
118 [ + - ]: 742 : ::rtl::OUString sParamType1( RTL_CONSTASCII_USTRINGPARAM("[]any") );
119 : 742 : aParameters[1].pParamName = sParamName1.pData;
120 : 742 : aParameters[1].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_SEQUENCE;
121 : 742 : aParameters[1].pTypeName = sParamType1.pData;
122 : 742 : aParameters[1].bIn = sal_True;
123 : 742 : aParameters[1].bOut = sal_False;
124 [ + - ]: 742 : ::rtl::OUString the_ExceptionName0(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.Exception"));
125 [ + - ]: 742 : ::rtl::OUString the_ExceptionName1(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.RuntimeException"));
126 : 742 : rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData, the_ExceptionName1.pData };
127 [ + - ]: 742 : ::rtl::OUString sReturnType1( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.XInterface") );
128 [ + - ]: 742 : ::rtl::OUString sMethodName1( RTL_CONSTASCII_USTRINGPARAM("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 : 742 : 2, the_Exceptions );
135 : 742 : typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
136 : : }
137 : : {
138 [ + - ]: 742 : ::rtl::OUString the_ExceptionName0(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.RuntimeException"));
139 : 742 : rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData };
140 [ + - ]: 742 : ::rtl::OUString sReturnType2( RTL_CONSTASCII_USTRINGPARAM("[]string") );
141 [ + - ]: 742 : ::rtl::OUString sMethodName2( RTL_CONSTASCII_USTRINGPARAM("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 : 742 : 1, the_Exceptions );
148 : 742 : typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
149 : : }
150 : 742 : typelib_typedescription_release( (typelib_TypeDescription*)pMethod );
151 [ + - ]: 742 : }
152 : : }
153 : : else
154 : : {
155 : : OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
156 : : }
157 : 1578 : return rRet;
158 : : }
159 : :
160 : : } } } }
161 : :
162 : 1578 : inline ::com::sun::star::uno::Type const & SAL_CALL getCppuType(SAL_UNUSED_PARAMETER ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > const *) SAL_THROW(()) {
163 : 1578 : return ::cppu::UnoType< ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > >::get();
164 : : }
165 : :
166 : 1578 : ::com::sun::star::uno::Type const & ::com::sun::star::lang::XMultiServiceFactory::static_type(SAL_UNUSED_PARAMETER void *) {
167 : 1578 : return ::getCppuType(static_cast< ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > * >(0));
168 : : }
169 : :
170 : : #endif // INCLUDED_COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP
|