xref: /AOO41X/main/stoc/test/language_binding.idl (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir/*************************************************************************
2*cdf0e10cSrcweir *
3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir *
5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir *
7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir *
9*cdf0e10cSrcweir * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir *
11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir *
15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir *
21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir *
26*cdf0e10cSrcweir ************************************************************************/
27*cdf0e10cSrcweir
28*cdf0e10cSrcweir#ifndef _TEST_LANGUAGE_BINDING_IDL_
29*cdf0e10cSrcweir#define _TEST_LANGUAGE_BINDING_IDL_
30*cdf0e10cSrcweir
31*cdf0e10cSrcweir#include <com/sun/star/uno/XInterface.idl>
32*cdf0e10cSrcweir#include <com/sun/star/lang/IllegalArgumentException.idl>
33*cdf0e10cSrcweir
34*cdf0e10cSrcweirmodule test
35*cdf0e10cSrcweir{
36*cdf0e10cSrcweir
37*cdf0e10cSrcweirenum TestEnum
38*cdf0e10cSrcweir{
39*cdf0e10cSrcweir	TEST,
40*cdf0e10cSrcweir	ONE,
41*cdf0e10cSrcweir	TWO,
42*cdf0e10cSrcweir	CHECK,
43*cdf0e10cSrcweir	LOLA,
44*cdf0e10cSrcweir	PALOO,
45*cdf0e10cSrcweir	ZA
46*cdf0e10cSrcweir};
47*cdf0e10cSrcweir
48*cdf0e10cSrcweir/**
49*cdf0e10cSrcweir * simple c++ types
50*cdf0e10cSrcweir */
51*cdf0e10cSrcweirstruct TestSimple
52*cdf0e10cSrcweir{
53*cdf0e10cSrcweir	boolean					   Bool;
54*cdf0e10cSrcweir	char					   Char;
55*cdf0e10cSrcweir	byte					   Byte;
56*cdf0e10cSrcweir	short					   Short;
57*cdf0e10cSrcweir	unsigned short			   UShort;
58*cdf0e10cSrcweir	long					   Long;
59*cdf0e10cSrcweir	unsigned long			   ULong;
60*cdf0e10cSrcweir	hyper					   Hyper;
61*cdf0e10cSrcweir	unsigned hyper			   UHyper;
62*cdf0e10cSrcweir	float					   Float;
63*cdf0e10cSrcweir	double					   Double;
64*cdf0e10cSrcweir	test::TestEnum			   Enum;
65*cdf0e10cSrcweir};
66*cdf0e10cSrcweir/**
67*cdf0e10cSrcweir * complex c++ types
68*cdf0e10cSrcweir */
69*cdf0e10cSrcweirstruct TestElement : test::TestSimple
70*cdf0e10cSrcweir{
71*cdf0e10cSrcweir	string					   String;
72*cdf0e10cSrcweir	com::sun::star::uno::XInterface   Interface;
73*cdf0e10cSrcweir	any						   Any;
74*cdf0e10cSrcweir};
75*cdf0e10cSrcweirstruct TestDataElements : test::TestElement
76*cdf0e10cSrcweir{
77*cdf0e10cSrcweir	sequence<test::TestElement > Sequence;
78*cdf0e10cSrcweir};
79*cdf0e10cSrcweir
80*cdf0e10cSrcweirtypedef TestDataElements TestData;
81*cdf0e10cSrcweir
82*cdf0e10cSrcweir/**
83*cdf0e10cSrcweir * Monster test interface to test language binding calls.
84*cdf0e10cSrcweir *
85*cdf0e10cSrcweir * @author Daniel Boelzle
86*cdf0e10cSrcweir */
87*cdf0e10cSrcweirinterface XLBTestBase : com::sun::star::uno::XInterface
88*cdf0e10cSrcweir{
89*cdf0e10cSrcweir	/**
90*cdf0e10cSrcweir	 * in parameter test, tests by calls reference also (complex types)
91*cdf0e10cSrcweir	 */
92*cdf0e10cSrcweir	[oneway] void setValues( [in] boolean bBool, [in] char cChar, [in] byte nByte,
93*cdf0e10cSrcweir							 [in] short nShort, [in] unsigned short nUShort,
94*cdf0e10cSrcweir							 [in] long nLong, [in] unsigned long nULong,
95*cdf0e10cSrcweir							 [in] hyper nHyper, [in] unsigned hyper nUHyper,
96*cdf0e10cSrcweir							 [in] float fFloat, [in] double fDouble,
97*cdf0e10cSrcweir							 [in] test::TestEnum eEnum, [in] string aString,
98*cdf0e10cSrcweir							 [in] com::sun::star::uno::XInterface xInterface, [in] any aAny,
99*cdf0e10cSrcweir							 [in] sequence<test::TestElement > aSequence,
100*cdf0e10cSrcweir							 [in] test::TestData aStruct );
101*cdf0e10cSrcweir	/**
102*cdf0e10cSrcweir	 * inout parameter test
103*cdf0e10cSrcweir	 */
104*cdf0e10cSrcweir	test::TestData setValues2( [inout] boolean bBool, [inout] char cChar, [inout] byte nByte,
105*cdf0e10cSrcweir							   [inout] short nShort, [inout] unsigned short nUShort,
106*cdf0e10cSrcweir							   [inout] long nLong, [inout] unsigned long nULong,
107*cdf0e10cSrcweir							   [inout] hyper nHyper, [inout] unsigned hyper nUHyper,
108*cdf0e10cSrcweir							   [inout] float fFloat, [inout] double fDouble,
109*cdf0e10cSrcweir							   [inout] test::TestEnum eEnum, [inout] string aString,
110*cdf0e10cSrcweir							   [inout] com::sun::star::uno::XInterface xInterface, [inout] any aAny,
111*cdf0e10cSrcweir							   [inout] sequence<test::TestElement > aSequence,
112*cdf0e10cSrcweir							   [inout] test::TestData aStruct );
113*cdf0e10cSrcweir
114*cdf0e10cSrcweir	/**
115*cdf0e10cSrcweir	 * out parameter test
116*cdf0e10cSrcweir	 */
117*cdf0e10cSrcweir	test::TestData getValues( [out] boolean bBool, [out] char cChar, [out] byte nByte,
118*cdf0e10cSrcweir							  [out] short nShort, [out] unsigned short nUShort,
119*cdf0e10cSrcweir							  [out] long nLong, [out] unsigned long nULong,
120*cdf0e10cSrcweir							  [out] hyper nHyper, [out] unsigned hyper nUHyper,
121*cdf0e10cSrcweir							  [out] float fFloat, [out] double fDouble,
122*cdf0e10cSrcweir							  [out] test::TestEnum eEnum, [out] string aString,
123*cdf0e10cSrcweir							  [out] com::sun::star::uno::XInterface xInterface, [out] any aAny,
124*cdf0e10cSrcweir							  [out] sequence<test::TestElement > aSequence,
125*cdf0e10cSrcweir							  [out] test::TestData aStruct );
126*cdf0e10cSrcweir
127*cdf0e10cSrcweir	[attribute] boolean					 Bool;
128*cdf0e10cSrcweir	[attribute] byte					 Byte;
129*cdf0e10cSrcweir	[attribute] char					 Char;
130*cdf0e10cSrcweir	[attribute] short					 Short;
131*cdf0e10cSrcweir	[attribute] unsigned short			 UShort;
132*cdf0e10cSrcweir	[attribute] long					 Long;
133*cdf0e10cSrcweir	[attribute] unsigned long			 ULong;
134*cdf0e10cSrcweir	[attribute] hyper					 Hyper;
135*cdf0e10cSrcweir	[attribute] unsigned hyper			 UHyper;
136*cdf0e10cSrcweir	[attribute] float					 Float;
137*cdf0e10cSrcweir	[attribute] double					 Double;
138*cdf0e10cSrcweir	[attribute] test::TestEnum			 Enum;
139*cdf0e10cSrcweir	[attribute] string					 String;
140*cdf0e10cSrcweir	[attribute] com::sun::star::uno::XInterface Interface;
141*cdf0e10cSrcweir	[attribute] any						 Any;
142*cdf0e10cSrcweir	[attribute] sequence<test::TestElement > Sequence;
143*cdf0e10cSrcweir	[attribute] test::TestData			 Struct;
144*cdf0e10cSrcweir};
145*cdf0e10cSrcweir
146*cdf0e10cSrcweir
147*cdf0e10cSrcweir/**
148*cdf0e10cSrcweir * Inherting from monster; adds raiseException().
149*cdf0e10cSrcweir *
150*cdf0e10cSrcweir * @author Daniel Boelzle
151*cdf0e10cSrcweir */
152*cdf0e10cSrcweirinterface XLanguageBindingTest : test::XLBTestBase
153*cdf0e10cSrcweir{
154*cdf0e10cSrcweir	/**
155*cdf0e10cSrcweir	 * params are there only for dummy, to test if all temp out params will be released.
156*cdf0e10cSrcweir	 */
157*cdf0e10cSrcweir	test::TestData raiseException( [out] boolean bBool, [out] char cChar, [out] byte nByte,
158*cdf0e10cSrcweir								   [out] short nShort, [out] unsigned short nUShort,
159*cdf0e10cSrcweir								   [out] long nLong, [out] unsigned long nULong,
160*cdf0e10cSrcweir								   [out] hyper nHyper, [out] unsigned hyper nUHyper,
161*cdf0e10cSrcweir								   [out] float fFloat, [out] double fDouble,
162*cdf0e10cSrcweir								   [out] test::TestEnum eEnum, [out] string aString,
163*cdf0e10cSrcweir								   [out] com::sun::star::uno::XInterface xInterface, [out] any aAny,
164*cdf0e10cSrcweir								   [out] sequence<test::TestElement > aSequence,
165*cdf0e10cSrcweir								   [out] test::TestData aStruct )
166*cdf0e10cSrcweir		raises( com::sun::star::lang::IllegalArgumentException );
167*cdf0e10cSrcweir
168*cdf0e10cSrcweir	/**
169*cdf0e10cSrcweir	 * raises runtime exception
170*cdf0e10cSrcweir	 */
171*cdf0e10cSrcweir	[attribute] long					 RuntimeException;
172*cdf0e10cSrcweir};
173*cdf0e10cSrcweir
174*cdf0e10cSrcweir}; // test
175*cdf0e10cSrcweir
176*cdf0e10cSrcweir
177*cdf0e10cSrcweir#endif
178