xref: /aoo41x/main/stoc/test/language_binding.idl (revision 3508ca0d)
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#ifndef _TEST_LANGUAGE_BINDING_IDL_
25#define _TEST_LANGUAGE_BINDING_IDL_
26
27#include <com/sun/star/uno/XInterface.idl>
28#include <com/sun/star/lang/IllegalArgumentException.idl>
29
30module test
31{
32
33enum TestEnum
34{
35	TEST,
36	ONE,
37	TWO,
38	CHECK,
39	LOLA,
40	PALOO,
41	ZA
42};
43
44/**
45 * simple c++ types
46 */
47struct TestSimple
48{
49	boolean					   Bool;
50	char					   Char;
51	byte					   Byte;
52	short					   Short;
53	unsigned short			   UShort;
54	long					   Long;
55	unsigned long			   ULong;
56	hyper					   Hyper;
57	unsigned hyper			   UHyper;
58	float					   Float;
59	double					   Double;
60	test::TestEnum			   Enum;
61};
62/**
63 * complex c++ types
64 */
65struct TestElement : test::TestSimple
66{
67	string					   String;
68	com::sun::star::uno::XInterface   Interface;
69	any						   Any;
70};
71struct TestDataElements : test::TestElement
72{
73	sequence<test::TestElement > Sequence;
74};
75
76typedef TestDataElements TestData;
77
78/**
79 * Monster test interface to test language binding calls.
80 *
81 * @author Daniel Boelzle
82 */
83interface XLBTestBase : com::sun::star::uno::XInterface
84{
85	/**
86	 * in parameter test, tests by calls reference also (complex types)
87	 */
88	[oneway] void setValues( [in] boolean bBool, [in] char cChar, [in] byte nByte,
89							 [in] short nShort, [in] unsigned short nUShort,
90							 [in] long nLong, [in] unsigned long nULong,
91							 [in] hyper nHyper, [in] unsigned hyper nUHyper,
92							 [in] float fFloat, [in] double fDouble,
93							 [in] test::TestEnum eEnum, [in] string aString,
94							 [in] com::sun::star::uno::XInterface xInterface, [in] any aAny,
95							 [in] sequence<test::TestElement > aSequence,
96							 [in] test::TestData aStruct );
97	/**
98	 * inout parameter test
99	 */
100	test::TestData setValues2( [inout] boolean bBool, [inout] char cChar, [inout] byte nByte,
101							   [inout] short nShort, [inout] unsigned short nUShort,
102							   [inout] long nLong, [inout] unsigned long nULong,
103							   [inout] hyper nHyper, [inout] unsigned hyper nUHyper,
104							   [inout] float fFloat, [inout] double fDouble,
105							   [inout] test::TestEnum eEnum, [inout] string aString,
106							   [inout] com::sun::star::uno::XInterface xInterface, [inout] any aAny,
107							   [inout] sequence<test::TestElement > aSequence,
108							   [inout] test::TestData aStruct );
109
110	/**
111	 * out parameter test
112	 */
113	test::TestData getValues( [out] boolean bBool, [out] char cChar, [out] byte nByte,
114							  [out] short nShort, [out] unsigned short nUShort,
115							  [out] long nLong, [out] unsigned long nULong,
116							  [out] hyper nHyper, [out] unsigned hyper nUHyper,
117							  [out] float fFloat, [out] double fDouble,
118							  [out] test::TestEnum eEnum, [out] string aString,
119							  [out] com::sun::star::uno::XInterface xInterface, [out] any aAny,
120							  [out] sequence<test::TestElement > aSequence,
121							  [out] test::TestData aStruct );
122
123	[attribute] boolean					 Bool;
124	[attribute] byte					 Byte;
125	[attribute] char					 Char;
126	[attribute] short					 Short;
127	[attribute] unsigned short			 UShort;
128	[attribute] long					 Long;
129	[attribute] unsigned long			 ULong;
130	[attribute] hyper					 Hyper;
131	[attribute] unsigned hyper			 UHyper;
132	[attribute] float					 Float;
133	[attribute] double					 Double;
134	[attribute] test::TestEnum			 Enum;
135	[attribute] string					 String;
136	[attribute] com::sun::star::uno::XInterface Interface;
137	[attribute] any						 Any;
138	[attribute] sequence<test::TestElement > Sequence;
139	[attribute] test::TestData			 Struct;
140};
141
142
143/**
144 * Inherting from monster; adds raiseException().
145 *
146 * @author Daniel Boelzle
147 */
148interface XLanguageBindingTest : test::XLBTestBase
149{
150	/**
151	 * params are there only for dummy, to test if all temp out params will be released.
152	 */
153	test::TestData raiseException( [out] boolean bBool, [out] char cChar, [out] byte nByte,
154								   [out] short nShort, [out] unsigned short nUShort,
155								   [out] long nLong, [out] unsigned long nULong,
156								   [out] hyper nHyper, [out] unsigned hyper nUHyper,
157								   [out] float fFloat, [out] double fDouble,
158								   [out] test::TestEnum eEnum, [out] string aString,
159								   [out] com::sun::star::uno::XInterface xInterface, [out] any aAny,
160								   [out] sequence<test::TestElement > aSequence,
161								   [out] test::TestData aStruct )
162		raises( com::sun::star::lang::IllegalArgumentException );
163
164	/**
165	 * raises runtime exception
166	 */
167	[attribute] long					 RuntimeException;
168};
169
170}; // test
171
172
173#endif
174