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 0 : ::com::sun::star::uno::Type * operator()() const
28 : {
29 0 : ::rtl::OUString sTypeName( "com.sun.star.bridge.XBridgeFactory" );
30 :
31 : // Start inline typedescription generation
32 0 : typelib_InterfaceTypeDescription * pTD = 0;
33 :
34 : typelib_TypeDescriptionReference * aSuperTypes[1];
35 0 : aSuperTypes[0] = ::cppu::UnoType< ::com::sun::star::uno::Reference< css::uno::XInterface > >::get().getTypeLibType();
36 0 : typelib_TypeDescriptionReference * pMembers[3] = { 0,0,0 };
37 0 : ::rtl::OUString sMethodName0( "com.sun.star.bridge.XBridgeFactory::createBridge" );
38 : typelib_typedescriptionreference_new( &pMembers[0],
39 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
40 0 : sMethodName0.pData );
41 0 : ::rtl::OUString sMethodName1( "com.sun.star.bridge.XBridgeFactory::getBridge" );
42 : typelib_typedescriptionreference_new( &pMembers[1],
43 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
44 0 : sMethodName1.pData );
45 0 : ::rtl::OUString sMethodName2( "com.sun.star.bridge.XBridgeFactory::getExistingBridges" );
46 : typelib_typedescriptionreference_new( &pMembers[2],
47 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
48 0 : sMethodName2.pData );
49 :
50 : typelib_typedescription_newMIInterface(
51 : &pTD,
52 : sTypeName.pData, 0x00000000, 0x0000, 0x0000, 0x00000000, 0x00000000,
53 : 1, aSuperTypes,
54 : 3,
55 0 : pMembers );
56 :
57 0 : typelib_typedescription_register( (typelib_TypeDescription**)&pTD );
58 0 : typelib_typedescriptionreference_release( pMembers[0] );
59 0 : typelib_typedescriptionreference_release( pMembers[1] );
60 0 : typelib_typedescriptionreference_release( pMembers[2] );
61 0 : typelib_typedescription_release( (typelib_TypeDescription*)pTD );
62 :
63 0 : 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 0 : inline ::com::sun::star::uno::Type const & cppu_detail_getUnoType(SAL_UNUSED_PARAMETER css::bridge::XBridgeFactory const *) {
72 0 : const ::com::sun::star::uno::Type &rRet = *detail::theXBridgeFactoryType::get();
73 : // End inline typedescription generation
74 : static bool bInitStarted = false;
75 0 : if (!bInitStarted)
76 : {
77 0 : ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
78 0 : if (!bInitStarted)
79 : {
80 : OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
81 0 : bInitStarted = true;
82 0 : ::cppu::UnoType< css::uno::RuntimeException >::get();
83 0 : ::cppu::UnoType< ::com::sun::star::uno::Reference< css::bridge::XBridge > >::get();
84 0 : ::cppu::UnoType< ::com::sun::star::uno::Reference< css::connection::XConnection > >::get();
85 0 : ::cppu::UnoType< ::com::sun::star::uno::Reference< css::bridge::XInstanceProvider > >::get();
86 0 : ::cppu::UnoType< css::bridge::BridgeExistsException >::get();
87 0 : ::cppu::UnoType< css::lang::IllegalArgumentException >::get();
88 0 : ::cppu::UnoType< ::cppu::UnoSequenceType< ::com::sun::star::uno::Reference< css::bridge::XBridge > > >::get();
89 :
90 0 : typelib_InterfaceMethodTypeDescription * pMethod = 0;
91 : {
92 : typelib_Parameter_Init aParameters[4];
93 0 : ::rtl::OUString sParamName0( "sName" );
94 0 : ::rtl::OUString sParamType0( "string" );
95 0 : aParameters[0].pParamName = sParamName0.pData;
96 0 : aParameters[0].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_STRING;
97 0 : aParameters[0].pTypeName = sParamType0.pData;
98 0 : aParameters[0].bIn = sal_True;
99 0 : aParameters[0].bOut = sal_False;
100 0 : ::rtl::OUString sParamName1( "sProtocol" );
101 0 : ::rtl::OUString sParamType1( "string" );
102 0 : aParameters[1].pParamName = sParamName1.pData;
103 0 : aParameters[1].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_STRING;
104 0 : aParameters[1].pTypeName = sParamType1.pData;
105 0 : aParameters[1].bIn = sal_True;
106 0 : aParameters[1].bOut = sal_False;
107 0 : ::rtl::OUString sParamName2( "aConnection" );
108 0 : ::rtl::OUString sParamType2( "com.sun.star.connection.XConnection" );
109 0 : aParameters[2].pParamName = sParamName2.pData;
110 0 : aParameters[2].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE;
111 0 : aParameters[2].pTypeName = sParamType2.pData;
112 0 : aParameters[2].bIn = sal_True;
113 0 : aParameters[2].bOut = sal_False;
114 0 : ::rtl::OUString sParamName3( "anInstanceProvider" );
115 0 : ::rtl::OUString sParamType3( "com.sun.star.bridge.XInstanceProvider" );
116 0 : aParameters[3].pParamName = sParamName3.pData;
117 0 : aParameters[3].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE;
118 0 : aParameters[3].pTypeName = sParamType3.pData;
119 0 : aParameters[3].bIn = sal_True;
120 0 : aParameters[3].bOut = sal_False;
121 0 : ::rtl::OUString the_ExceptionName0( "com.sun.star.bridge.BridgeExistsException" );
122 0 : ::rtl::OUString the_ExceptionName1( "com.sun.star.lang.IllegalArgumentException" );
123 0 : ::rtl::OUString the_ExceptionName2( "com.sun.star.uno.RuntimeException" );
124 0 : rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData, the_ExceptionName1.pData, the_ExceptionName2.pData };
125 0 : ::rtl::OUString sReturnType0( "com.sun.star.bridge.XBridge" );
126 0 : ::rtl::OUString sMethodName0( "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 0 : 3, the_Exceptions );
133 0 : typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
134 : }
135 : {
136 : typelib_Parameter_Init aParameters[1];
137 0 : ::rtl::OUString sParamName0( "sName" );
138 0 : ::rtl::OUString sParamType0( "string" );
139 0 : aParameters[0].pParamName = sParamName0.pData;
140 0 : aParameters[0].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_STRING;
141 0 : aParameters[0].pTypeName = sParamType0.pData;
142 0 : aParameters[0].bIn = sal_True;
143 0 : aParameters[0].bOut = sal_False;
144 0 : ::rtl::OUString the_ExceptionName0( "com.sun.star.uno.RuntimeException" );
145 0 : rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData };
146 0 : ::rtl::OUString sReturnType1( "com.sun.star.bridge.XBridge" );
147 0 : ::rtl::OUString sMethodName1( "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 0 : 1, the_Exceptions );
154 0 : typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
155 : }
156 : {
157 0 : ::rtl::OUString the_ExceptionName0( "com.sun.star.uno.RuntimeException" );
158 0 : rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData };
159 0 : ::rtl::OUString sReturnType2( "[]com.sun.star.bridge.XBridge" );
160 0 : ::rtl::OUString sMethodName2( "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 0 : 1, the_Exceptions );
167 0 : typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
168 : }
169 0 : typelib_typedescription_release( (typelib_TypeDescription*)pMethod );
170 0 : }
171 : }
172 : else
173 : {
174 : OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
175 : }
176 0 : return rRet;
177 : }
178 :
179 : } } } }
180 :
181 0 : inline ::com::sun::star::uno::Type const & SAL_CALL getCppuType(SAL_UNUSED_PARAMETER ::com::sun::star::uno::Reference< css::bridge::XBridgeFactory > const *) SAL_THROW(()) {
182 0 : return ::cppu::UnoType< ::com::sun::star::uno::Reference< css::bridge::XBridgeFactory > >::get();
183 : }
184 :
185 0 : ::com::sun::star::uno::Type const & css::bridge::XBridgeFactory::static_type(SAL_UNUSED_PARAMETER void *) {
186 0 : return ::getCppuType(static_cast< ::com::sun::star::uno::Reference< css::bridge::XBridgeFactory > * >(0));
187 : }
188 :
189 : #endif // INCLUDED_COM_SUN_STAR_BRIDGE_XBRIDGEFACTORY_HPP
|