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