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