xref: /trunk/main/extensions/test/ole/idl/oletest.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#include <com/sun/star/uno/XInterface.idl>
29#include <com/sun/star/script/XInvocation.idl>
30#include <com/sun/star/beans/XPropertySet.idl>
31#include <com/sun/star/lang/XEventListener.idl>
32
33
34module oletest
35{
36
37interface XTestSequence: com::sun::star::uno::XInterface
38{
39	sequence<byte> methodByte( [in] sequence<byte> aSeq );
40	sequence<float> methodFloat( [in] sequence<float> aSeq);
41	sequence<double> methodDouble( [in] sequence<double> aSeq);
42	sequence<boolean> methodBool( [in] sequence<boolean> aSeq);
43	sequence<short> methodShort( [in] sequence<short> aSeq);
44	sequence<unsigned short> methodUShort( [in] sequence<unsigned short> aSeq);
45	sequence<long> methodLong( [in] sequence<long> aSeq);
46	sequence<unsigned long> methodULong( [in] sequence<unsigned long> aSeq);
47	sequence<string> methodString( [in] sequence<string> aSeq);
48	sequence<char> methodChar( [in] sequence<char> aSeq);
49	sequence<any> methodAny	( [in] sequence<any> aSeq);
50    sequence<type> methodType	( [in] sequence<type> aSeq);
51	sequence<com::sun::star::uno::XInterface> methodXInterface ( [in] sequence<com::sun::star::uno::XInterface> aSeq);
52	sequence< sequence <long> > methodSequence( [in] sequence< sequence< long > > aSeq);
53	sequence< sequence <sequence <long> > > methodSequence2( [in] sequence< sequence< sequence<long> > > aSeq);
54    sequence< com::sun::star::lang::XEventListener > methodXEventListeners( [in] sequence<com::sun::star::lang::XEventListener> aSeq);
55    sequence< sequence< com::sun::star::lang::XEventListener > > methodXEventListenersMul( [in] sequence< sequence< com::sun::star::lang::XEventListener> > aSeq);
56
57	[attribute] sequence<byte> AttrByte;
58	[attribute] sequence<float> AttrFloat;
59	[attribute] sequence<double> AttrDouble;
60	[attribute] sequence<boolean> AttrBool;
61	[attribute] sequence<short> AttrShort;
62	[attribute] sequence<unsigned short> AttrUShort;
63	[attribute] sequence<long> AttrLong;
64	[attribute] sequence<unsigned long> AttrULong;
65	[attribute] sequence<string> AttrString;
66	[attribute] sequence<char> AttrChar;
67	[attribute] sequence<any> AttrAny;
68    [attribute] sequence<type> AttrType;
69	[attribute] sequence< sequence<long> > AttrSequence;
70	[attribute] sequence< sequence< sequence <long> > > AttrSequence2;
71	[attribute] sequence< com::sun::star::uno::XInterface > AttrXInterface;
72
73	[attribute] byte AByte;
74	[attribute] float AFloat;
75	[attribute] double ADouble;
76	[attribute] boolean ABool;
77	[attribute] short AShort;
78	[attribute] unsigned short AUShort;
79	[attribute] long ALong;
80	[attribute] unsigned long AULong;
81	[attribute] string AString;
82	[attribute] char AChar;
83	[attribute] any AAny;
84    [attribute] type AType;
85	[attribute] com::sun::star::uno::XInterface  AXInterface;
86    [attribute] com::sun::star::script::XInvocation  AXInvocation;
87
88	void testout_methodByte( [out] byte rOut );
89	void testout_methodFloat( [out] float rOut);
90	void testout_methodDouble( [out] double rOut);
91	void testout_methodBool( [out] boolean rOut);
92	void testout_methodShort( [out] short rOut);
93	void testout_methodUShort( [out] unsigned short rOut);
94	void testout_methodLong( [out]  long rOut);
95	void testout_methodULong( [out] unsigned long rOut);
96 	void testout_methodHyper( [out]  hyper rOut);
97 	void testout_methodUHyper( [out] unsigned hyper rOut);
98    void testout_methodString( [out] string rOut);
99	void testout_methodChar( [out] char rOut);
100	void testout_methodAny	( [out] any rOut);
101    void testout_methodType	( [out] type rOut);
102	void testout_methodSequence( [out] sequence< long > rOut);
103	void testout_methodSequence2( [out] sequence < sequence< long > > rOut);
104	void testout_methodXInterface( [out] com::sun::star::uno::XInterface rOut);
105
106	void testout_methodMulParams1( [out] long rout1, [out] long rout2);
107	void testout_methodMulParams2( [out] long rout1, [out] long rout2, [out] string rout3);
108	void testout_methodMulParams3( [in] string sin, [out] string sout);
109	void testout_methodMulParams4( [in] float in1, [out] float out1, [in] long in2, [out] long out2, [in] long in3);
110
111	void testinout_methodByte( [inout] byte rOut );
112	void testinout_methodFloat( [inout] float rOut);
113	void testinout_methodDouble( [inout] double rOut);
114	void testinout_methodBool( [inout] boolean rOut);
115	void testinout_methodShort( [inout] short rOut);
116	void testinout_methodUShort( [inout] unsigned short rOut);
117	void testinout_methodLong( [inout]  long rOut);
118	void testinout_methodULong( [inout] unsigned long rOut);
119	void testinout_methodHyper( [inout]  hyper rOut);
120	void testinout_methodUHyper( [inout] unsigned hyper rOut);
121    void testinout_methodString( [inout] string rOut);
122	void testinout_methodChar( [inout] char rOut);
123	void testinout_methodAny	( [inout] any rOut);
124    void testinout_methodType	( [inout] type rOut);
125	void testinout_methodSequence( [inout] sequence< long > rOut);
126	void testinout_methodSequence2( [inout] sequence < sequence< long > > rOut);
127	void testinout_methodXInterface( [inout] com::sun::star::script::XInvocation rOut);
128	void testinout_methodXInterface2( [inout] com::sun::star::uno::XInterface rOut);
129
130	any methodAnyTest1( [in] any rIn);
131	[attribute]  any AttrAny2;
132
133};
134interface XTestStruct: com::sun::star::uno::XInterface
135{
136// Method taking structs as arguments
137	void methodStruct( [in] com::sun::star::beans::Property aProp);
138//	Methods returning structs
139	com::sun::star::beans::Property retMethodStruct();
140// Attributes as structs
141	[attribute] com::sun::star::beans::Property AttrStruct;
142
143    com::sun::star::beans::Property methodStruct2( [in] com::sun::star::beans::Property aProp);
144};
145
146
147struct SimpleStruct
148{
149	string message;
150};
151
152interface XTestInParameters: com::sun::star::uno::XInterface
153{
154	byte in_methodByte( [in] byte rIn );
155	float in_methodFloat( [in] float rIn);
156	double in_methodDouble( [in] double rIn);
157	boolean in_methodBool( [in] boolean rIn);
158	short in_methodShort( [in] short rIn);
159	unsigned short in_methodUShort( [in] unsigned short rIn);
160	long in_methodLong( [in]  long rIn);
161	unsigned long in_methodULong( [in] unsigned long rIn);
162    hyper in_methodHyper( [in]  hyper rIn);
163	unsigned hyper in_methodUHyper( [in] unsigned hyper rIn);
164	string in_methodString( [in] string rIn);
165	char in_methodChar( [in] char rIn);
166	any in_methodAny	( [in] any rIn);
167    type in_methodType	( [in] type rIn);
168    com::sun::star::uno::XInterface in_methodXInterface([in] com::sun::star::uno::XInterface rIn);
169	com::sun::star::script::XInvocation in_methodInvocation( [in] com::sun::star::script::XInvocation inv);
170	SimpleStruct in_methodStruct( [in] SimpleStruct aStruct);
171	void in_methodAll( [in] byte b, [in] float f, [in] double d, [in] boolean abool, [in]short sh,
172					   [in] unsigned short us, [in] long l, [in] unsigned long ul,
173					   [in] string s, [in] char c, [in] any a, [in] type t, [in] com::sun::star::script::XInvocation inv);
174};
175
176
177enum SimpleEnum
178{
179	A,
180	B,
181	C
182};
183
184interface XTestOther: com::sun::star::uno::XInterface
185{
186	// Any test
187	void other_methodAnyIn( [in] any rAny);
188	void other_methodAnyOut( [out] any rAny);
189	any other_methodAnyRet();
190	void in_float( [in] float val);
191    //typeInAny determines what type must be in rAny. If rAny contains
192    //a different type then an exception is being thrown
193    any other_methodAny([in] any rAny, [in] string typeInAny);
194};
195
196
197interface XSimple: com::sun::star::uno::XInterface
198{
199	void func( [in] string message);
200	string getName();
201};
202
203interface XSimple2: com::sun::star::uno::XInterface
204{
205	void func2( [in] string message);
206	string getName2();
207};
208
209interface XSimple3: com::sun::star::uno::XInterface
210{
211	void func3( [in] string message);
212	string getName3();
213};
214
215
216interface XCallback: com::sun::star::uno::XInterface
217{
218	void func1();
219	oletest::XSimple returnInterface();
220	void outInterface( [out] oletest::XSimple outInterface);
221	void outStruct( [out] oletest::SimpleStruct outStruct);
222	void outEnum( [out] oletest::SimpleEnum outEnum);
223	void outSeqAny( [out] sequence<any> outSeqAny);
224	void outSeqByte( [out] sequence<byte> outVal);
225	void outAny( [out] any outAny);
226	void outBool( [out] boolean outBool);
227	void outChar( [out] char outChar);
228	void outString( [out] string outString);
229	void outFloat( [out] float outFloat);
230	void outDouble( [out] double outDouble);
231	void outByte( [out] byte outByte);
232	void outShort( [out] short outShort);
233	void outLong( [out] long outLong);
234	void outValuesMixed( [in] long lval, [out] long outval, [in] string sval);
235	void outValuesAll( [out] oletest::XSimple outInterface,
236					   [out] SimpleStruct outStruct ,
237					   [out] SimpleEnum outEnum,
238					   [out] sequence<any> outSeqAny,
239					   [out] any outAny,
240					   [out] boolean outBool,
241					   [out] char outChar,
242					   [out] string outString,
243					   [out] float outFloat,
244					   [out] double outDouble,
245					   [out] byte	outByte,
246					   [out] short outShort,
247					   [out] long outLong);
248// IN OUT parameters
249	void inoutInterface( [inout] oletest::XSimple inoutVal);
250	void inoutStruct( [inout] oletest::SimpleStruct inoutVal);
251	void inoutEnum( [inout] oletest::SimpleEnum inoutVal);
252	void inoutSeqAny( [inout] sequence<any> inoutVal);
253	void inoutAny( [inout] any inoutVal);
254	void inoutBool( [inout] boolean inoutVal);
255	void inoutChar( [inout] char inoutVal);
256	void inoutString( [inout] string inoutVal);
257	void inoutFloat( [inout] float inoutVal);
258	void inoutDouble( [inout] double inoutVal);
259	void inoutByte( [inout] byte inoutVal);
260	void inoutShort( [inout] short inoutVal);
261	void inoutLong( [inout] long inoutVal);
262
263	void inoutValuesAll( [inout] oletest::XSimple aXSimple,
264						 [inout] oletest::SimpleStruct aStruct,
265						 [inout] oletest::SimpleEnum aEnum,
266						 [inout] sequence<any> aSeq,
267						 [inout] any aAny,
268						 [inout] boolean aBool,
269						 [inout] char aChar,
270						 [inout] string aString,
271						 [inout] float aFloat,
272						 [inout] double aDouble,
273						 [inout] byte aByte,
274						 [inout] short aShort,
275						 [inout] long aLong);
276
277	// IN parameter
278
279	void inValues( [in] char aChar, [in] long aLong, [in] string aString);
280	void inSeqByte( [in] sequence<byte> val);
281    void inSeqXEventListener( [in] sequence<com::sun::star::lang::XEventListener> listener, [in]
282                              sequence<com::sun::star::lang::EventObject> events);
283
284	// Attributes
285	[attribute] oletest::XSimple simple;
286
287
288
289
290};
291
292interface XTestInterfaces: com::sun::star::uno::XInterface
293{
294	// Any test
295	void testInterface( [in] oletest::XCallback xCallback, [in] long mode);
296	void testInterface2( [in] oletest::XSimple xSimple, [in] long mode);
297};
298
299interface XIdentity: com::sun::star::uno::XInterface
300{
301    void setObject([in] com::sun::star::uno::XInterface val);
302    boolean isSame( [in] com::sun::star::uno::XInterface val);
303
304    com::sun::star::uno::XInterface getThis();
305};
306
307}; // oletest
308
309