Branch data 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 : 2 : ::com::sun::star::uno::Type * operator()() const
25 : : {
26 [ + - ]: 2 : ::rtl::OUString sTypeName( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.connection.XConnection") );
27 : :
28 : : // Start inline typedescription generation
29 : 2 : typelib_InterfaceTypeDescription * pTD = 0;
30 : :
31 : : typelib_TypeDescriptionReference * aSuperTypes[1];
32 [ + - ]: 2 : aSuperTypes[0] = ::cppu::UnoType< ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > >::get().getTypeLibType();
33 : 2 : typelib_TypeDescriptionReference * pMembers[5] = { 0,0,0,0,0 };
34 [ + - ]: 2 : ::rtl::OUString sMethodName0( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.connection.XConnection::read") );
35 : : typelib_typedescriptionreference_new( &pMembers[0],
36 : : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
37 : 2 : sMethodName0.pData );
38 [ + - ]: 2 : ::rtl::OUString sMethodName1( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.connection.XConnection::write") );
39 : : typelib_typedescriptionreference_new( &pMembers[1],
40 : : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
41 : 2 : sMethodName1.pData );
42 [ + - ]: 2 : ::rtl::OUString sMethodName2( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.connection.XConnection::flush") );
43 : : typelib_typedescriptionreference_new( &pMembers[2],
44 : : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
45 : 2 : sMethodName2.pData );
46 [ + - ]: 2 : ::rtl::OUString sMethodName3( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.connection.XConnection::close") );
47 : : typelib_typedescriptionreference_new( &pMembers[3],
48 : : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
49 : 2 : sMethodName3.pData );
50 [ + - ]: 2 : ::rtl::OUString sMethodName4( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.connection.XConnection::getDescription") );
51 : : typelib_typedescriptionreference_new( &pMembers[4],
52 : : (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
53 : 2 : sMethodName4.pData );
54 : :
55 : : typelib_typedescription_newMIInterface(
56 : : &pTD,
57 : : sTypeName.pData, 0x00000000, 0x0000, 0x0000, 0x00000000, 0x00000000,
58 : : 1, aSuperTypes,
59 : : 5,
60 : 2 : pMembers );
61 : :
62 : 2 : typelib_typedescription_register( (typelib_TypeDescription**)&pTD );
63 : 2 : typelib_typedescriptionreference_release( pMembers[0] );
64 : 2 : typelib_typedescriptionreference_release( pMembers[1] );
65 : 2 : typelib_typedescriptionreference_release( pMembers[2] );
66 : 2 : typelib_typedescriptionreference_release( pMembers[3] );
67 : 2 : typelib_typedescriptionreference_release( pMembers[4] );
68 : 2 : typelib_typedescription_release( (typelib_TypeDescription*)pTD );
69 : :
70 : 2 : 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 : 4 : inline ::com::sun::star::uno::Type const & cppu_detail_getUnoType(SAL_UNUSED_PARAMETER ::com::sun::star::connection::XConnection const *) {
79 : 4 : const ::com::sun::star::uno::Type &rRet = *detail::theXConnectionType::get();
80 : : // End inline typedescription generation
81 : : static bool bInitStarted = false;
82 [ + + ]: 4 : if (!bInitStarted)
83 : : {
84 [ + - ][ + - ]: 2 : ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
85 [ + - ]: 2 : if (!bInitStarted)
86 : : {
87 : : OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
88 : 2 : bInitStarted = true;
89 [ + - ]: 2 : ::cppu::UnoType< ::com::sun::star::uno::RuntimeException >::get();
90 [ + - ]: 2 : ::cppu::UnoType< ::cppu::UnoSequenceType< ::sal_Int8 > >::get();
91 [ + - ]: 2 : ::cppu::UnoType< ::com::sun::star::io::IOException >::get();
92 : :
93 : 2 : typelib_InterfaceMethodTypeDescription * pMethod = 0;
94 : : {
95 : : typelib_Parameter_Init aParameters[2];
96 [ + - ]: 2 : ::rtl::OUString sParamName0( RTL_CONSTASCII_USTRINGPARAM("aReadBytes") );
97 [ + - ]: 2 : ::rtl::OUString sParamType0( RTL_CONSTASCII_USTRINGPARAM("[]byte") );
98 : 2 : aParameters[0].pParamName = sParamName0.pData;
99 : 2 : aParameters[0].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_SEQUENCE;
100 : 2 : aParameters[0].pTypeName = sParamType0.pData;
101 : 2 : aParameters[0].bIn = sal_False;
102 : 2 : aParameters[0].bOut = sal_True;
103 [ + - ]: 2 : ::rtl::OUString sParamName1( RTL_CONSTASCII_USTRINGPARAM("nBytesToRead") );
104 [ + - ]: 2 : ::rtl::OUString sParamType1( RTL_CONSTASCII_USTRINGPARAM("long") );
105 : 2 : aParameters[1].pParamName = sParamName1.pData;
106 : 2 : aParameters[1].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_LONG;
107 : 2 : aParameters[1].pTypeName = sParamType1.pData;
108 : 2 : aParameters[1].bIn = sal_True;
109 : 2 : aParameters[1].bOut = sal_False;
110 [ + - ]: 2 : ::rtl::OUString the_ExceptionName0(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.io.IOException"));
111 [ + - ]: 2 : ::rtl::OUString the_ExceptionName1(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.RuntimeException"));
112 : 2 : rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData, the_ExceptionName1.pData };
113 [ + - ]: 2 : ::rtl::OUString sReturnType0( RTL_CONSTASCII_USTRINGPARAM("long") );
114 [ + - ]: 2 : ::rtl::OUString sMethodName0( RTL_CONSTASCII_USTRINGPARAM("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 : 2 : 2, the_Exceptions );
121 : 2 : typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
122 : : }
123 : : {
124 : : typelib_Parameter_Init aParameters[1];
125 [ + - ]: 2 : ::rtl::OUString sParamName0( RTL_CONSTASCII_USTRINGPARAM("aData") );
126 [ + - ]: 2 : ::rtl::OUString sParamType0( RTL_CONSTASCII_USTRINGPARAM("[]byte") );
127 : 2 : aParameters[0].pParamName = sParamName0.pData;
128 : 2 : aParameters[0].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_SEQUENCE;
129 : 2 : aParameters[0].pTypeName = sParamType0.pData;
130 : 2 : aParameters[0].bIn = sal_True;
131 : 2 : aParameters[0].bOut = sal_False;
132 [ + - ]: 2 : ::rtl::OUString the_ExceptionName0(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.io.IOException"));
133 [ + - ]: 2 : ::rtl::OUString the_ExceptionName1(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.RuntimeException"));
134 : 2 : rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData, the_ExceptionName1.pData };
135 [ + - ]: 2 : ::rtl::OUString sReturnType1( RTL_CONSTASCII_USTRINGPARAM("void") );
136 [ + - ]: 2 : ::rtl::OUString sMethodName1( RTL_CONSTASCII_USTRINGPARAM("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 : 2 : 2, the_Exceptions );
143 : 2 : typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
144 : : }
145 : : {
146 [ + - ]: 2 : ::rtl::OUString the_ExceptionName0(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.io.IOException"));
147 [ + - ]: 2 : ::rtl::OUString the_ExceptionName1(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.RuntimeException"));
148 : 2 : rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData, the_ExceptionName1.pData };
149 [ + - ]: 2 : ::rtl::OUString sReturnType2( RTL_CONSTASCII_USTRINGPARAM("void") );
150 [ + - ]: 2 : ::rtl::OUString sMethodName2( RTL_CONSTASCII_USTRINGPARAM("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 : 2 : 2, the_Exceptions );
157 : 2 : typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
158 : : }
159 : : {
160 [ + - ]: 2 : ::rtl::OUString the_ExceptionName0(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.io.IOException"));
161 [ + - ]: 2 : ::rtl::OUString the_ExceptionName1(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.RuntimeException"));
162 : 2 : rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData, the_ExceptionName1.pData };
163 [ + - ]: 2 : ::rtl::OUString sReturnType3( RTL_CONSTASCII_USTRINGPARAM("void") );
164 [ + - ]: 2 : ::rtl::OUString sMethodName3( RTL_CONSTASCII_USTRINGPARAM("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 : 2 : 2, the_Exceptions );
171 : 2 : typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
172 : : }
173 : : {
174 [ + - ]: 2 : ::rtl::OUString the_ExceptionName0(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.RuntimeException"));
175 : 2 : rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData };
176 [ + - ]: 2 : ::rtl::OUString sReturnType4( RTL_CONSTASCII_USTRINGPARAM("string") );
177 [ + - ]: 2 : ::rtl::OUString sMethodName4( RTL_CONSTASCII_USTRINGPARAM("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 : 2 : 1, the_Exceptions );
184 : 2 : typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
185 : : }
186 : 2 : typelib_typedescription_release( (typelib_TypeDescription*)pMethod );
187 [ + - ]: 2 : }
188 : : }
189 : : else
190 : : {
191 : : OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
192 : : }
193 : 4 : 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< ::com::sun::star::connection::XConnection > const *) SAL_THROW(()) {
199 : : return ::cppu::UnoType< ::com::sun::star::uno::Reference< ::com::sun::star::connection::XConnection > >::get();
200 : : }
201 : :
202 : : ::com::sun::star::uno::Type const & ::com::sun::star::connection::XConnection::static_type(SAL_UNUSED_PARAMETER void *) {
203 : : return ::getCppuType(static_cast< ::com::sun::star::uno::Reference< ::com::sun::star::connection::XConnection > * >(0));
204 : : }
205 : :
206 : : #endif // INCLUDED_COM_SUN_STAR_CONNECTION_XCONNECTION_HPP
|