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