oleaut32/tests: Make the EXPECT_* macros that take no args more robust.
[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     } MYSTRUCT;
43
44     coclass ApplicationObject2;
45
46     [
47         odl,
48         uuid(12345678-1234-4321-1234-121212121212)
49     ]
50     interface ISomethingFromDispatch : IDispatch
51     {
52         HRESULT anotherfn(void);
53     }
54
55     [
56         odl,
57         oleautomation,
58         dual,
59         uuid(3f7e06fe-0bce-46f0-8b7d-3a68393c7967)
60     ]
61     interface ItestDual : IDispatch
62     {
63         HRESULT test();
64     }
65
66     [
67         odl,
68         uuid(a1f8cae3-c947-4c5f-b57d-c87b9b5f3586),
69         oleautomation,
70         dual
71     ]
72     interface IWidget : IDispatch
73     {
74         [propput, id(DISPID_TM_NAME)]
75         HRESULT Name([in] BSTR name);
76         [propget, id(DISPID_TM_NAME)]
77         HRESULT Name([out, retval] BSTR *name);
78
79         [id(DISPID_TM_DOSOMETHING)]
80         HRESULT DoSomething([in] double number, [out] BSTR *str1, [in, defaultvalue("")] BSTR str2, [in, optional] VARIANT *opt);
81
82         [propget, id(DISPID_TM_STATE)]
83         HRESULT State([out, retval] STATE *state);
84         [propput, id(DISPID_TM_STATE)]
85         HRESULT State([in] STATE state);
86
87         [id(DISPID_TM_MAP)]
88         HRESULT Map([in] BSTR bstrId, [out, retval] BSTR *sValue);
89
90         [id(DISPID_TM_SETOLECOLOR)]
91         HRESULT SetOleColor([in] OLE_COLOR val);
92
93         [id(DISPID_TM_GETOLECOLOR)]
94         HRESULT GetOleColor([out, retval] OLE_COLOR *pVal);
95
96         [propget, id(DISPID_TM_CLONE)]
97         HRESULT Clone([out, retval] IWidget **ppVal);
98
99         [propget, id(DISPID_TM_CLONEDISPATCH)]
100         HRESULT CloneDispatch([out, retval] IDispatch **ppVal);
101
102         [propget, id(DISPID_TM_CLONECOCLASS)]
103         HRESULT CloneCoclass([out, retval] ApplicationObject2 **ppVal);
104
105         [propget, id(DISPID_VALUE)]
106         HRESULT Value([in] VARIANT *value, [out, retval] VARIANT *retval);
107
108         [id(DISPID_TM_ARRAY)]
109         HRESULT Array([in] SAFEARRAY(BSTR) values);
110
111         [id(DISPID_TM_VARARRAYPTR)]
112         HRESULT VariantArrayPtr([in] SAFEARRAY(VARIANT) *values);
113
114         [id(DISPID_TM_VARCARRAY)]
115         HRESULT VariantCArray([in] ULONG count, [in, out] VARIANT values[2]);
116
117         [id(DISPID_TM_VARIANT)]
118         HRESULT Variant([in] VARIANT var);
119
120         [vararg, id(DISPID_TM_VARARG)]
121         HRESULT VarArg([in] int numexpect, [in] SAFEARRAY(VARIANT) values);
122
123         [id(DISPID_TM_STRUCTARGS)]
124         HRESULT StructArgs([in] MYSTRUCT byval, [in] MYSTRUCT *byptr, [in] MYSTRUCT arr[5]);
125
126         [id(DISPID_TM_ERROR)]
127         HRESULT Error();
128
129         [propget, id(DISPID_TM_CLONEINTERFACE)]
130         HRESULT CloneInterface([out, retval] ISomethingFromDispatch **ppVal);
131
132         [id(DISPID_TM_PROP_WITH_LCID), propput]
133         HRESULT prop_with_lcid([in,lcid] long lcid, [in] INT i);
134
135         [id(DISPID_TM_PROP_WITH_LCID), propget]
136         HRESULT prop_with_lcid([in,lcid] long lcid, [out,retval] INT *i);
137
138         [id(DISPID_TM_PROP_INT), propget]
139         HRESULT prop_int([out,retval] INT *i);
140
141         [id(DISPID_TM_PROP_UINT), propget]
142         HRESULT prop_uint([out,retval] UINT *i);
143
144         [id(DISPID_TM_BYREF_UINT)]
145         HRESULT ByRefUInt([in, out] UINT *i);
146
147         [id(DISPID_TM_PROP_OPT_ARG), propput]
148         HRESULT prop_opt_arg([in,optional] INT opt, [in] INT i);
149
150         [id(DISPID_TM_PROP_REQ_ARG), propput]
151         HRESULT prop_req_arg([in] INT req, [in] INT i);
152     }
153
154     [
155         odl,
156         uuid(a1f8cae3-c947-3c5f-a57c-c88b9b6f3586),
157         oleautomation,
158         dual
159     ]
160     interface IStaticWidget : IDispatch
161     {
162         [id(DISPID_TM_TESTDUAL)]
163         HRESULT TestDual([in] ItestDual *p);
164     }
165
166     [
167         odl,
168         uuid(a028db05-30f0-4b93-b17a-41c72f831d84),
169 #if 0 /* FIXME: commented out as causes widl to generate incorrect typelib */
170         dual,
171 #endif
172         oleautomation
173     ]
174     interface IKindaEnumWidget : IUnknown
175     {
176         HRESULT Next(
177                      [out] IWidget **widget);
178
179         HRESULT Count(
180                       [out] unsigned long *count);
181
182         HRESULT Reset();
183
184         HRESULT Clone(
185                       [out] IKindaEnumWidget **ppenum);
186     }
187
188     [
189         odl,
190         uuid(a028db06-30f0-4b93-b17a-41c72f831d84),
191     ]
192     interface INonOleAutomation : IUnknown
193     {
194         [id(DISPID_NOA_BSTRRET)]
195         BSTR BstrRet();
196
197         [id(DISPID_NOA_ERROR)]
198         HRESULT Error();
199     }
200
201
202     [
203         dllname("comm.drv"),
204         uuid(d377f60b-8639-4261-8ee7-75c8340d2cc9),
205     ]
206     module BadModule
207     {
208         [
209             entry("Foo"),
210         ]
211         HRESULT BadModuleFoo();
212     };
213
214     [
215         dllname("oleaut32.dll"),
216         uuid(d377f60c-8639-4261-8ee7-75c8340d2cc9),
217     ]
218     module BadEntry
219     {
220         [
221             entry("Foo"),
222         ]
223         HRESULT BadEntryFoo();
224     };
225
226     [
227         uuid(bb171948-10ec-407a-9a57-2f85f797ff1a),
228         appobject,
229     ]
230     coclass ApplicationObject2
231     {
232         interface IWidget;
233         [source] interface IWidget;
234     };
235
236     [
237         odl,
238         uuid(375f8a9d-33d0-44f3-b972-61f8407899e0)
239     ]
240         interface ItestIF1 : IUnknown
241     {
242         HRESULT fn1([in] int x);
243         HRESULT fn2([out,retval] int *x);
244     }
245
246     [
247         odl,
248         uuid(094056a3-666f-4956-be12-1859668310b8)
249     ]
250     interface ItestIF2 : ItestIF1
251     {
252         HRESULT fn3([in] int y);
253     }
254
255     [
256         odl,
257         uuid(33baba09-2e68-43ab-81fe-d84b403df2e5)
258     ]
259     dispinterface ItestIF3
260     {
261         interface ItestIF2;
262     }
263
264     [
265         odl,
266         uuid(a01005c7-7491-42eb-94f3-668e37ce60a6)
267     ]
268     dispinterface ItestIF4
269     {
270         properties:
271         methods:
272         [id(0x1c)] HRESULT fn([in] int z);
273     }
274
275     [
276         odl,
277         uuid(4ab61e25-c09f-4239-8f7f-7a018ea0199f),
278         dual
279     ]
280     interface ItestIF5 : ItestIF2
281     {
282         [id(0x1234)] HRESULT fn4([in] int a);
283         [id(0x1235)] HRESULT fn5([in] int a);
284     }
285
286     [
287         odl,
288         uuid(ec236d8e-2cc7-44f2-b394-36c86ff3da74)
289     ]
290     interface ItestIF6 : IDispatch
291     {
292         [id(0x1234)] HRESULT fn4([in] int a);
293         [id(0x1235)] HRESULT fn5([in] int a);
294     }
295
296     [
297         odl,
298         uuid(f711b105-554d-4751-818c-46fcc5d7c0d5),
299         dual
300     ]
301     interface ItestIF7 : ItestIF6
302     {
303         [id(0x1236)] HRESULT fn6([in] GUID a);
304     }
305
306     [
307         odl,
308         uuid(bdfa260b-ef40-43d3-b071-cddec919f132)
309     ]
310         interface ItestIF8
311     {
312         HRESULT fn1([in] int x);
313         HRESULT fn2([out,retval] int *x);
314     }
315
316     [
317         odl,
318         uuid(51033a23-dc37-4f19-aa34-4d8a670458a0)
319
320     ]
321     interface ItestIF9 : ItestIF8
322     {
323         HRESULT fn3([in] int y);
324     }
325
326     [
327         odl,
328         uuid(2e8f14fe-0bce-42f0-8b7d-3af8393c7967)
329     ]
330     dispinterface ItestIF10
331     {
332         interface ItestIF9;
333     }
334
335     [
336         odl,
337         uuid(7d9e9371-482e-4944-9b19-511fc705236f)
338     ]
339     dispinterface ItestIF11
340     {
341         interface ItestIF7;
342     }
343
344 };