1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: testobjects.cs,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
32 using System
.Reflection
;
33 using System
.Diagnostics
;
36 using unoidl
.test
.cliure
.climaker
;
37 //using unoidl.com.sun.star.uno;
38 using ucss
=unoidl
.com
.sun
.star
;
41 /* To create this component, the class context (in this assembly) can be used. When
42 createInstanceWithArgumentsAndContext is called on the service manager
43 then the arguments are passed into the ctor.
45 class Component
:uno
.util
.WeakComponentBase
, XTest
47 public Component(ucss
.uno
.XComponentContext ctx
) {
48 m_args
= new Any
[] {new Any(typeof(ucss.uno.XComponentContext), ctx)}
;
53 public Component(ucss
.uno
.XComponentContext ctx
, uno
.Any
[] args
) {
54 m_args
= new Any
[args
.Length
+ 1];
55 m_args
[0] = new Any(typeof(ucss
.uno
.XComponentContext
), ctx
);
56 for (int i
= 0; i
< args
.Length
; i
++) {
57 m_args
[i
+1] = args
[i
];
103 public void testOneway()
107 public void testExceptions()
111 public PolyStruct
testPolyStruct(PolyStruct val
)
116 public void inParameters(bool aBool
, byte aByte
,
117 short aShort
, ushort aUShort
,
118 int aInt
, uint aUInt
,
119 long aLong
, ulong aULong
,
120 float aFloat
, double aDouble
,
121 char aChar
, string aString
,
122 Type aType
, uno
.Any aAny
,
123 Enum2 aEnum
, Struct1 aStruct
,
125 unoidl
.com
.sun
.star
.lang
.XComponent aXComponent
,
144 m_XInterface
= aXInterface
;
145 m_XComponent
= aXComponent
;
150 public void outParameters(out bool aBool
, out byte aByte
,
151 out short aShort
, out ushort aUShort
,
152 out int aInt
, out uint aUInt
,
153 out long aLong
, out ulong aULong
,
154 out float aFloat
, out double aDouble
,
155 out char aChar
, out string aString
,
156 out Type aType
, out uno
.Any aAny
,
157 out Enum2 aEnum
, out Struct1 aStruct
,
158 out object aXInterface
,
159 out unoidl
.com
.sun
.star
.lang
.XComponent aXComponent
,
178 aXInterface
= m_XInterface
;
179 aXComponent
= m_XComponent
;
184 //returns the values which have been set in a previous call
185 //to this function or inParameters.
186 public void inoutParameters(ref bool aBool
, ref byte aByte
,
187 ref short aShort
, ref ushort aUShort
,
188 ref int aInt
, ref uint aUInt
,
189 ref long aLong
, ref ulong aULong
,
190 ref float aFloat
, ref double aDouble
,
191 ref char aChar
, ref string aString
,
192 ref Type aType
, ref uno
.Any aAny
,
193 ref Enum2 aEnum
, ref Struct1 aStruct
,
194 ref object aXInterface
,
195 ref unoidl
.com
.sun
.star
.lang
.XComponent aXComponent
,
206 short _short
= aShort
;
210 ushort _ushort
= aUShort
;
226 ulong _ulong
= aULong
;
242 string _string
= aString
;
254 Enum2 _enum2
= aEnum
;
258 Struct1 _struct1
= aStruct
;
260 m_Struct1
= _struct1
;
262 object _obj
= aXInterface
;
263 aXInterface
= m_XInterface
;
266 ucss
.lang
.XComponent _xcomp
= aXComponent
;
267 aXComponent
= m_XComponent
;
268 m_XComponent
= _xcomp
;
270 bool[] _seq
= seqBool
;
275 public bool retBoolean()
280 public byte retByte()
285 public short retShort()
290 public ushort retUShort()
300 public uint retULong()
305 public long retHyper()
310 public ulong retUHyper()
315 public float retFloat()
320 public double retDouble()
325 public char retChar()
330 public string retString()
335 public Type
retType()
340 public uno
.Any
retAny()
345 public Enum2
retEnum()
349 public Struct1
retStruct1()
354 public object retXInterface()
359 public unoidl
.com
.sun
.star
.lang
.XComponent
retXComponent()
364 public bool[] retSeqBool()
369 public bool attrBoolean
389 public short attrShort
399 public ushort attrUShort
419 public uint attrULong
429 public long attrHyper
439 public ulong attrUHyper
449 public float attrFloat
459 public double attrDouble
479 public string attrString
509 public Enum2 attrEnum2
519 public Struct1 attrStruct1
529 public object attrXInterface
535 m_XInterface
= value;
539 public ucss
.lang
.XComponent attrXComponent
545 m_XComponent
= value;
549 public bool[] attrSeqBoolean
586 unoidl
.com
.sun
.star
.lang
.XComponent m_XComponent
;