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