1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #if !defined WIN32_LEAN_AND_MEAN
21 # define WIN32_LEAN_AND_MEAN
26 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
27 #include <com/sun/star/registry/XRegistryKey.hpp>
28 #include <comphelper/diagnose_ex.hxx>
29 #include <uno/environment.h>
30 #include <comphelper/processfactory.hxx>
31 #include <cppuhelper/factory.hxx>
32 // OPTIONAL is a constant in com.sun.star.beans.PropertyAttributes but it must be
33 // undef'd in some header files
34 #define OPTIONAL OPTIONAL
35 #include <com/sun/star/beans/PropertyAttribute.hpp>
36 #include <com/sun/star/script/XInvocation.hpp>
37 #include <com/sun/star/reflection/theCoreReflection.hpp>
38 #include <com/sun/star/reflection/XIdlReflection.hpp>
39 #include <com/sun/star/lang/XEventListener.hpp>
41 #include <cppuhelper/implbase.hxx>
42 #include <com/sun/star/uno/Reference.h>
43 #include <rtl/ustring.h>
44 #include <com/sun/star/uno/Reference.hxx>
45 #include <oletest/XTestSequence.hpp>
46 #include <oletest/XTestStruct.hpp>
47 #include <oletest/XTestOther.hpp>
48 #include <oletest/XTestInterfaces.hpp>
49 #include <oletest/XSimple.hpp>
50 #include <oletest/XSimple2.hpp>
51 #include <oletest/XSimple3.hpp>
52 #include <oletest/XTestInParameters.hpp>
53 #include <oletest/XIdentity.hpp>
54 #include <com/sun/star/beans/Property.hpp>
57 using namespace oletest
;
58 using namespace com::sun::star::uno
;
59 using namespace com::sun::star::lang
;
60 using namespace com::sun::star::beans
;
61 using namespace com::sun::star::registry
;
62 using namespace com::sun::star::script
;
63 using namespace com::sun::star::reflection
;
66 #define IMPL_NAME L"oletest.OleTestImpl" // oletest.OleTestImpl in applicat.rdb
67 #define SERVICE_NAME L"oletest.OleTest"
68 #define KEY1 L"/oletest.OleTestImpl/UNO/SERVICES"
69 #define KEY2 L"oletest.OleTest"
71 class OComponent
: public WeakImplHelper
<
72 XTestSequence
, XTestStruct
, XTestOther
, XTestInterfaces
,
73 XSimple
, XTestInParameters
, XIdentity
>
75 Reference
<XInterface
> m_xIntIdentity
;
76 sal_Int32 m_arrayConstructor
;
77 Reference
<XMultiServiceFactory
> m_rFactory
;
79 Sequence
<sal_Int8
> m_seqByte
;
80 Sequence
<float> m_seqFloat
;
81 Sequence
<double> m_seqDouble
;
82 Sequence
<sal_Bool
> m_seqBool
;
83 Sequence
<sal_Int16
> m_seqShort
;
84 Sequence
<sal_uInt16
> m_seqUShort
;
85 Sequence
<sal_Int32
> m_seqLong
;
86 Sequence
<sal_uInt32
> m_seqULong
;
87 Sequence
<sal_Unicode
> m_seqChar
;
88 Sequence
<OUString
> m_seqString
;
89 Sequence
<Any
> m_seqAny
;
90 Sequence
<Type
> m_seqType
;
91 Sequence
<Sequence
< sal_Int32
> > m_seq1
;
92 Sequence
<Sequence
< Sequence
< sal_Int32
> > > m_seq2
;
95 Sequence
<Reference
< XInterface
> > m_seqxInterface
;
110 Reference
<XInterface
> m_xinterface
;
112 sal_Int8 m_attr_int8
;
113 sal_uInt8 m_attr_uint8
;
114 sal_Int16 m_attr_int16
;
115 sal_uInt16 m_attr_uint16
;
116 sal_Int32 m_attr_int32
;
117 sal_uInt32 m_attr_uint32
;
118 sal_Int64 m_attr_int64
;
119 sal_uInt64 m_attr_uint64
;
121 double m_attr_double
;
122 OUString m_attr_string
;
123 sal_Unicode m_attr_char
;
124 sal_Bool m_attr_bool
;
127 Reference
<XInterface
> m_attr_xinterface
;
128 Reference
<XInvocation
> m_attr_xinvocation
;
131 OComponent( const Reference
<XMultiServiceFactory
> & rFactory
) :
132 m_rFactory( rFactory
), m_arrayConstructor(0) {}
134 public: // XTestSequence
135 virtual Sequence
<sal_Int8
> SAL_CALL
methodByte(const Sequence
< sal_Int8
>& aSeq
) throw( RuntimeException
);
136 virtual Sequence
<float> SAL_CALL
methodFloat(const Sequence
< float >& aSeq
) throw( RuntimeException
);
137 virtual Sequence
< double > SAL_CALL
methodDouble(const Sequence
< double >& aSeq
) throw( RuntimeException
);
138 virtual Sequence
< sal_Bool
> SAL_CALL
methodBool(const Sequence
< sal_Bool
>& aSeq
) throw( RuntimeException
);
139 virtual Sequence
< sal_Int16
> SAL_CALL
methodShort(const Sequence
< sal_Int16
>& aSeq
) throw( RuntimeException
);
140 virtual Sequence
< sal_uInt16
> SAL_CALL
methodUShort(const Sequence
< sal_uInt16
>& aSeq
) throw( RuntimeException
);
141 virtual Sequence
< sal_Int32
> SAL_CALL
methodLong(const Sequence
< sal_Int32
>& aSeq
) throw( RuntimeException
) ;
142 virtual Sequence
< sal_uInt32
> SAL_CALL
methodULong(const Sequence
< sal_uInt32
>& aSeq
) throw( RuntimeException
);
143 virtual Sequence
< OUString
> SAL_CALL
methodString(const Sequence
< OUString
>& aSeq
) throw( RuntimeException
);
144 virtual Sequence
< sal_Unicode
> SAL_CALL
methodChar(const Sequence
< sal_Unicode
>& aSeq
) throw( RuntimeException
);
145 virtual Sequence
< Any
> SAL_CALL
methodAny(const Sequence
< Any
>& aSeq
) throw( RuntimeException
);
146 virtual Sequence
< Type
> SAL_CALL
methodType(const Sequence
< Type
>& aSeq
) throw( RuntimeException
);
147 virtual Sequence
< Reference
< XInterface
> > SAL_CALL
methodXInterface( const Sequence
< Reference
< XInterface
> >& aSeq
) throw(RuntimeException
) ;
148 virtual Sequence
< Sequence
< sal_Int32
> > SAL_CALL
methodSequence(const Sequence
< Sequence
< sal_Int32
> >& aSeq
) throw( RuntimeException
);
149 virtual Sequence
< Sequence
< Sequence
< sal_Int32
> > > SAL_CALL
methodSequence2(const Sequence
< Sequence
< Sequence
< sal_Int32
> > >& aSeq
) throw( RuntimeException
);
150 virtual Sequence
< Reference
<XEventListener
> > SAL_CALL
methodXEventListeners( const Sequence
<Reference
<XEventListener
> >& aSeq
) throw( RuntimeException
);
151 virtual Sequence
< Sequence
<Reference
<XEventListener
> > > SAL_CALL
methodXEventListenersMul( const Sequence
<Sequence
<Reference
<XEventListener
> > >& aSeq
) throw (RuntimeException
);
153 virtual Sequence
< sal_Int8
> SAL_CALL
getAttrByte() throw( RuntimeException
);
154 virtual void SAL_CALL
setAttrByte(const Sequence
< sal_Int8
>& AttrByte_
) throw( RuntimeException
);
155 virtual Sequence
< float > SAL_CALL
getAttrFloat() throw( RuntimeException
) ;
156 virtual void SAL_CALL
setAttrFloat(const Sequence
< float >& AttrFloat_
) throw( RuntimeException
);
157 virtual Sequence
< double > SAL_CALL
getAttrDouble() throw( RuntimeException
) ;
158 virtual void SAL_CALL
setAttrDouble(const Sequence
< double >& AttrDouble_
) throw( RuntimeException
);
159 virtual Sequence
< sal_Bool
> SAL_CALL
getAttrBool() throw( RuntimeException
);
160 virtual void SAL_CALL
setAttrBool(const Sequence
< sal_Bool
>& AttrBool_
) throw( RuntimeException
);
161 virtual Sequence
< sal_Int16
> SAL_CALL
getAttrShort() throw( RuntimeException
);
162 virtual void SAL_CALL
setAttrShort(const Sequence
< sal_Int16
>& AttrShort_
) throw( RuntimeException
);
163 virtual Sequence
< sal_uInt16
> SAL_CALL
getAttrUShort() throw( RuntimeException
);
164 virtual void SAL_CALL
setAttrUShort(const Sequence
< sal_uInt16
>& AttrUShort_
) throw( RuntimeException
);
165 virtual Sequence
< sal_Int32
> SAL_CALL
getAttrLong() throw( RuntimeException
);
166 virtual void SAL_CALL
setAttrLong(const Sequence
< sal_Int32
>& AttrLong_
) throw( RuntimeException
);
167 virtual Sequence
< sal_uInt32
> SAL_CALL
getAttrULong() throw( RuntimeException
);
168 virtual void SAL_CALL
setAttrULong(const Sequence
< sal_uInt32
>& AttrULong_
) throw( RuntimeException
);
169 virtual Sequence
< OUString
> SAL_CALL
getAttrString() throw(RuntimeException
);
170 virtual void SAL_CALL
setAttrString(const Sequence
< OUString
>& AttrString_
) throw( RuntimeException
);
171 virtual Sequence
< sal_Unicode
> SAL_CALL
getAttrChar() throw( RuntimeException
);
172 virtual void SAL_CALL
setAttrChar(const Sequence
< sal_Unicode
>& AttrChar_
) throw( RuntimeException
);
173 virtual Sequence
< Any
> SAL_CALL
getAttrAny() throw( RuntimeException
);
174 virtual void SAL_CALL
setAttrAny(const Sequence
< Any
>& AttrAny_
) throw( RuntimeException
);
175 virtual Sequence
< Type
> SAL_CALL
getAttrType() throw( RuntimeException
);
176 virtual void SAL_CALL
setAttrType( const Sequence
< Type
>& _attrtype
) throw (RuntimeException
);
177 virtual Sequence
< Sequence
< sal_Int32
> > SAL_CALL
getAttrSequence() throw( RuntimeException
);
178 virtual void SAL_CALL
setAttrSequence(const Sequence
< Sequence
< sal_Int32
> >& AttrSequence_
) throw( RuntimeException
);
179 virtual Sequence
< Sequence
< Sequence
< sal_Int32
> > > SAL_CALL
getAttrSequence2() throw( RuntimeException
);
180 virtual void SAL_CALL
setAttrSequence2(const Sequence
< Sequence
< Sequence
< sal_Int32
> > >& AttrSequence2_
) throw ( RuntimeException
);
181 virtual Sequence
< Reference
< XInterface
> > SAL_CALL
getAttrXInterface() throw(RuntimeException
);
182 virtual void SAL_CALL
setAttrXInterface( const Sequence
< Reference
< XInterface
> >& _attrxinterface
) throw(RuntimeException
);
184 virtual ::sal_Int8 SAL_CALL
getAByte() throw (RuntimeException
);
185 virtual void SAL_CALL
setAByte( ::sal_Int8 _abyte
) throw (RuntimeException
);
186 virtual float SAL_CALL
getAFloat() throw (RuntimeException
);
187 virtual void SAL_CALL
setAFloat( float _afloat
) throw (RuntimeException
);
188 virtual double SAL_CALL
getADouble() throw (RuntimeException
);
189 virtual void SAL_CALL
setADouble( double _adouble
) throw (RuntimeException
);
190 virtual sal_Bool SAL_CALL
getABool() throw (RuntimeException
);
191 virtual void SAL_CALL
setABool( sal_Bool _abool
) throw (RuntimeException
);
192 virtual ::sal_Int16 SAL_CALL
getAShort() throw (RuntimeException
);
193 virtual void SAL_CALL
setAShort( ::sal_Int16 _ashort
) throw (RuntimeException
);
194 virtual ::sal_uInt16 SAL_CALL
getAUShort() throw (RuntimeException
);
195 virtual void SAL_CALL
setAUShort( ::sal_uInt16 _aushort
) throw (RuntimeException
);
196 virtual ::sal_Int32 SAL_CALL
getALong() throw (RuntimeException
);
197 virtual void SAL_CALL
setALong( ::sal_Int32 _along
) throw (RuntimeException
);
198 virtual ::sal_uInt32 SAL_CALL
getAULong() throw (RuntimeException
);
199 virtual void SAL_CALL
setAULong( ::sal_uInt32 _aulong
) throw (RuntimeException
);
200 virtual OUString SAL_CALL
getAString() throw (RuntimeException
);
201 virtual void SAL_CALL
setAString( const OUString
& _astring
) throw (RuntimeException
);
202 virtual ::sal_Unicode SAL_CALL
getAChar() throw (RuntimeException
);
203 virtual void SAL_CALL
setAChar( ::sal_Unicode _achar
) throw (RuntimeException
);
204 virtual Any SAL_CALL
getAAny() throw (RuntimeException
);
205 virtual void SAL_CALL
setAAny( const Any
& _aany
) throw (RuntimeException
);
206 virtual Type SAL_CALL
getAType() throw (RuntimeException
);
207 virtual void SAL_CALL
setAType( const Type
& _atype
) throw (RuntimeException
);
208 virtual Reference
< XInterface
> SAL_CALL
getAXInterface() throw (RuntimeException
);
209 virtual void SAL_CALL
setAXInterface( const Reference
<XInterface
>& _axinterface
) throw (RuntimeException
);
210 virtual Reference
<XInvocation
> SAL_CALL
getAXInvocation() throw (RuntimeException
);
211 virtual void SAL_CALL
setAXInvocation( const Reference
< XInvocation
>& _axinvocation
) throw (RuntimeException
);
213 virtual void SAL_CALL
testout_methodByte(sal_Int8
& rOut
) throw( RuntimeException
);
214 virtual void SAL_CALL
testout_methodFloat(float& rOut
) throw( RuntimeException
);
215 virtual void SAL_CALL
testout_methodDouble(double& rOut
) throw( RuntimeException
);
216 virtual void SAL_CALL
testout_methodBool(sal_Bool
& rOut
) throw( RuntimeException
);
217 virtual void SAL_CALL
testout_methodShort(sal_Int16
& rOut
) throw( RuntimeException
);
218 virtual void SAL_CALL
testout_methodUShort(sal_uInt16
& rOut
) throw( RuntimeException
);
219 virtual void SAL_CALL
testout_methodLong(sal_Int32
& rOut
) throw( RuntimeException
);
220 virtual void SAL_CALL
testout_methodULong(sal_uInt32
& rOut
) throw( RuntimeException
);
221 virtual void SAL_CALL
testout_methodHyper(sal_Int64
& rOut
) throw( RuntimeException
);
222 virtual void SAL_CALL
testout_methodUHyper(sal_uInt64
& rOut
) throw( RuntimeException
);
223 virtual void SAL_CALL
testout_methodString(OUString
& rOut
) throw( RuntimeException
);
224 virtual void SAL_CALL
testout_methodChar(sal_Unicode
& rOut
) throw( RuntimeException
);
225 virtual void SAL_CALL
testout_methodAny(Any
& rOut
) throw( RuntimeException
);
226 virtual void SAL_CALL
testout_methodType(Type
& rOut
) throw( RuntimeException
);
227 virtual void SAL_CALL
testout_methodSequence(Sequence
< sal_Int32
>& rOut
) throw( RuntimeException
);
228 virtual void SAL_CALL
testout_methodSequence2(Sequence
< Sequence
< sal_Int32
> >& rOut
) throw( RuntimeException
);
229 virtual void SAL_CALL
testout_methodMulParams1(sal_Int32
& rout1
, sal_Int32
& rout2
) throw( RuntimeException
);
230 virtual void SAL_CALL
testout_methodMulParams2(sal_Int32
& rout1
, sal_Int32
& rout2
, OUString
& rout3
) throw( RuntimeException
);
231 virtual void SAL_CALL
testout_methodMulParams3(const OUString
& sin
, OUString
& sout
) throw( RuntimeException
);
232 virtual void SAL_CALL
testout_methodMulParams4( float in1
, float& out1
, sal_Int32 in2
, sal_Int32
& out2
, sal_Int32 in3
) throw(RuntimeException
);
233 virtual void SAL_CALL
testout_methodXInterface( Reference
< XInterface
>& rOut
) throw(RuntimeException
);
235 virtual void SAL_CALL
testinout_methodByte(sal_Int8
& rOut
) throw( RuntimeException
);
236 virtual void SAL_CALL
testinout_methodFloat(float& rOut
) throw( RuntimeException
);
237 virtual void SAL_CALL
testinout_methodDouble(double& rOut
) throw( RuntimeException
);
238 virtual void SAL_CALL
testinout_methodBool(sal_Bool
& rOut
) throw( RuntimeException
);
239 virtual void SAL_CALL
testinout_methodShort(sal_Int16
& rOut
) throw( RuntimeException
);
240 virtual void SAL_CALL
testinout_methodUShort(sal_uInt16
& rOut
) throw( RuntimeException
);
241 virtual void SAL_CALL
testinout_methodLong(sal_Int32
& rOut
) throw( RuntimeException
);
242 virtual void SAL_CALL
testinout_methodULong(sal_uInt32
& rOut
) throw( RuntimeException
);
243 virtual void SAL_CALL
testinout_methodHyper(sal_Int64
& rOut
) throw( RuntimeException
);
244 virtual void SAL_CALL
testinout_methodUHyper(sal_uInt64
& rOut
) throw( RuntimeException
);
245 virtual void SAL_CALL
testinout_methodString(OUString
& rOut
) throw( RuntimeException
);
246 virtual void SAL_CALL
testinout_methodChar(sal_Unicode
& rOut
) throw( RuntimeException
);
247 virtual void SAL_CALL
testinout_methodAny(Any
& rOut
) throw( RuntimeException
);
248 virtual void SAL_CALL
testinout_methodType(Type
& rOut
) throw( RuntimeException
);
249 virtual void SAL_CALL
testinout_methodSequence(Sequence
< sal_Int32
>& rOut
) throw( RuntimeException
);
250 virtual void SAL_CALL
testinout_methodSequence2(Sequence
< Sequence
< sal_Int32
> >& rOut
) throw( RuntimeException
);
251 virtual void SAL_CALL
testinout_methodXInterface( Reference
< XInvocation
>& rOut
) throw(RuntimeException
);
252 virtual void SAL_CALL
testinout_methodXInterface2( Reference
< XInterface
> & rOut
) throw( RuntimeException
);
253 virtual Any SAL_CALL
methodAnyTest1(const Any
& rIn
) throw( RuntimeException
) ;
254 virtual Any SAL_CALL
getAttrAny2() throw( RuntimeException
) ;
255 virtual void SAL_CALL
setAttrAny2(const Any
& AttrAny2_
) throw( RuntimeException
) ;
259 virtual void SAL_CALL
methodStruct(const Property
& aProp
) throw( RuntimeException
);
261 virtual Property SAL_CALL
retMethodStruct() throw( RuntimeException
);
263 virtual Property SAL_CALL
getAttrStruct() throw( RuntimeException
);
264 virtual void SAL_CALL
setAttrStruct(const Property
& AttrStruct_
) throw( RuntimeException
);
265 virtual Property SAL_CALL
methodStruct2( const Property
& aProp
) throw (RuntimeException
);
268 virtual void SAL_CALL
other_methodAnyIn(const Any
& rAny
) throw( RuntimeException
);
269 virtual void SAL_CALL
other_methodAnyOut(Any
& rAny
) throw( RuntimeException
);
270 virtual Any SAL_CALL
other_methodAnyRet() throw( RuntimeException
);
271 virtual void SAL_CALL
in_float( float val
) throw ( RuntimeException
);
272 virtual Any SAL_CALL
other_methodAny( const Any
& rAny
, const OUString
& typeInAny
)
273 throw (RuntimeException
);
276 virtual sal_Int8 SAL_CALL
in_methodByte( sal_Int8 rIn
) throw (RuntimeException
);
277 virtual float SAL_CALL
in_methodFloat( float rIn
) throw (RuntimeException
);
278 virtual double SAL_CALL
in_methodDouble( double rIn
) throw (RuntimeException
);
279 virtual sal_Bool SAL_CALL
in_methodBool( sal_Bool rIn
) throw (RuntimeException
);
280 virtual sal_Int16 SAL_CALL
in_methodShort( sal_Int16 rIn
) throw (RuntimeException
);
281 virtual sal_uInt16 SAL_CALL
in_methodUShort( sal_uInt16 rIn
) throw (RuntimeException
);
282 virtual sal_Int32 SAL_CALL
in_methodLong( sal_Int32 rIn
) throw (RuntimeException
);
283 virtual sal_uInt32 SAL_CALL
in_methodULong( sal_uInt32 rIn
) throw (RuntimeException
);
284 virtual sal_Int64 SAL_CALL
in_methodHyper( sal_Int64 rIn
) throw (RuntimeException
);
285 virtual sal_uInt64 SAL_CALL
in_methodUHyper( sal_uInt64 rIn
) throw (RuntimeException
);
286 virtual OUString SAL_CALL
in_methodString( const OUString
& rIn
) throw (RuntimeException
);
287 virtual sal_Unicode SAL_CALL
in_methodChar( sal_Unicode rIn
) throw (RuntimeException
);
288 virtual Any SAL_CALL
in_methodAny( const Any
& rIn
) throw (RuntimeException
);
289 virtual Type SAL_CALL
in_methodType( const Type
& rIn
) throw (RuntimeException
);
290 virtual Reference
<XInterface
> SAL_CALL
in_methodXInterface( const Reference
< XInterface
>& rIn
) throw (RuntimeException
);
291 virtual Reference
<XInvocation
> SAL_CALL
in_methodInvocation( const Reference
< XInvocation
>& inv
) throw (RuntimeException
);
292 virtual SimpleStruct SAL_CALL
in_methodStruct( const SimpleStruct
& aStruct
) throw (RuntimeException
);
293 virtual void SAL_CALL
in_methodAll( sal_Int8 b
, float f
, double d
, sal_Bool boo
, sal_Int16 sh
, sal_uInt16 us
, sal_Int32 l
, sal_uInt32 ul
, const OUString
& s
, sal_Unicode c
, const Any
& a
, const Type
& t
, const Reference
<XInvocation
>& inv
) throw (RuntimeException
);
295 // XTestInterfaces --------------------------------------------------------------------------
296 virtual void SAL_CALL
testInterface( const Reference
< XCallback
>& xCallback
, sal_Int32 mode
) throw(RuntimeException
);
297 virtual void SAL_CALL
testInterface2( const Reference
< XSimple
>& xSimple
, sal_Int32 mode
) throw(RuntimeException
);
298 // XSimple --------------------------------------------------------------------------
299 void SAL_CALL
func( const OUString
&message
) throw(css::uno::RuntimeException
);
300 OUString SAL_CALL
getName() throw(css::uno::RuntimeException
);
303 virtual void SAL_CALL
setObject( const Reference
< XInterface
>& val
) throw (RuntimeException
);
304 virtual sal_Bool SAL_CALL
isSame( const Reference
< XInterface
>& val
) throw (RuntimeException
);
305 virtual Reference
< XInterface
> SAL_CALL
getThis( ) throw (RuntimeException
);
308 class EventListener
: public WeakImplHelper
<XEventListener
>
311 EventListener(): bCalled( sal_False
)
313 virtual void SAL_CALL
disposing( const css::lang::EventObject
& Source
) throw (RuntimeException
);
319 OComponent::~OComponent()
324 // functions ==============================================================================
326 Reference
<XInterface
> SAL_CALL
OComponent_CreateInstance( const Reference
<XMultiServiceFactory
> & rSMgr
) throw(RuntimeException
)
328 // Reference<XInterface> xService(static_cast<XWeak*>(new OComponent( rSMgr )), UNO_QUERY);
329 OComponent
* o
= new OComponent( rSMgr
);
330 Reference
<XInterface
> xService(static_cast<XIdentity
*>(o
), UNO_QUERY
);
334 Sequence
<OUString
> OComponent_getSupportedServiceNames()
336 Sequence
<OUString
> aRet
{ SERVICE_NAME
;//ODataInputStream_getImplementationName() };
342 extern "C" sal_Bool SAL_CALL
component_writeInfo( void * /*pServiceManager*/, void * pRegistryKey
)
348 Reference
<XRegistryKey
> xNewKey
=
349 reinterpret_cast<XRegistryKey
*>( pRegistryKey
)->createKey(KEY1
);
350 xNewKey
->createKey( KEY2
);
354 catch(InvalidRegistryException
&)
356 TOOLS_WARN_EXCEPTION("extensions.olebridge", "");
362 extern "C" SAL_DLLPUBLIC_EXPORT
void * SAL_CALL
component_getFactory(
363 const char * pImplName
, void * pServiceManager
, void * /*pRegistryKey*/ )
365 static void * pRet
= NULL
;
368 OUString
aImplName( OUString::createFromAscii( pImplName
) );
369 if (pServiceManager
&& aImplName
.equals( IMPL_NAME
))
371 Reference
<XMultiServiceFactory
> xMulFac(
372 reinterpret_cast< XMultiServiceFactory
*>(pServiceManager
));
374 Sequence
<OUString
> seqServiceNames
;
375 Reference
<XSingleServiceFactory
> xFactory
= createOneInstanceFactory( xMulFac
, SERVICE_NAME
,
376 OComponent_CreateInstance
, seqServiceNames
);
381 pRet
= xFactory
.get();
389 // XTestSequence ============================================================================
390 Sequence
<sal_Int8
> SAL_CALL
OComponent::methodByte(const Sequence
< sal_Int8
>& aSeq
) throw( RuntimeException
)
393 for( const auto& i
: aSeq
.getConstArray() ){
398 Sequence
<float> SAL_CALL
OComponent::methodFloat(const Sequence
< float>& aSeq
) throw( RuntimeException
)
401 for( const auto& i
: aSeq
.getConstArray() ){
406 Sequence
<double> SAL_CALL
OComponent::methodDouble(const Sequence
< double >& aSeq
) throw( RuntimeException
)
409 for( const auto& i
: aSeq
.getConstArray() ){
414 Sequence
< sal_Bool
> SAL_CALL
OComponent::methodBool(const Sequence
< sal_Bool
>& aSeq
) throw( RuntimeException
)
417 for( const auto& i
: aSeq
.getConstArray() ){
422 Sequence
< sal_Int16
> SAL_CALL
OComponent::methodShort(const Sequence
< sal_Int16
>& aSeq
) throw( RuntimeException
)
425 for( const auto& i
: aSeq
.getConstArray() ){
430 Sequence
< sal_uInt16
> SAL_CALL
OComponent::methodUShort(const Sequence
< sal_uInt16
>& aSeq
) throw( RuntimeException
)
433 for( const auto& i
: aSeq
.getConstArray() ){
438 Sequence
< sal_Int32
> SAL_CALL
OComponent::methodLong(const Sequence
< sal_Int32
>& aSeq
) throw( RuntimeException
)
441 for( const auto& i
: aSeq
.getConstArray() ){
446 Sequence
< sal_uInt32
> SAL_CALL
OComponent::methodULong(const Sequence
< sal_uInt32
>& aSeq
) throw( RuntimeException
)
449 for( const auto& i
: aSeq
.getConstArray() ){
454 Sequence
< OUString
> SAL_CALL
OComponent::methodString(const Sequence
< OUString
>& aSeq
) throw( RuntimeException
)
457 for( const auto& i
: aSeq
.getConstArray() ){
462 Sequence
< sal_Unicode
> SAL_CALL
OComponent::methodChar(const Sequence
< sal_Unicode
>& aSeq
) throw( RuntimeException
)
465 for( const auto& i
: aSeq
.getConstArray() ){
470 Sequence
< Any
> SAL_CALL
OComponent::methodAny(const Sequence
< Any
>& aSeq
) throw( RuntimeException
)
473 for( const auto& i
: aSeq
.getConstArray() ){
475 TypeClass _t
= _x
.getValueTypeClass();
476 if( _t
== TypeClass_STRING
)
477 OUString
s(* (rtl_uString
**)_x
.getValue());
483 Sequence
< Type
> SAL_CALL
OComponent::methodType(const Sequence
< Type
>& aSeq
) throw( RuntimeException
)
486 for( const auto& i
: aSeq
.getConstArray() ){
492 Sequence
< Reference
< XInterface
> > SAL_CALL
OComponent::methodXInterface( const Sequence
< Reference
< XInterface
> >& aSeq
) throw(RuntimeException
)
494 for( sal_Int32 i
= 0; i
< aSeq
.getLength(); i
++)
496 Reference
<XInterface
> xInt
= aSeq
[i
];
497 Reference
<XEventListener
> xList( xInt
, UNO_QUERY
);
499 xList
->disposing( EventObject());
504 Sequence
< Sequence
< sal_Int32
> > SAL_CALL
OComponent::methodSequence(const Sequence
< Sequence
< sal_Int32
> >& aSeq
) throw( RuntimeException
)
507 for( sal_Int16 i
= 0; i
< aSeq
.getLength(); i
++){
508 const Sequence
<sal_Int32
>& rseq2
= aSeq
.getConstArray()[i
];
509 for (sal_Int16 j
= 0; j
< rseq2
.getLength(); j
++){
510 value
= rseq2
.getConstArray()[j
];
515 Sequence
< Sequence
< Sequence
< sal_Int32
> > > SAL_CALL
OComponent::methodSequence2(const Sequence
< Sequence
< Sequence
< sal_Int32
> > >& aSeq
)
516 throw( RuntimeException
)
519 sal_Int32 len
= aSeq
.getLength();
520 for( sal_Int16 i
= 0; i
< aSeq
.getLength(); i
++){
521 const Sequence
< Sequence
<sal_Int32
> >& rseq2
= aSeq
.getConstArray()[i
];
522 len
= rseq2
.getLength();
524 for (sal_Int16 j
= 0; j
< rseq2
.getLength(); j
++){
525 const Sequence
<sal_Int32
> & rseq3
= rseq2
.getConstArray()[j
];
526 len
= rseq3
.getLength();
528 for (sal_Int16 k
= 0; k
< rseq3
.getLength(); k
++)
529 value
= rseq3
.getConstArray()[k
];
535 Sequence
< Reference
< XEventListener
> > SAL_CALL
OComponent::methodXEventListeners( const Sequence
< Reference
<XEventListener
> >& aSeq
) throw( RuntimeException
)
537 Reference
<XEventListener
> listener
;
538 for( int i
= 0; i
< aSeq
.getLength(); i
++)
542 listener
->disposing( EventObject() );
548 Sequence
< Sequence
<Reference
<XEventListener
> > > SAL_CALL
OComponent::methodXEventListenersMul( const Sequence
<Sequence
<Reference
<XEventListener
> > >& aSeq
) throw (RuntimeException
)
550 Reference
<XEventListener
> listener
;
551 for( int i
= 0; i
< aSeq
.getLength(); i
++)
553 Sequence
<Reference
<XEventListener
> > seqInner
= aSeq
[i
];
554 for( int j
= 0; j
< seqInner
.getLength(); j
++)
556 listener
= seqInner
[j
];
557 listener
->disposing( EventObject() );
564 Sequence
< sal_Int8
> SAL_CALL
OComponent::getAttrByte() throw( RuntimeException
)
568 void SAL_CALL
OComponent::setAttrByte(const Sequence
< sal_Int8
>& AttrByte_
) throw( RuntimeException
)
570 m_seqByte
= AttrByte_
;
572 Sequence
< float > SAL_CALL
OComponent::getAttrFloat() throw( RuntimeException
)
576 void SAL_CALL
OComponent::setAttrFloat(const Sequence
< float >& AttrFloat_
) throw( RuntimeException
)
578 m_seqFloat
= AttrFloat_
;
581 Sequence
< double > SAL_CALL
OComponent::getAttrDouble() throw( RuntimeException
)
585 void SAL_CALL
OComponent::setAttrDouble(const Sequence
< double >& AttrDouble_
) throw( RuntimeException
)
587 m_seqDouble
= AttrDouble_
;
590 Sequence
< sal_Bool
> SAL_CALL
OComponent::getAttrBool() throw( RuntimeException
)
595 void SAL_CALL
OComponent::setAttrBool(const Sequence
< sal_Bool
>& AttrBool_
) throw (RuntimeException
)
597 m_seqBool
= AttrBool_
;
600 Sequence
< sal_Int16
> SAL_CALL
OComponent::getAttrShort() throw( RuntimeException
)
604 void SAL_CALL
OComponent::setAttrShort(const Sequence
< sal_Int16
>& AttrShort_
) throw( RuntimeException
)
606 m_seqShort
= AttrShort_
;
609 Sequence
< sal_uInt16
> SAL_CALL
OComponent::getAttrUShort() throw( RuntimeException
)
613 void SAL_CALL
OComponent::setAttrUShort(const Sequence
< sal_uInt16
>& AttrUShort_
) throw( RuntimeException
)
615 m_seqUShort
= AttrUShort_
;
618 Sequence
< sal_Int32
> SAL_CALL
OComponent::getAttrLong() throw( RuntimeException
)
622 void SAL_CALL
OComponent::setAttrLong(const Sequence
< sal_Int32
>& AttrLong_
) throw( RuntimeException
)
624 m_seqLong
= AttrLong_
;
627 Sequence
< sal_uInt32
> SAL_CALL
OComponent::getAttrULong() throw( RuntimeException
)
631 void SAL_CALL
OComponent::setAttrULong(const Sequence
< sal_uInt32
>& AttrULong_
) throw( RuntimeException
)
633 m_seqULong
= AttrULong_
;
636 Sequence
< OUString
> SAL_CALL
OComponent::getAttrString() throw( RuntimeException
)
640 void SAL_CALL
OComponent::setAttrString(const Sequence
< OUString
>& AttrString_
) throw( RuntimeException
)
642 m_seqString
= AttrString_
;
645 Sequence
< sal_Unicode
> SAL_CALL
OComponent::getAttrChar() throw( RuntimeException
)
649 void SAL_CALL
OComponent::setAttrChar(const Sequence
< sal_Unicode
>& AttrChar_
) throw( RuntimeException
)
651 m_seqChar
= AttrChar_
;
654 Sequence
< Any
> SAL_CALL
OComponent::getAttrAny() throw( RuntimeException
)
658 void SAL_CALL
OComponent::setAttrAny(const Sequence
< Any
>& AttrAny_
) throw( RuntimeException
)
663 Sequence
< Type
> SAL_CALL
OComponent::getAttrType() throw( RuntimeException
)
668 void SAL_CALL
OComponent::setAttrType( const Sequence
< Type
>& AttrType_
) throw( RuntimeException
)
670 m_seqType
= AttrType_
;
674 Sequence
< Sequence
< sal_Int32
> > SAL_CALL
OComponent::getAttrSequence() throw( RuntimeException
)
678 void SAL_CALL
OComponent::setAttrSequence(const Sequence
< Sequence
< sal_Int32
> >& AttrSequence
) throw(RuntimeException
)
681 for( sal_Int32 i
=0; i
< AttrSequence
.getLength(); i
++)
683 Sequence
< sal_Int32
> seq
= AttrSequence
[i
];
685 for ( sal_Int32 j
=0; j
< seq
.getLength(); j
++)
691 m_seq1
= AttrSequence
;
694 Sequence
< Sequence
< Sequence
< sal_Int32
> > > SAL_CALL
OComponent::getAttrSequence2() throw( RuntimeException
)
698 void SAL_CALL
OComponent::setAttrSequence2(const Sequence
< Sequence
< Sequence
< sal_Int32
> > >& AttrSequence2_
)
699 throw( RuntimeException
)
701 m_seq2
= AttrSequence2_
;
704 Sequence
< Reference
< XInterface
> > SAL_CALL
OComponent::getAttrXInterface() throw(RuntimeException
)
706 return m_seqxInterface
;
708 void SAL_CALL
OComponent::setAttrXInterface( const Sequence
< Reference
< XInterface
> >& _attrxinterface
) throw(RuntimeException
)
710 m_seqxInterface
= _attrxinterface
;
714 ::sal_Int8 SAL_CALL
OComponent::getAByte() throw (RuntimeException
)
719 void SAL_CALL
OComponent::setAByte( ::sal_Int8 _abyte
) throw (RuntimeException
)
721 m_attr_int8
= _abyte
;
724 float SAL_CALL
OComponent::getAFloat() throw (RuntimeException
)
729 void SAL_CALL
OComponent::setAFloat( float _afloat
) throw (RuntimeException
)
731 m_attr_float
= _afloat
;
734 double SAL_CALL
OComponent::getADouble() throw (RuntimeException
)
736 return m_attr_double
;
739 void SAL_CALL
OComponent::setADouble( double _adouble
) throw (RuntimeException
)
741 m_attr_double
= _adouble
;
744 sal_Bool SAL_CALL
OComponent::getABool() throw (RuntimeException
)
749 void SAL_CALL
OComponent::setABool( sal_Bool _abool
) throw (RuntimeException
)
751 m_attr_bool
= _abool
;
754 ::sal_Int16 SAL_CALL
OComponent::getAShort() throw (RuntimeException
)
759 void SAL_CALL
OComponent::setAShort( ::sal_Int16 _ashort
) throw (RuntimeException
)
761 m_attr_int16
= _ashort
;
764 ::sal_uInt16 SAL_CALL
OComponent::getAUShort() throw (RuntimeException
)
766 return m_attr_uint16
;
769 void SAL_CALL
OComponent::setAUShort( ::sal_uInt16 _aushort
) throw (RuntimeException
)
771 m_attr_uint16
= _aushort
;
774 ::sal_Int32 SAL_CALL
OComponent::getALong() throw (RuntimeException
)
779 void SAL_CALL
OComponent::setALong( ::sal_Int32 _along
) throw (RuntimeException
)
781 m_attr_int32
= _along
;
784 ::sal_uInt32 SAL_CALL
OComponent::getAULong() throw (RuntimeException
)
786 return m_attr_uint32
;
789 void SAL_CALL
OComponent::setAULong( ::sal_uInt32 _aulong
) throw (RuntimeException
)
791 m_attr_uint32
= _aulong
;
794 OUString SAL_CALL
OComponent::getAString() throw (RuntimeException
)
796 return m_attr_string
;
799 void SAL_CALL
OComponent::setAString( const OUString
& _astring
) throw (RuntimeException
)
801 m_attr_string
= _astring
;
804 ::sal_Unicode SAL_CALL
OComponent::getAChar() throw (RuntimeException
)
809 void SAL_CALL
OComponent::setAChar( ::sal_Unicode _achar
) throw (RuntimeException
)
811 m_attr_char
= _achar
;
814 Any SAL_CALL
OComponent::getAAny() throw (RuntimeException
)
819 void SAL_CALL
OComponent::setAAny( const Any
& _aany
) throw (RuntimeException
)
824 Type SAL_CALL
OComponent::getAType() throw (RuntimeException
)
829 void SAL_CALL
OComponent::setAType( const Type
& _atype
) throw (RuntimeException
)
831 m_attr_type
= _atype
;
834 Reference
< XInterface
> SAL_CALL
OComponent::getAXInterface() throw (RuntimeException
)
836 return m_attr_xinterface
;
839 void SAL_CALL
OComponent::setAXInterface( const Reference
<XInterface
>& _axinterface
) throw (RuntimeException
)
841 m_attr_xinterface
= _axinterface
;
844 Reference
<XInvocation
> SAL_CALL
OComponent::getAXInvocation() throw (RuntimeException
)
846 return m_attr_xinvocation
;
849 void SAL_CALL
OComponent::setAXInvocation( const Reference
< XInvocation
>& _axinvocation
) throw (RuntimeException
)
851 m_attr_xinvocation
= _axinvocation
;
854 void SAL_CALL
OComponent::testout_methodByte(sal_Int8
& rOut
) throw( RuntimeException
)
858 void SAL_CALL
OComponent::testout_methodFloat(float& rOut
) throw( RuntimeException
)
862 void SAL_CALL
OComponent::testout_methodDouble(double& rOut
) throw( RuntimeException
)
867 void SAL_CALL
OComponent::testout_methodBool(sal_Bool
& rOut
) throw( RuntimeException
)
871 void SAL_CALL
OComponent::testout_methodShort(sal_Int16
& rOut
) throw( RuntimeException
)
875 void SAL_CALL
OComponent::testout_methodUShort(sal_uInt16
& rOut
) throw( RuntimeException
)
879 void SAL_CALL
OComponent::testout_methodLong(sal_Int32
& rOut
) throw( RuntimeException
)
883 void SAL_CALL
OComponent::testout_methodULong(sal_uInt32
& rOut
) throw( RuntimeException
)
887 void SAL_CALL
OComponent::testout_methodHyper(sal_Int64
& rOut
) throw( RuntimeException
)
892 void SAL_CALL
OComponent::testout_methodUHyper(sal_uInt64
& rOut
) throw( RuntimeException
)
897 void SAL_CALL
OComponent::testout_methodString(OUString
& rOut
) throw( RuntimeException
)
901 void SAL_CALL
OComponent::testout_methodChar(sal_Unicode
& rOut
) throw( RuntimeException
)
905 void SAL_CALL
OComponent::testout_methodAny(Any
& rOut
) throw( RuntimeException
)
910 void SAL_CALL
OComponent::testout_methodType(Type
& rOut
) throw( RuntimeException
)
915 void SAL_CALL
OComponent::testout_methodSequence(Sequence
< sal_Int32
>& rOut
) throw( RuntimeException
)
918 for( sal_Int16 i
= 0; i
< rOut
.getLength(); i
++) rOut
.getArray()[i
]= i
;
920 void SAL_CALL
OComponent::testout_methodSequence2(Sequence
< Sequence
< sal_Int32
> >& rOut
) throw( RuntimeException
)
923 for( sal_Int16 i
= 0; i
< rOut
.getLength(); i
++){
924 Sequence
<sal_Int32
>& rseq2
= rOut
.getArray()[i
];
926 for (sal_Int16 j
= 0; j
< rseq2
.getLength(); j
++){
927 rseq2
.getArray()[j
]= j
;
931 void SAL_CALL
OComponent::testout_methodMulParams1(sal_Int32
& rout1
, sal_Int32
& rout2
) throw( RuntimeException
)
936 void SAL_CALL
OComponent::testout_methodMulParams2(sal_Int32
& rout1
, sal_Int32
& rout2
, OUString
& rout3
) throw( RuntimeException
)
940 rout3
= L
" another string";
942 void SAL_CALL
OComponent::testout_methodMulParams3(const OUString
&, OUString
& sout
) throw( RuntimeException
)
946 void SAL_CALL
OComponent::testout_methodMulParams4( float in1
, float& out1
, sal_Int32 in2
, sal_Int32
& out2
, sal_Int32
) throw(RuntimeException
)
952 void SAL_CALL
OComponent::testout_methodXInterface( Reference
< XInterface
>& rOut
) throw(RuntimeException
)
957 // XTestInParameters ------------------------------------------------------------
958 sal_Int8 SAL_CALL
OComponent::in_methodByte( sal_Int8 rIn
) throw (RuntimeException
)
963 float SAL_CALL
OComponent::in_methodFloat( float rIn
) throw (RuntimeException
)
968 double SAL_CALL
OComponent::in_methodDouble( double rIn
) throw (RuntimeException
)
973 sal_Bool SAL_CALL
OComponent::in_methodBool( sal_Bool rIn
) throw (RuntimeException
)
978 sal_Int16 SAL_CALL
OComponent::in_methodShort( sal_Int16 rIn
) throw (RuntimeException
)
983 sal_uInt16 SAL_CALL
OComponent::in_methodUShort( sal_uInt16 rIn
) throw (RuntimeException
)
988 sal_Int32 SAL_CALL
OComponent::in_methodLong( sal_Int32 rIn
) throw (RuntimeException
)
993 sal_uInt32 SAL_CALL
OComponent::in_methodULong( sal_uInt32 rIn
) throw (RuntimeException
)
998 sal_Int64 SAL_CALL
OComponent::in_methodHyper( sal_Int64 rIn
) throw (RuntimeException
)
1004 sal_uInt64 SAL_CALL
OComponent::in_methodUHyper( sal_uInt64 rIn
) throw (RuntimeException
)
1010 OUString SAL_CALL
OComponent::in_methodString( const OUString
& rIn
) throw (RuntimeException
)
1015 sal_Unicode SAL_CALL
OComponent::in_methodChar( sal_Unicode rIn
) throw (RuntimeException
)
1020 Any SAL_CALL
OComponent::in_methodAny( const Any
& rIn
) throw (RuntimeException
)
1026 Type SAL_CALL
OComponent::in_methodType( const Type
& rIn
) throw (RuntimeException
)
1032 Reference
<XInvocation
> SAL_CALL
OComponent::in_methodInvocation( const Reference
< XInvocation
>& inv
)
1033 throw (RuntimeException
)
1035 //We expect the invocation results from a conversion of VBasicEventListener.VBEventListener
1036 //which implements XEventListener
1037 // extensions/test/ole/EventListenerSample
1038 EventObject
event( Reference
<XInterface
>(static_cast<XTestInParameters
*>(this),UNO_QUERY
));
1041 Sequence
<Any
> params( &anyParam
, 1);
1042 Sequence
<sal_Int16
> outIndex
;
1043 Sequence
<Any
> outParams
;
1045 inv
->invoke( OUString("disposing"),
1046 params
, outIndex
, outParams
);
1047 }catch(IllegalArgumentException
&) {
1049 catch(CannotConvertException
&){
1051 catch(InvocationTargetException
&) {
1055 Reference
<XInterface
> SAL_CALL
OComponent::in_methodXInterface( const Reference
<XInterface
>& rIn
) throw (RuntimeException
)
1061 SimpleStruct SAL_CALL
OComponent::in_methodStruct( const SimpleStruct
& aStruct
)
1062 throw (RuntimeException
)
1064 SimpleStruct
& s
= const_cast<SimpleStruct
&>(aStruct
);
1065 s
.message
= s
.message
+ OUString(
1066 "This string was set in OleTest");
1069 void SAL_CALL
OComponent::in_methodAll(
1070 sal_Int8
, float, double, sal_Bool
, sal_Int16
, sal_uInt16
,
1071 sal_Int32
, sal_uInt32
, const OUString
&, sal_Unicode
,
1072 const Any
&, const Type
&, const Reference
<XInvocation
>&) throw (RuntimeException
)
1076 // INOUT -----------------------------------------------------------------------------------
1077 void SAL_CALL
OComponent::testinout_methodByte(sal_Int8
& rOut
) throw( RuntimeException
)
1079 std::swap( m_int8
, rOut
);
1081 void SAL_CALL
OComponent::testinout_methodFloat(float& rOut
) throw( RuntimeException
)
1083 std::swap( m_float
, rOut
);
1085 void SAL_CALL
OComponent::testinout_methodDouble(double& rOut
) throw( RuntimeException
)
1087 std::swap( m_double
, rOut
);
1089 void SAL_CALL
OComponent::testinout_methodBool(sal_Bool
& rOut
) throw( RuntimeException
)
1091 std::swap( m_bool
, rOut
);
1093 void SAL_CALL
OComponent::testinout_methodShort(sal_Int16
& rOut
) throw( RuntimeException
)
1095 std::swap( m_int16
, rOut
);
1097 void SAL_CALL
OComponent::testinout_methodUShort(sal_uInt16
& rOut
) throw( RuntimeException
)
1099 std::swap( m_uint16
, rOut
);
1101 void SAL_CALL
OComponent::testinout_methodLong(sal_Int32
& rOut
) throw( RuntimeException
)
1103 std::swap( m_int32
, rOut
);
1105 void SAL_CALL
OComponent::testinout_methodULong(sal_uInt32
& rOut
) throw( RuntimeException
)
1107 std::swap( m_uint32
, rOut
);
1109 void SAL_CALL
OComponent::testinout_methodHyper(sal_Int64
& rOut
) throw( RuntimeException
)
1111 std::swap( m_int64
, rOut
);
1113 void SAL_CALL
OComponent::testinout_methodUHyper(sal_uInt64
& rOut
) throw( RuntimeException
)
1115 std::swap( m_uint64
, rOut
);
1117 void SAL_CALL
OComponent::testinout_methodString(OUString
& rOut
) throw( RuntimeException
)
1119 std::swap( m_string
, rOut
);
1121 void SAL_CALL
OComponent::testinout_methodChar(sal_Unicode
& rOut
) throw( RuntimeException
)
1123 std::swap( m_char
, rOut
);
1125 void SAL_CALL
OComponent::testinout_methodAny(Any
& rOut
) throw( RuntimeException
)
1127 std::swap( m_any
, rOut
);
1129 void SAL_CALL
OComponent::testinout_methodType(Type
& rOut
) throw( RuntimeException
)
1131 std::swap( m_type
, rOut
);
1134 void SAL_CALL
OComponent::testinout_methodSequence(Sequence
< sal_Int32
>& rOut
) throw( RuntimeException
)
1137 sal_Int32
* arr
= rOut
.getArray();
1138 for ( sal_Int32 i
=0; i
< rOut
.getLength(); i
++)
1140 rOut
.getArray()[i
] += 1;
1143 void SAL_CALL
OComponent::testinout_methodSequence2(Sequence
< Sequence
< sal_Int32
> >& rOut
) throw( RuntimeException
)
1145 for( sal_Int32 i
=0; i
< rOut
.getLength(); i
++)
1147 Sequence
< sal_Int32
>& seq
= rOut
.getArray()[i
];
1149 for ( sal_Int32 j
=0; j
< seq
.getLength(); j
++)
1151 seq
.getArray()[j
] += seq
.getArray()[j
];
1156 // The parameter should implement XInvocation and a Property "value"
1157 void SAL_CALL
OComponent::testinout_methodXInterface( Reference
< XInvocation
>& rOut
) throw(RuntimeException
)
1160 any
= rOut
->getValue( OUString( L
"value"));
1163 OUString
string(L
"out");
1165 rOut
->setValue( OUString(L
"value"), any
);
1167 any
= rOut
->getValue( OUString( L
"value"));
1172 void SAL_CALL
OComponent::testinout_methodXInterface2( Reference
< XInterface
> & rOut
) throw( RuntimeException
)
1174 Reference
<XInterface
> tmp
= rOut
;
1175 rOut
= m_xinterface
;
1178 Any SAL_CALL
OComponent::methodAnyTest1(const Any
& rIn
) throw( RuntimeException
)
1182 Any SAL_CALL
OComponent::getAttrAny2() throw( RuntimeException
)
1186 void SAL_CALL
OComponent::setAttrAny2(const Any
& AttrAny2_
) throw( RuntimeException
)
1192 // XTestStruct =======================================================================================
1194 void SAL_CALL
OComponent::methodStruct(const Property
& aProp
) throw( RuntimeException
)
1198 sprintf( buff
,"Property::Attribute : %d \n Property::Handle : %d \n Property::Name : %S",
1199 aProp
.Attributes
, aProp
.Handle
, (const sal_Unicode
*)aProp
.Name
);
1200 MessageBox( NULL
, A2T(buff
), _T("OleTest: methodStruct"), MB_OK
);
1203 Property SAL_CALL
OComponent::retMethodStruct() throw( RuntimeException
)
1205 Property
a(L
"OleTest_Property", 255, cppu::UnoType
<XInterface
>::get(), PropertyAttribute::MAYBEVOID
|
1206 PropertyAttribute::BOUND
| PropertyAttribute::CONSTRAINED
|
1207 PropertyAttribute::TRANSIENT
| PropertyAttribute::READONLY
|
1208 PropertyAttribute::MAYBEAMBIGUOUS
| PropertyAttribute::MAYBEDEFAULT
);
1212 Property SAL_CALL
OComponent::getAttrStruct() throw( RuntimeException
)
1214 Property
a(L
"OleTest_Property", 255, cppu::UnoType
<XInterface
>::get(), PropertyAttribute::MAYBEVOID
|
1215 PropertyAttribute::BOUND
| PropertyAttribute::CONSTRAINED
|
1216 PropertyAttribute::TRANSIENT
| PropertyAttribute::READONLY
|
1217 PropertyAttribute::MAYBEAMBIGUOUS
| PropertyAttribute::MAYBEDEFAULT
);
1222 void SAL_CALL
OComponent::setAttrStruct(const Property
& AttrStruct_
) throw( RuntimeException
)
1226 sprintf( buff
,"Property::Attribute : %d \n Property::Handle : %d \n Property::Name : %S",
1227 AttrStruct_
.Attributes
, AttrStruct_
.Handle
, (const sal_Unicode
*)AttrStruct_
.Name
);
1228 // MessageBox( NULL, A2T(buff), _T("OleTest: setAttrStruct"), MB_OK);
1231 Property SAL_CALL
OComponent::methodStruct2( const Property
& aProp
) throw (RuntimeException
)
1236 // XTestOther ==================================================================================
1237 void SAL_CALL
OComponent::other_methodAnyIn(const Any
& ) throw( RuntimeException
)
1240 void SAL_CALL
OComponent::other_methodAnyOut(Any
& rAny
) throw( RuntimeException
)
1242 rAny
<<= OUString(L
"Ein Any");
1245 Any SAL_CALL
OComponent::other_methodAnyRet() throw(RuntimeException
)
1248 a
<<= OUString(L
"Ein Any");
1251 void SAL_CALL
OComponent::in_float( float val
) throw ( RuntimeException
)
1255 sprintf( buff
, "parameter : %f", val
);
1256 MessageBox( NULL
, A2T(buff
), _T("OleTest"), MB_OK
);
1258 Any SAL_CALL
OComponent::other_methodAny( const Any
& rAny
, const OUString
& typeInAny
)
1259 throw (RuntimeException
)
1262 typelib_TypeDescription
* pDesc
= NULL
;
1263 typelib_typedescription_getByName( &pDesc
, typeInAny
.pData
);
1266 expectedType
= Type( pDesc
->pWeakRef
);
1267 typelib_typedescription_release( pDesc
);
1269 if (rAny
.getValueType() != expectedType
)
1270 throw RuntimeException();
1275 // XTestInterfaces -------------------------------------------------------------------------------------
1276 void SAL_CALL
OComponent::testInterface( const Reference
< XCallback
>& xCallback
, sal_Int32 mode
) throw(RuntimeException
)
1283 Reference
<XSimple
> xSimple
;
1284 SimpleStruct aSimpleStruct
;
1285 SimpleEnum aSimpleEnum
;
1286 Sequence
<Any
> seqAny
;
1287 Sequence
< sal_Int8
> seqByte
;
1300 xCallback
->func1(); break;
1302 xSimple
= xCallback
->returnInterface();
1303 xSimple
->func(L
"XCallback::returnInterface");
1308 xCallback
->outInterface( xSimple
);
1309 sprintf( buff
, "XCallback::outInterface, value: %x", xSimple
.get());
1310 MessageBox( NULL
, A2T(buff
), _T("OleTest out parameter"), MB_OK
);
1311 xSimple
->func(L
"XCallback::outInterface works");
1314 xCallback
->outStruct( aSimpleStruct
);
1315 sprintf( buff
,"XCallback::outStruct, SimpleStruct::message: %s", OLE2A( aSimpleStruct
.message
));
1316 MessageBox( NULL
, A2T(buff
), _T("OleTest out parameter"), MB_OK
);
1319 xCallback
->outEnum( aSimpleEnum
);
1320 sprintf( buff
,"XCallback::outEnum, SimpleEnum: %d", aSimpleEnum
);
1321 MessageBox( NULL
, A2T(buff
), _T("OleTest out parameter"), MB_OK
);
1324 xCallback
->outSeqAny( seqAny
);
1325 sprintf( buff
,"XCallback::outSeqAny, length: %d )", seqAny
.getLength());
1326 MessageBox( NULL
, A2T(buff
), _T("OleTest out parameter"), MB_OK
);
1327 for( i
=0; i
< seqAny
.getLength(); i
++)
1330 if( any
.getValueTypeClass() == TypeClass_STRING
)
1333 OutputDebugStringW( aString
);
1339 xCallback
->outAny( outAny
);
1340 if( outAny
.getValueTypeClass() == TypeClass_STRING
)
1342 sprintf( buff
,"XCallback::outAny, Any : %s", W2A( aString
));
1343 MessageBox( NULL
, A2T(buff
), _T("OleTest out parameter"), MB_OK
);
1346 xCallback
->outBool( aBool
);
1347 sprintf( buff
,"XCallback::outBool, value: %d", aBool
);
1348 MessageBox( NULL
, A2T(buff
), _T("OleTest out parameter"), MB_OK
);
1351 xCallback
->outChar( aChar
);
1352 sprintf( buff
,"XCallback::outChar, value: %C", aChar
);
1353 MessageBox( NULL
, A2T(buff
), _T("OleTest out parameter"), MB_OK
);
1356 xCallback
->outString( aString
);
1357 sprintf( buff
,"XCallback::outString, value: %s", W2A( aString
));
1358 MessageBox( NULL
, A2T(buff
), _T("OleTest out parameter"), MB_OK
);
1361 xCallback
->outFloat( aFloat
);
1362 sprintf( buff
,"XCallback::outFloat, value: %f", aFloat
);
1363 MessageBox( NULL
, A2T(buff
), _T("OleTest out parameter"), MB_OK
);
1366 xCallback
->outDouble( aDouble
);
1367 sprintf( buff
,"XCallback::outDouble, value: %f", aDouble
);
1368 MessageBox( NULL
, A2T(buff
), _T("OleTest out parameter"), MB_OK
);
1371 xCallback
->outByte( aByte
);
1372 sprintf( buff
,"XCallback::outByte, value: %d", aByte
);
1373 MessageBox( NULL
, A2T(buff
), _T("OleTest out parameter"), MB_OK
);
1376 xCallback
->outShort( aShort
);
1377 sprintf( buff
,"XCallback::outShort, value: %d", aShort
);
1378 MessageBox( NULL
, A2T(buff
), _T("OleTest out parameter"), MB_OK
);
1381 xCallback
->outLong( aLong
);
1382 sprintf( buff
,"XCallback::outLong, value: %d", aLong
);
1383 MessageBox( NULL
, A2T(buff
), _T("OleTest out parameter"), MB_OK
);
1391 xCallback
->outValuesMixed( 1111, outLong
, OUString( L
"in string") );
1393 sprintf( buff
, "oletest.testInterface: outValue: %d", outLong
);
1394 MessageBox( NULL
, A2T(buff
), _T("OleTest"), MB_OK
);
1400 Reference
< XSimple
> xSimple
;
1401 SimpleStruct aSimpleStruct
;
1402 SimpleEnum aSimpleEnum
;
1403 Sequence
<Any
> seqAny
;
1413 xCallback
->outValuesAll( xSimple
, aSimpleStruct
, aSimpleEnum
, seqAny
, aAny
, aBool
,
1419 MessageBox( NULL
, _T("XCallback::outValuesAll returned"), _T("OleTest::testInterface"), MB_OK
);
1425 xCallback
->outSeqByte( seqByte
);
1426 sprintf( buff
,"XCallback::outSeqAny, length: %d )", seqAny
.getLength());
1427 MessageBox( NULL
, A2T(buff
), _T("OleTest out parameter"), MB_OK
);
1428 for( i
=0; i
< seqAny
.getLength(); i
++)
1431 if( any
.getValueTypeClass() == TypeClass_STRING
)
1434 OutputDebugStringW( aString
);
1439 // ############################################################################
1441 // ############################################################################
1444 Reference
<XSimple
> xSimple
= static_cast<XSimple
*>(this);
1445 xCallback
->inoutInterface( xSimple
);
1446 xSimple
->func(L
"XSimple called from OleTest");
1451 Reference
<XIdlReflection
> xRefl( theCoreReflection::get(comphelper::getComponentContext(m_rFactory
)) );
1452 Reference
<XIdlClass
> xClass
= xRefl
->forName(L
"oletest.SimpleStruct");
1455 xClass
->createObject( any
);
1457 if( any
.getValueTypeClass() == TypeClass_STRUCT
)
1459 SimpleStruct
* pStruct
= ( SimpleStruct
*) any
.getValue();
1460 pStruct
->message
= "This struct was created in OleTest";
1462 SimpleStruct aStruct
;
1464 xCallback
->inoutStruct( aStruct
);
1465 // a Struct should now contain a different message
1466 MessageBox( NULL
, W2T(aStruct
.message
), _T("OleTest in out parameter"), MB_OK
);
1473 SimpleEnum aEnum
= SimpleEnum_B
;
1474 xCallback
->inoutEnum( aEnum
);
1476 sprintf( buff
, "Enum: %d", aEnum
);
1477 MessageBox( NULL
, A2T(buff
), _T("OleTest in out parameter"), MB_OK
);
1483 arAny
[0] <<= OUString( L
"string 0");
1484 arAny
[1] <<= OUString( L
"string 1");
1485 arAny
[2] <<= OUString( L
"string 2");
1487 Sequence
< Any
>seqAny( arAny
, 3);
1488 xCallback
->inoutSeqAny( seqAny
);
1490 sprintf( buff
, "Sequence length: %d", seqAny
.getLength());
1491 MessageBox( NULL
,A2T(buff
) , _T("OleTest in out parameter"), MB_OK
);
1493 for( int i
=0; i
< seqAny
.getLength(); i
++)
1497 if(any
.getValueTypeClass() == TypeClass_STRING
)
1510 OUString
s(L
" OleTest");
1512 xCallback
->inoutAny(any
);
1513 if( any
.getValueTypeClass() == TypeClass_STRING
)
1515 OUString s
= *( rtl_uString
**) any
.getValue();
1516 MessageBox( NULL
, W2T( s
), _T("OleTest: inout value any"), MB_OK
);
1522 sal_Bool b
= sal_True
;
1523 xCallback
->inoutBool( b
);
1525 sprintf( buff
, "out value bool: %d", b
);
1526 MessageBox( NULL
, A2T( buff
), _T("OleTest in out parameter"), MB_OK
);
1531 sal_Unicode uc
= L
'A';
1532 xCallback
->inoutChar( uc
);
1534 sprintf( buff
, "out value sal_Unicode: %C", uc
);
1535 MessageBox( NULL
, A2T( buff
), _T("OleTest in out parameter"), MB_OK
);
1540 OUString
s(L
"OleTest");
1541 xCallback
->inoutString( s
);
1543 sprintf( buff
, "out value string: %S", s
.getStr());
1544 MessageBox( NULL
, A2T( buff
), _T("OleTest in out parameter"), MB_OK
);
1550 xCallback
->inoutFloat(f
);
1552 sprintf( buff
, "out value float: %f", f
);
1553 MessageBox( NULL
, A2T( buff
), _T("OleTest in out parameter"), MB_OK
);
1559 xCallback
->inoutDouble( f
);
1561 sprintf( buff
, "out value double: %g", f
);
1562 MessageBox( NULL
, A2T( buff
), _T("OleTest in out parameter"), MB_OK
);
1567 sal_Int8 aByte
= 0xf;
1568 xCallback
->inoutByte( aByte
);
1570 sprintf( buff
, "out value sal_Int8: %d", aByte
);
1571 MessageBox( NULL
, A2T( buff
), _T("OleTest in out parameter"), MB_OK
);
1576 sal_Int16 aShort
= 0xff;
1577 xCallback
->inoutShort( aShort
);
1579 sprintf( buff
, "out value sal_Int16: %d", aShort
);
1580 MessageBox( NULL
, A2T( buff
), _T("OleTest in out parameter"), MB_OK
);
1585 sal_Int32 aLong
= 0xfffe;
1586 xCallback
->inoutLong( aLong
);
1588 sprintf( buff
, "out value sal_Int32: %d", aLong
);
1589 MessageBox( NULL
, A2T( buff
), _T("OleTest in out parameter"), MB_OK
);
1594 Reference
<XSimple
> aXSimple
= static_cast<XSimple
*>(this);
1596 SimpleStruct aStruct
;
1597 Reference
<XIdlReflection
> xRefl( m_rFactory
->createInstance(L
"com.sun.star.reflection.CoreReflection"), UNO_QUERY
);
1600 Reference
<XIdlClass
> xClass
= xRefl
->forName(L
"oletest.SimpleStruct");
1603 xClass
->createObject( any
);
1605 if( any
.getValueTypeClass() == TypeClass_STRUCT
)
1607 SimpleStruct
* pStruct
= ( SimpleStruct
*) any
.getValue();
1608 pStruct
->message
= "This struct was created in OleTest";
1613 SimpleEnum aEnum
= SimpleEnum_B
;
1615 Sequence
< Any
> aSeq
;
1617 arAny
[0] <<= OUString( L
"string 0");
1618 arAny
[1] <<= OUString( L
"string 1");
1619 arAny
[2] <<= OUString( L
"string 2");
1620 aSeq
= Sequence
< Any
>( arAny
, 3);
1623 OUString
s(L
" OleTest");
1626 sal_Bool aBool
= sal_True
;
1627 sal_Unicode aChar
= L
'A';
1628 OUString
aString( L
"OleTest");
1630 double aDouble
= 3.145;
1631 sal_Int8 aByte
= 0xf;
1632 sal_Int16 aShort
= 0xff;
1633 sal_Int32 aLong
= 0xffe;
1635 xCallback
->inoutValuesAll( aXSimple
, aStruct
, aEnum
, aSeq
,
1636 aAny
, aBool
, aChar
, aString
, aFloat
, aDouble
,
1637 aByte
, aShort
, aLong
);
1639 aXSimple
->func(L
"XSimple called from OleTest");
1640 MessageBox( NULL
, W2T(aStruct
.message
), _T("OleTest"), MB_OK
);
1642 for( int i
=0; i
< aSeq
.getLength(); i
++)
1646 if(any
.getValueTypeClass() == TypeClass_STRING
)
1656 // ############################################################################
1658 // ############################################################################
1662 xCallback
->inValues( L
'a', 0xffffL
, OUString(L
" a string from OleTest"));
1666 sal_Int8 arbyte
[3]= { 1,2,3};
1667 Sequence
< sal_Int8
> seq( arbyte
, 3);
1668 xCallback
->inSeqByte( seq
);
1673 const int LISTENERS
= 3;
1674 Reference
<XEventListener
> arListeners
[LISTENERS
];
1675 EventObject arEvents
[LISTENERS
];
1677 for( int i
= 0; i
< LISTENERS
; i
++)
1679 Reference
<XInterface
> aList
= static_cast<XWeak
*>( new EventListener());
1680 arListeners
[i
].set( aList
, UNO_QUERY
);
1683 xCallback
->inSeqXEventListener(Sequence
<Reference
<XEventListener
> > (arListeners
, LISTENERS
),
1684 Sequence
<EventObject
>(arEvents
, LISTENERS
));
1688 // ############################################################################
1689 // Call a COM object that has not been passed as parameter to a UNO component and
1690 // hence no type information is available in the COM wrapper
1691 // ############################################################################
1694 Reference
<XInterface
> xIntFact
= m_rFactory
->createInstance(L
"com.sun.star.bridge.oleautomation.Factory");
1696 Reference
<XMultiServiceFactory
> oleFact(xIntFact
, UNO_QUERY
);
1698 Reference
<XInterface
> xIntCallback
= oleFact
->createInstance(L
"XCallback_Impl.Callback");
1699 Reference
<XInvocation
> xInv( xIntCallback
, UNO_QUERY
);
1700 Sequence
<sal_Int16
> seqIndices
;
1701 Sequence
<Any
> seqOutParams
;
1702 xInv
->invoke( OUString( L
"outValuesAll"), Sequence
<Any
>(), seqIndices
, seqOutParams
);
1704 if( seqOutParams
.getLength() == 12)
1706 Reference
<XSimple
> xSimple
= *(XSimple
**)seqOutParams
[0].getValue();
1707 xSimple
->func( L
"Call from OleTest on XSimple");
1708 SimpleStruct aStruct
;
1709 seqOutParams
[1] >>= aStruct
;
1710 SimpleEnum aEnum
= *(SimpleEnum
*)seqOutParams
[2].getValue();
1712 Sequence
<Any
> seqAny
;
1713 seqOutParams
[3] >>= seqAny
;
1714 for( int i
=0; i
<seqAny
.getLength(); i
++)
1720 Any _any
= *(Any
*)seqOutParams
[4].getValue();
1721 sal_Bool _bool
= *(sal_Bool
*)seqOutParams
[5].getValue();
1722 sal_Unicode _char
= *( sal_Unicode
*) seqOutParams
[6].getValue();
1723 OUString _str
= *( rtl_uString
**)seqOutParams
[7].getValue();
1725 float _f
= *( float*)seqOutParams
[8].getValue();
1726 double _d
= *( double*) seqOutParams
[9].getValue();
1727 sal_Int8 _byte
= *( sal_Int8
*) seqOutParams
[10].getValue();
1728 sal_Int16 _short
= *( sal_Int16
*) seqOutParams
[11].getValue();
1730 sal_Int32 _long
= *( sal_Int32
*) seqOutParams
[12].getValue();
1736 // in / out parameter
1738 Reference
<XInterface
> xIntFact
= m_rFactory
->createInstance(L
"com.sun.star.bridge.oleautomation.Factory");
1740 Reference
<XMultiServiceFactory
> oleFact(xIntFact
, UNO_QUERY
);
1742 Reference
<XInterface
> xIntCallback
= oleFact
->createInstance(L
"XCallback_Impl.Callback");
1743 Reference
<XInvocation
> xInv( xIntCallback
, UNO_QUERY
);
1744 Sequence
<sal_Int16
> seqIndices
;
1745 Sequence
<Any
> seqOutParams
;
1749 Reference
<XSimple
> xSimple
= static_cast<XSimple
*>( this);
1751 arAny
[0] <<= xSimple
;
1752 SimpleStruct aStruct
;
1753 Reference
<XIdlReflection
> xRefl( m_rFactory
->createInstance(L
"com.sun.star.reflection.CoreReflection"), UNO_QUERY
);
1756 Reference
<XIdlClass
> xClass
= xRefl
->forName(L
"oletest.SimpleStruct");
1759 xClass
->createObject( any
);
1761 if( any
.getValueTypeClass() == TypeClass_STRUCT
)
1763 SimpleStruct
* pStruct
= ( SimpleStruct
*) any
.getValue();
1764 pStruct
->message
= "This struct was created in OleTest";
1768 arAny
[1] <<= aStruct
;
1769 arAny
[2] <<= SimpleEnum_C
;
1772 arSeqAny
[0] <<= OUString( L
"string 0");
1773 arSeqAny
[1] <<= OUString( L
"string 1");
1774 arSeqAny
[2] <<= OUString( L
"string 2");
1776 arAny
[3] <<= Sequence
< Any
>( arAny
, 3);
1778 OUString
str(L
" Ein Any param");
1780 arAny
[5] <<= sal_False
;
1782 OUString
stringParam(L
" a string parameter");
1783 arAny
[7] <<= stringParam
;
1784 float _float
= 3.14f
;
1785 arAny
[8] <<= _float
;
1786 double _double
= 3.145;
1787 arAny
[9] <<= _double
;
1789 arAny
[10] <<= _byte
;
1790 sal_Int16 _short
= -1;
1791 arAny
[11] <<= _short
;
1792 sal_Int32 _long
= -1;
1793 arAny
[12] <<= _long
;
1795 Sequence
<Any
> params( arAny
, 13);
1797 xInv
->invoke( OUString( L
"inoutValuesAll"), params
, seqIndices
, seqOutParams
);
1799 if( seqOutParams
.getLength() == 12)
1801 Reference
<XSimple
> xSimple
= *(XSimple
**)seqOutParams
[0].getValue();
1802 xSimple
->func( L
"Call from OleTest on XSimple");
1803 SimpleStruct aStruct
;
1804 seqOutParams
[1] >>= aStruct
;
1805 SimpleEnum aEnum
= *(SimpleEnum
*)seqOutParams
[2].getValue();
1807 Sequence
<Any
> seqAny
;
1808 seqOutParams
[3] >>= seqAny
;
1809 for( int i
=0; i
<seqAny
.getLength(); i
++)
1815 Any _any
= *(Any
*)seqOutParams
[4].getValue();
1816 sal_Bool _bool
= *(sal_Bool
*)seqOutParams
[5].getValue();
1817 sal_Unicode _char
= *( sal_Unicode
*) seqOutParams
[6].getValue();
1818 OUString _str
= *( rtl_uString
**)seqOutParams
[7].getValue();
1820 float _f
= *( float*)seqOutParams
[8].getValue();
1821 double _d
= *( double*) seqOutParams
[9].getValue();
1822 sal_Int8 _byte
= *( sal_Int8
*) seqOutParams
[10].getValue();
1823 sal_Int16 _short
= *( sal_Int16
*) seqOutParams
[11].getValue();
1825 sal_Int32 _long
= *( sal_Int32
*) seqOutParams
[12].getValue();
1832 Reference
<XInterface
> xIntFact
= m_rFactory
->createInstance(
1833 L
"com.sun.star.bridge.oleautomation.Factory");
1835 Reference
<XMultiServiceFactory
> oleFact(xIntFact
, UNO_QUERY
);
1837 Reference
<XInterface
> xIntCallback
= oleFact
->createInstance(L
"XCallback_Impl.Callback");
1838 Reference
<XInvocation
> xInv( xIntCallback
, UNO_QUERY
);
1839 Sequence
<sal_Int16
> seqIndices
;
1840 Sequence
<Any
> seqOutParams
;
1843 sal_Unicode aChar
=L
'a';
1845 sal_Int32 aLong
= 0xffffffff;
1847 OUString
aString(L
" a string parameter");
1848 arAny
[2] <<= aString
;
1850 xInv
->invoke( OUString( L
"inValues"), Sequence
<Any
>(arAny
,3), seqIndices
, seqOutParams
);
1854 // ############################################################################
1856 // ############################################################################
1859 Reference
<XSimple
> simple
= xCallback
->getsimple();
1860 simple
->func(L
"OleTest calls on XSimple");
1868 void SAL_CALL
OComponent::setObject( const Reference
< XInterface
>& val
) throw (RuntimeException
)
1870 m_xIntIdentity
= val
;
1873 sal_Bool SAL_CALL
OComponent::isSame( const Reference
< XInterface
>& val
) throw (RuntimeException
)
1875 if( m_xIntIdentity
== val
)
1881 Reference
< XInterface
> SAL_CALL
OComponent::getThis( ) throw (RuntimeException
)
1883 Reference
<XInterface
> ret(static_cast<XIdentity
*>(this), UNO_QUERY
);
1887 void SAL_CALL
EventListener::disposing( const css::lang::EventObject
& ) throw (RuntimeException
)
1892 // XSimple --------------------------------------------------------------------------
1893 void SAL_CALL
OComponent::func( const OUString
&message
)throw(css::uno::RuntimeException
)
1897 MessageBox( NULL
, W2T( message
.getStr()), _T("OleTest: XSimple::func"), MB_OK
);
1899 // XSimple --------------------------------------------------------------------------
1900 OUString SAL_CALL
OComponent::getName()throw(css::uno::RuntimeException
)
1904 void SAL_CALL
OComponent::testInterface2( const Reference
< XSimple
>& xSimple
, sal_Int32 mode
) throw(RuntimeException
)
1910 xSimple
->func( L
"OleTest is calling XSimple");
1911 Reference
<XSimple2
> xSimple2( xSimple
, UNO_QUERY
);
1913 xSimple2
->func2( L
"OleTest is calling XSimple2");
1914 Reference
<XSimple3
> xSimple3( xSimple
, UNO_QUERY
);
1916 xSimple3
->func3( L
"OleTest is calling XSimple3");
1923 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */