xref: /AOO41X/main/cli_ure/qa/climaker/testobjects.cs (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 using System;
29 using System.Reflection;
30 using System.Diagnostics;
31 using uno;
32 
33 using unoidl.test.cliure.climaker;
34 //using unoidl.com.sun.star.uno;
35 using ucss=unoidl.com.sun.star;
36 
37 
38 /* To create this component, the class context (in this assembly) can be used. When
39    createInstanceWithArgumentsAndContext is called on the service manager
40    then the arguments are passed into the ctor.
41 */
42 class Component:uno.util.WeakComponentBase, XTest
43 {
44     public Component(ucss.uno.XComponentContext ctx) {
45         m_args = new Any[] {new Any(typeof(ucss.uno.XComponentContext), ctx)};
46         m_A2 = 0;
47         m_A4 = 0;
48     }
49 
50     public Component(ucss.uno.XComponentContext ctx, uno.Any[] args) {
51         m_args = new Any[args.Length + 1];
52         m_args[0] = new Any(typeof(ucss.uno.XComponentContext), ctx);
53         for (int i = 0; i < args.Length; i ++) {
54             m_args[i+1] = args[i];
55         }
56     }
57 
58 	public Any[] Args {
59 		get
60 		{
61             return m_args;
62 		}
63 	}
64 
65     // XTest
66     public int A1 {
67         get {
68             return m_A1;
69         }
70         set {
71             m_A1 = value;
72         }
73     }
74 
75     public int A2 {
76         get {
77             return m_A2;
78         }
79     }
80 
81     public int A3 {
82         get {
83             return m_A3;
84         }
85         set {
86             m_A3 = value;
87         }
88     }
89 
90     public int A4 {
91         get {
92             return m_A4;
93         }
94     }
95 
96     public bool test() {
97         return true;
98     }
99 
100     public void testOneway()
101     {
102     }
103 
104     public void testExceptions()
105     {
106     }
107 
108     public PolyStruct testPolyStruct(PolyStruct val)
109     {
110         return val;
111     }
112 
113     public void inParameters(bool aBool, byte aByte,
114                       short aShort, ushort aUShort,
115                       int aInt, uint aUInt,
116                       long aLong, ulong aULong,
117                       float aFloat, double aDouble,
118                       char aChar, string aString,
119                       Type aType, uno.Any aAny,
120                       Enum2 aEnum, Struct1 aStruct,
121                       object aXInterface,
122                       unoidl.com.sun.star.lang.XComponent aXComponent,
123                       bool[] seqBool)
124     {
125         m_Bool = aBool;
126         m_Byte = aByte;
127         m_Short = aShort;
128         m_UShort = aUShort;
129         m_Int = aInt;
130         m_UInt = aUInt;
131         m_Long = aLong;
132         m_ULong = aULong;
133         m_Float = aFloat;
134         m_Double = aDouble;
135         m_Char = aChar;
136         m_String = aString;
137         m_Type = aType;
138         m_Any = aAny;
139         m_Enum2 = aEnum;
140         m_Struct1 = aStruct;
141         m_XInterface = aXInterface;
142         m_XComponent = aXComponent;
143         m_seqBool = seqBool;
144 
145     }
146 
147     public void outParameters(out bool aBool, out byte aByte,
148                       out short aShort, out ushort aUShort,
149                       out int aInt, out uint aUInt,
150                       out long aLong, out ulong aULong,
151                       out float aFloat, out double aDouble,
152                       out char aChar, out string aString,
153                       out Type aType, out uno.Any aAny,
154                       out Enum2 aEnum, out Struct1 aStruct,
155                       out object aXInterface,
156                       out unoidl.com.sun.star.lang.XComponent aXComponent,
157                       out bool[] seqBool)
158     {
159         aBool = m_Bool;
160         aByte = m_Byte;
161         aShort = m_Short;
162         aUShort = m_UShort;
163         aInt = m_Int;
164         aUInt = m_UInt;
165         aLong = m_Long;
166         aULong = m_ULong;
167         aFloat = m_Float;
168         aDouble = m_Double;
169         aChar = m_Char;
170         aString = m_String;
171         aType = m_Type;
172         aAny = m_Any;
173         aEnum = m_Enum2;
174         aStruct = m_Struct1;
175         aXInterface = m_XInterface;
176         aXComponent = m_XComponent;
177         seqBool = m_seqBool;
178 
179     }
180 
181     //returns the values which have been set in a previous call
182     //to this function or inParameters.
183     public void inoutParameters(ref bool aBool, ref byte aByte,
184                       ref short aShort, ref ushort aUShort,
185                       ref int aInt, ref uint aUInt,
186                       ref long aLong, ref ulong aULong,
187                       ref float aFloat, ref double aDouble,
188                       ref char aChar,  ref string aString,
189                       ref Type aType, ref uno.Any aAny,
190                       ref Enum2 aEnum, ref Struct1 aStruct,
191                       ref object aXInterface,
192                       ref unoidl.com.sun.star.lang.XComponent aXComponent,
193                       ref bool[] seqBool)
194     {
195         bool _bool = aBool;
196         aBool = m_Bool;
197         m_Bool = _bool;
198 
199         byte _byte = aByte;
200         aByte = m_Byte;
201         m_Byte = _byte;
202 
203         short _short = aShort;
204         aShort = m_Short;
205         m_Short = _short;
206 
207         ushort _ushort = aUShort;
208         aUShort = m_UShort;
209         m_UShort = _ushort;
210 
211         int _int = aInt;
212         aInt = m_Int;
213         m_Int = _int;
214 
215         uint _uint = aUInt;
216         aUInt = m_UInt;
217         m_UInt = _uint;
218 
219         long _long = aLong;
220         aLong = m_Long;
221         m_Long = _long;
222 
223         ulong _ulong = aULong;
224         aULong = m_ULong;
225         m_ULong = _ulong;
226 
227         float _f = aFloat;
228         aFloat = m_Float;
229         m_Float = _f;
230 
231         double _d = aDouble;
232         aDouble = m_Double;
233         m_Double = _d;
234 
235         char _char = aChar;
236         aChar = m_Char;
237         m_Char = _char;
238 
239         string _string = aString;
240         aString = m_String;
241         m_String = _string;
242 
243         Type _type = aType;
244         aType = m_Type;
245         m_Type = _type;
246 
247         Any _any = aAny;
248         aAny = m_Any;
249         m_Any = _any;
250 
251         Enum2 _enum2 = aEnum;
252         aEnum = m_Enum2;
253         m_Enum2 = _enum2;
254 
255         Struct1 _struct1 = aStruct;
256         aStruct = m_Struct1;
257         m_Struct1 = _struct1;
258 
259         object _obj = aXInterface;
260         aXInterface = m_XInterface;
261         m_XInterface = _obj;
262 
263         ucss.lang.XComponent _xcomp = aXComponent;
264         aXComponent = m_XComponent;
265         m_XComponent = _xcomp;
266 
267         bool[] _seq = seqBool;
268         seqBool = m_seqBool;
269         m_seqBool = _seq;
270     }
271 
272     public bool retBoolean()
273     {
274         return m_Bool;
275     }
276 
277     public byte retByte()
278     {
279         return m_Byte;
280     }
281 
282     public short retShort()
283     {
284         return m_Short;
285     }
286 
287     public ushort retUShort()
288     {
289         return m_UShort;
290     }
291 
292     public int retLong()
293     {
294         return m_Int;
295     }
296 
297     public uint retULong()
298     {
299         return m_UInt;
300     }
301 
302     public long retHyper()
303     {
304         return m_Long;
305     }
306 
307     public ulong retUHyper()
308     {
309         return m_ULong;
310     }
311 
312     public float retFloat()
313     {
314         return m_Float;
315     }
316 
317     public double retDouble()
318     {
319         return m_Double;
320     }
321 
322     public char retChar()
323     {
324         return m_Char;
325     }
326 
327     public string retString()
328     {
329         return m_String;
330     }
331 
332     public Type retType()
333     {
334         return m_Type;
335     }
336 
337     public uno.Any retAny()
338     {
339         return m_Any;
340     }
341 
342     public Enum2 retEnum()
343     {
344         return m_Enum2;
345     }
346     public Struct1 retStruct1()
347     {
348         return m_Struct1;
349     }
350 
351     public object retXInterface()
352     {
353         return m_XInterface;
354     }
355 
356     public unoidl.com.sun.star.lang.XComponent retXComponent()
357     {
358         return m_XComponent;
359     }
360 
361     public bool[] retSeqBool()
362     {
363         return m_seqBool;
364     }
365 
366     public bool attrBoolean
367     {
368         get {
369             return m_Bool;
370         }
371         set {
372             m_Bool = value;
373         }
374     }
375 
376     public byte attrByte
377     {
378         get {
379             return m_Byte;
380         }
381         set {
382             m_Byte = value;
383         }
384     }
385 
386     public short attrShort
387     {
388         get {
389             return m_Short;
390         }
391         set {
392             m_Short = value;
393         }
394     }
395 
396     public ushort attrUShort
397     {
398         get {
399             return m_UShort;
400         }
401         set {
402             m_UShort = value;
403         }
404     }
405 
406     public int attrLong
407     {
408         get {
409             return m_Int;
410         }
411         set {
412             m_Int = value;
413         }
414     }
415 
416     public uint attrULong
417     {
418         get {
419             return m_UInt;
420         }
421         set {
422             m_UInt = value;
423         }
424     }
425 
426     public long attrHyper
427     {
428         get {
429             return m_Long;
430         }
431         set {
432             m_Long = value;
433         }
434     }
435 
436     public ulong attrUHyper
437     {
438         get {
439             return m_ULong;
440         }
441         set {
442             m_ULong = value;
443         }
444     }
445 
446     public float attrFloat
447     {
448         get {
449             return m_Float;
450         }
451         set {
452             m_Float = value;
453         }
454     }
455 
456     public double attrDouble
457     {
458         get {
459             return m_Double;
460         }
461         set {
462             m_Double = value;
463         }
464     }
465 
466     public char attrChar
467     {
468         get {
469             return m_Char;
470         }
471         set {
472             m_Char = value;
473         }
474     }
475 
476     public string attrString
477     {
478         get {
479             return m_String;
480         }
481         set {
482             m_String = value;
483         }
484     }
485 
486     public Type attrType
487     {
488         get {
489             return m_Type;
490         }
491         set {
492             m_Type = value;
493         }
494     }
495 
496     public Any attrAny
497     {
498         get {
499             return m_Any;
500         }
501         set {
502             m_Any = value;
503         }
504     }
505 
506     public Enum2 attrEnum2
507     {
508         get {
509             return m_Enum2;
510         }
511         set {
512             m_Enum2 = value;
513         }
514     }
515 
516     public Struct1 attrStruct1
517     {
518         get {
519             return m_Struct1;
520         }
521         set {
522             m_Struct1 = value;
523         }
524     }
525 
526     public object attrXInterface
527     {
528         get {
529             return m_XInterface;
530         }
531         set {
532             m_XInterface = value;
533         }
534     }
535 
536     public ucss.lang.XComponent attrXComponent
537     {
538         get {
539             return m_XComponent;
540         }
541         set {
542             m_XComponent = value;
543         }
544     }
545 
546     public bool[] attrSeqBoolean
547     {
548         get {
549             return m_seqBool;
550         }
551         set {
552             m_seqBool = value;
553         }
554     }
555 
556 
557 
558 
559 
560     Any[] m_args;
561     int m_A1;
562     int m_A2;
563     int m_A3;
564     int m_A4;
565 
566     bool m_Bool;
567     byte m_Byte;
568     short m_Short;
569     ushort m_UShort;
570     int m_Int;
571     uint m_UInt;
572     long m_Long;
573     ulong m_ULong;
574     float m_Float;
575     double m_Double;
576     char m_Char;
577     string m_String;
578     Type m_Type;
579     Any m_Any;
580     Enum2 m_Enum2;
581     Struct1 m_Struct1;
582     object m_XInterface;
583     unoidl.com.sun.star.lang.XComponent m_XComponent;
584     bool[] m_seqBool;
585 
586 }
587 
588 
589