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