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