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