Release 1.5.29.
[wine] / dlls / oleaut32 / tests / tmarshal.idl
1 /*
2  * Copyright (C) 2005 Robert Shearman
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17  *
18  */
19
20 #include "tmarshal_dispids.h"
21 import "ocidl.idl";
22
23 [
24   uuid(d96d8a3e-78b6-4c8d-8f27-059db959be8a),
25   version(1.0),
26   helpstring("Test Typelib")
27 ]
28 library TestTypelib
29 {
30     importlib("stdole2.tlb");
31
32     typedef enum tagSTATE
33     {
34         STATE_UNWIDGETIFIED = 1,
35         STATE_WIDGETIFIED
36     } STATE;
37
38     typedef struct tagMYSTRUCT
39     {
40         INT field1;
41         ULONGLONG field2;
42         UINT uarr[8];
43     } MYSTRUCT;
44
45     coclass ApplicationObject2;
46
47     [
48         odl,
49         uuid(12345678-1234-4321-1234-121212121212)
50     ]
51     interface ISomethingFromDispatch : IDispatch
52     {
53         HRESULT anotherfn(void);
54     }
55
56     [
57         odl,
58         oleautomation,
59         dual,
60         uuid(3f7e06fe-0bce-46f0-8b7d-3a68393c7967)
61     ]
62     interface ItestDual : IDispatch
63     {
64         HRESULT test();
65     }
66
67     [
68         odl,
69         uuid(3f7e06fe-0bce-46f0-8b7d-3a68393c7968)
70     ]
71     interface ITestSecondIface : IUnknown
72     {
73         HRESULT test();
74     }
75
76     [
77         odl,
78         uuid(a1f8cae3-c947-4c5f-b57d-c87b9b5f3586),
79         oleautomation,
80         dual
81     ]
82     interface IWidget : IDispatch
83     {
84         [propput, id(DISPID_TM_NAME)]
85         HRESULT Name([in] BSTR name);
86         [propget, id(DISPID_TM_NAME)]
87         HRESULT Name([out, retval] BSTR *name);
88
89         [id(DISPID_TM_DOSOMETHING)]
90         HRESULT DoSomething([in] double number, [out] BSTR *str1, [in, defaultvalue("")] BSTR str2, [in, optional] VARIANT *opt);
91
92         [propget, id(DISPID_TM_STATE)]
93         HRESULT State([out, retval] STATE *state);
94         [propput, id(DISPID_TM_STATE)]
95         HRESULT State([in] STATE state);
96
97         [id(DISPID_TM_MAP)]
98         HRESULT Map([in] BSTR bstrId, [out, retval] BSTR *sValue);
99
100         [id(DISPID_TM_SETOLECOLOR)]
101         HRESULT SetOleColor([in] OLE_COLOR val);
102
103         [id(DISPID_TM_GETOLECOLOR)]
104         HRESULT GetOleColor([out, retval] OLE_COLOR *pVal);
105
106         [propget, id(DISPID_TM_CLONE)]
107         HRESULT Clone([out, retval] IWidget **ppVal);
108
109         [propget, id(DISPID_TM_CLONEDISPATCH)]
110         HRESULT CloneDispatch([out, retval] IDispatch **ppVal);
111
112         [propget, id(DISPID_TM_CLONECOCLASS)]
113         HRESULT CloneCoclass([out, retval] ApplicationObject2 **ppVal);
114
115         [propget, id(DISPID_VALUE)]
116         HRESULT Value([in] VARIANT *value, [out, retval] VARIANT *retval);
117
118         [id(DISPID_TM_ARRAY)]
119         HRESULT Array([in] SAFEARRAY(BSTR) values);
120
121         [id(DISPID_TM_VARARRAYPTR)]
122         HRESULT VariantArrayPtr([in] SAFEARRAY(VARIANT) *values);
123
124         [id(DISPID_TM_VARCARRAY)]
125         HRESULT VariantCArray([in] ULONG count, [in, out] VARIANT values[2]);
126
127         [id(DISPID_TM_VARIANT)]
128         HRESULT Variant([in] VARIANT var);
129
130         [vararg, id(DISPID_TM_VARARG)]
131         HRESULT VarArg([in] int numexpect, [in] SAFEARRAY(VARIANT) values);
132
133         [id(DISPID_TM_STRUCTARGS)]
134         HRESULT StructArgs([in] MYSTRUCT byval, [in] MYSTRUCT *byptr, [in] MYSTRUCT arr[5]);
135
136         [id(DISPID_TM_ERROR)]
137         HRESULT Error();
138
139         [propget, id(DISPID_TM_CLONEINTERFACE)]
140         HRESULT CloneInterface([out, retval] ISomethingFromDispatch **ppVal);
141
142         [id(DISPID_TM_PROP_WITH_LCID), propput]
143         HRESULT prop_with_lcid([in,lcid] long lcid, [in] INT i);
144
145         [id(DISPID_TM_PROP_WITH_LCID), propget]
146         HRESULT prop_with_lcid([in,lcid] long lcid, [out,retval] INT *i);
147
148         [id(DISPID_TM_PROP_INT), propget]
149         HRESULT prop_int([out,retval] INT *i);
150
151         [id(DISPID_TM_PROP_UINT), propget]
152         HRESULT prop_uint([out,retval] UINT *i);
153
154         [id(DISPID_TM_BYREF_UINT)]
155         HRESULT ByRefUInt([in, out] UINT *i);
156
157         [id(DISPID_TM_PROP_OPT_ARG), propput]
158         HRESULT prop_opt_arg([in,optional] INT opt, [in] INT i);
159
160         [id(DISPID_TM_PROP_REQ_ARG), propput]
161         HRESULT prop_req_arg([in] INT req, [in] INT i);
162
163         [id(DISPID_TM_RESTRICTED), restricted]
164         HRESULT _restrict([out, retval] INT *i);
165
166         [id(DISPID_TM_NEG_RESTRICTED), restricted]
167         HRESULT neg_restrict([out, retval] INT *i);
168     }
169
170     [
171         odl,
172         uuid(a1f8cae3-c947-3c5f-a57c-c88b9b6f3586),
173         oleautomation,
174         dual
175     ]
176     interface IStaticWidget : IDispatch
177     {
178         [id(DISPID_TM_TESTDUAL)]
179         HRESULT TestDual([in] ItestDual *p);
180
181         [id(DISPID_TM_TESTSECONDIFACE)]
182         HRESULT TestSecondIface([in] ITestSecondIface *p);
183     }
184
185     [
186         odl,
187         uuid(a028db05-30f0-4b93-b17a-41c72f831d84),
188 #if 0 /* FIXME: commented out as causes widl to generate incorrect typelib */
189         dual,
190 #endif
191         oleautomation
192     ]
193     interface IKindaEnumWidget : IUnknown
194     {
195         HRESULT Next(
196                      [out] IWidget **widget);
197
198         HRESULT Count(
199                       [out] unsigned long *count);
200
201         HRESULT Reset();
202
203         HRESULT Clone(
204                       [out] IKindaEnumWidget **ppenum);
205     }
206
207     [
208         odl,
209         uuid(a028db06-30f0-4b93-b17a-41c72f831d84),
210     ]
211     interface INonOleAutomation : IUnknown
212     {
213         [id(DISPID_NOA_BSTRRET)]
214         BSTR BstrRet();
215
216         [id(DISPID_NOA_ERROR)]
217         HRESULT Error();
218     }
219
220
221     [
222         dllname("comm.drv"),
223         uuid(d377f60b-8639-4261-8ee7-75c8340d2cc9),
224     ]
225     module BadModule
226     {
227         [
228             entry("Foo"),
229         ]
230         HRESULT BadModuleFoo();
231     };
232
233     [
234         dllname("oleaut32.dll"),
235         uuid(d377f60c-8639-4261-8ee7-75c8340d2cc9),
236     ]
237     module BadEntry
238     {
239         [
240             entry("Foo"),
241         ]
242         HRESULT BadEntryFoo();
243     };
244
245     [
246         uuid(bb171948-10ec-407a-9a57-2f85f797ff1a),
247         appobject,
248     ]
249     coclass ApplicationObject2
250     {
251         interface IWidget;
252         [source] interface IWidget;
253     };
254
255     [
256         odl,
257         uuid(375f8a9d-33d0-44f3-b972-61f8407899e0)
258     ]
259         interface ItestIF1 : IUnknown
260     {
261         HRESULT fn1([in] int x);
262         HRESULT fn2([out,retval] int *x);
263     }
264
265     [
266         odl,
267         uuid(094056a3-666f-4956-be12-1859668310b8)
268     ]
269     interface ItestIF2 : ItestIF1
270     {
271         HRESULT fn3([in] int y);
272     }
273
274     [
275         odl,
276         uuid(33baba09-2e68-43ab-81fe-d84b403df2e5)
277     ]
278     dispinterface ItestIF3
279     {
280         interface ItestIF2;
281     }
282
283     [
284         odl,
285         uuid(a01005c7-7491-42eb-94f3-668e37ce60a6)
286     ]
287     dispinterface ItestIF4
288     {
289         properties:
290         methods:
291         [id(0x1c)] HRESULT fn([in] int z);
292     }
293
294     [
295         odl,
296         uuid(4ab61e25-c09f-4239-8f7f-7a018ea0199f),
297         dual
298     ]
299     interface ItestIF5 : ItestIF2
300     {
301         [id(0x1234)] HRESULT fn4([in] int a);
302         [id(0x1235)] HRESULT fn5([in] int a);
303     }
304
305     [
306         odl,
307         uuid(ec236d8e-2cc7-44f2-b394-36c86ff3da74)
308     ]
309     interface ItestIF6 : IDispatch
310     {
311         [id(0x1234)] HRESULT fn4([in] int a);
312         [id(0x1235)] HRESULT fn5([in] int a);
313     }
314
315     [
316         odl,
317         uuid(f711b105-554d-4751-818c-46fcc5d7c0d5),
318         dual
319     ]
320     interface ItestIF7 : ItestIF6
321     {
322         [id(0x1236)] HRESULT fn6([in] GUID a);
323     }
324
325     [
326         odl,
327         uuid(bdfa260b-ef40-43d3-b071-cddec919f132)
328     ]
329         interface ItestIF8
330     {
331         HRESULT fn1([in] int x);
332         HRESULT fn2([out,retval] int *x);
333     }
334
335     [
336         odl,
337         uuid(51033a23-dc37-4f19-aa34-4d8a670458a0)
338
339     ]
340     interface ItestIF9 : ItestIF8
341     {
342         HRESULT fn3([in] int y);
343     }
344
345     [
346         odl,
347         uuid(2e8f14fe-0bce-42f0-8b7d-3af8393c7967)
348     ]
349     dispinterface ItestIF10
350     {
351         interface ItestIF9;
352     }
353
354     [
355         odl,
356         uuid(7d9e9371-482e-4944-9b19-511fc705236f)
357     ]
358     dispinterface ItestIF11
359     {
360         interface ItestIF7;
361     }
362
363 };