update dev300-m58
[ooovba.git] / cli_ure / qa / climaker / testobjects.cs
blob91c7d953c0885491c91186f0d3c7bbce8c9c8dbd
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: testobjects.cs,v $
10 * $Revision: 1.4 $
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 ************************************************************************/
31 using System;
32 using System.Reflection;
33 using System.Diagnostics;
34 using uno;
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)};
49 m_A2 = 0;
50 m_A4 = 0;
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];
61 public Any[] Args {
62 get
64 return m_args;
68 // XTest
69 public int A1 {
70 get {
71 return m_A1;
73 set {
74 m_A1 = value;
78 public int A2 {
79 get {
80 return m_A2;
84 public int A3 {
85 get {
86 return m_A3;
88 set {
89 m_A3 = value;
93 public int A4 {
94 get {
95 return m_A4;
99 public bool test() {
100 return true;
103 public void testOneway()
107 public void testExceptions()
111 public PolyStruct testPolyStruct(PolyStruct val)
113 return 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,
124 object aXInterface,
125 unoidl.com.sun.star.lang.XComponent aXComponent,
126 bool[] seqBool)
128 m_Bool = aBool;
129 m_Byte = aByte;
130 m_Short = aShort;
131 m_UShort = aUShort;
132 m_Int = aInt;
133 m_UInt = aUInt;
134 m_Long = aLong;
135 m_ULong = aULong;
136 m_Float = aFloat;
137 m_Double = aDouble;
138 m_Char = aChar;
139 m_String = aString;
140 m_Type = aType;
141 m_Any = aAny;
142 m_Enum2 = aEnum;
143 m_Struct1 = aStruct;
144 m_XInterface = aXInterface;
145 m_XComponent = aXComponent;
146 m_seqBool = seqBool;
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,
160 out bool[] seqBool)
162 aBool = m_Bool;
163 aByte = m_Byte;
164 aShort = m_Short;
165 aUShort = m_UShort;
166 aInt = m_Int;
167 aUInt = m_UInt;
168 aLong = m_Long;
169 aULong = m_ULong;
170 aFloat = m_Float;
171 aDouble = m_Double;
172 aChar = m_Char;
173 aString = m_String;
174 aType = m_Type;
175 aAny = m_Any;
176 aEnum = m_Enum2;
177 aStruct = m_Struct1;
178 aXInterface = m_XInterface;
179 aXComponent = m_XComponent;
180 seqBool = m_seqBool;
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,
196 ref bool[] seqBool)
198 bool _bool = aBool;
199 aBool = m_Bool;
200 m_Bool = _bool;
202 byte _byte = aByte;
203 aByte = m_Byte;
204 m_Byte = _byte;
206 short _short = aShort;
207 aShort = m_Short;
208 m_Short = _short;
210 ushort _ushort = aUShort;
211 aUShort = m_UShort;
212 m_UShort = _ushort;
214 int _int = aInt;
215 aInt = m_Int;
216 m_Int = _int;
218 uint _uint = aUInt;
219 aUInt = m_UInt;
220 m_UInt = _uint;
222 long _long = aLong;
223 aLong = m_Long;
224 m_Long = _long;
226 ulong _ulong = aULong;
227 aULong = m_ULong;
228 m_ULong = _ulong;
230 float _f = aFloat;
231 aFloat = m_Float;
232 m_Float = _f;
234 double _d = aDouble;
235 aDouble = m_Double;
236 m_Double = _d;
238 char _char = aChar;
239 aChar = m_Char;
240 m_Char = _char;
242 string _string = aString;
243 aString = m_String;
244 m_String = _string;
246 Type _type = aType;
247 aType = m_Type;
248 m_Type = _type;
250 Any _any = aAny;
251 aAny = m_Any;
252 m_Any = _any;
254 Enum2 _enum2 = aEnum;
255 aEnum = m_Enum2;
256 m_Enum2 = _enum2;
258 Struct1 _struct1 = aStruct;
259 aStruct = m_Struct1;
260 m_Struct1 = _struct1;
262 object _obj = aXInterface;
263 aXInterface = m_XInterface;
264 m_XInterface = _obj;
266 ucss.lang.XComponent _xcomp = aXComponent;
267 aXComponent = m_XComponent;
268 m_XComponent = _xcomp;
270 bool[] _seq = seqBool;
271 seqBool = m_seqBool;
272 m_seqBool = _seq;
275 public bool retBoolean()
277 return m_Bool;
280 public byte retByte()
282 return m_Byte;
285 public short retShort()
287 return m_Short;
290 public ushort retUShort()
292 return m_UShort;
295 public int retLong()
297 return m_Int;
300 public uint retULong()
302 return m_UInt;
305 public long retHyper()
307 return m_Long;
310 public ulong retUHyper()
312 return m_ULong;
315 public float retFloat()
317 return m_Float;
320 public double retDouble()
322 return m_Double;
325 public char retChar()
327 return m_Char;
330 public string retString()
332 return m_String;
335 public Type retType()
337 return m_Type;
340 public uno.Any retAny()
342 return m_Any;
345 public Enum2 retEnum()
347 return m_Enum2;
349 public Struct1 retStruct1()
351 return m_Struct1;
354 public object retXInterface()
356 return m_XInterface;
359 public unoidl.com.sun.star.lang.XComponent retXComponent()
361 return m_XComponent;
364 public bool[] retSeqBool()
366 return m_seqBool;
369 public bool attrBoolean
371 get {
372 return m_Bool;
374 set {
375 m_Bool = value;
379 public byte attrByte
381 get {
382 return m_Byte;
384 set {
385 m_Byte = value;
389 public short attrShort
391 get {
392 return m_Short;
394 set {
395 m_Short = value;
399 public ushort attrUShort
401 get {
402 return m_UShort;
404 set {
405 m_UShort = value;
409 public int attrLong
411 get {
412 return m_Int;
414 set {
415 m_Int = value;
419 public uint attrULong
421 get {
422 return m_UInt;
424 set {
425 m_UInt = value;
429 public long attrHyper
431 get {
432 return m_Long;
434 set {
435 m_Long = value;
439 public ulong attrUHyper
441 get {
442 return m_ULong;
444 set {
445 m_ULong = value;
449 public float attrFloat
451 get {
452 return m_Float;
454 set {
455 m_Float = value;
459 public double attrDouble
461 get {
462 return m_Double;
464 set {
465 m_Double = value;
469 public char attrChar
471 get {
472 return m_Char;
474 set {
475 m_Char = value;
479 public string attrString
481 get {
482 return m_String;
484 set {
485 m_String = value;
489 public Type attrType
491 get {
492 return m_Type;
494 set {
495 m_Type = value;
499 public Any attrAny
501 get {
502 return m_Any;
504 set {
505 m_Any = value;
509 public Enum2 attrEnum2
511 get {
512 return m_Enum2;
514 set {
515 m_Enum2 = value;
519 public Struct1 attrStruct1
521 get {
522 return m_Struct1;
524 set {
525 m_Struct1 = value;
529 public object attrXInterface
531 get {
532 return m_XInterface;
534 set {
535 m_XInterface = value;
539 public ucss.lang.XComponent attrXComponent
541 get {
542 return m_XComponent;
544 set {
545 m_XComponent = value;
549 public bool[] attrSeqBoolean
551 get {
552 return m_seqBool;
554 set {
555 m_seqBool = value;
563 Any[] m_args;
564 int m_A1;
565 int m_A2;
566 int m_A3;
567 int m_A4;
569 bool m_Bool;
570 byte m_Byte;
571 short m_Short;
572 ushort m_UShort;
573 int m_Int;
574 uint m_UInt;
575 long m_Long;
576 ulong m_ULong;
577 float m_Float;
578 double m_Double;
579 char m_Char;
580 string m_String;
581 Type m_Type;
582 Any m_Any;
583 Enum2 m_Enum2;
584 Struct1 m_Struct1;
585 object m_XInterface;
586 unoidl.com.sun.star.lang.XComponent m_XComponent;
587 bool[] m_seqBool;