include: Change some DWORD to DWORD_PTR in mmddk.h.
[wine] / include / activscp.idl
1 /*
2  * Copyright 2004 Kevin Koltzau
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 #ifndef DO_NO_IMPORTS
20 import "ocidl.idl";
21 import "oleidl.idl";
22 import "oaidl.idl";
23 #endif
24
25 cpp_quote("#ifndef _NO_SCRIPT_GUIDS")
26
27 cpp_quote("DEFINE_GUID(CATID_ActiveScript,       0xf0b7a1a1,0x9847,0x11cf,0x8f,0x20,0x00,0x80,0x5f,0x2c,0xd0,0x64);")
28 cpp_quote("DEFINE_GUID(CATID_ActiveScriptParse,  0xf0b7a1a2,0x9847,0x11cf,0x8f,0x20,0x00,0x80,0x5f,0x2c,0xd0,0x64);")
29 cpp_quote("DEFINE_GUID(CATID_ActiveScriptEncode, 0xf0b7a1a3,0x9847,0x11cf,0x8f,0x20,0x00,0x80,0x5f,0x2c,0xd0,0x64);")
30
31 cpp_quote("#endif")
32
33 cpp_quote("#define SCRIPTPROP_NAME                   0x00000000")
34 cpp_quote("#define SCRIPTPROP_MAJORVERSION           0x00000001")
35 cpp_quote("#define SCRIPTPROP_MINORVERSION           0x00000002")
36 cpp_quote("#define SCRIPTPROP_BUILDNUMBER            0x00000003")
37 cpp_quote("#define SCRIPTPROP_DELAYEDEVENTSINKING    0x00001000")
38 cpp_quote("#define SCRIPTPROP_CATCHEXCEPTION         0x00001001")
39 cpp_quote("#define SCRIPTPROP_CONVERSIONLCID         0x00001002")
40 cpp_quote("#define SCRIPTPROP_HOSTSTACKREQUIRED      0x00001003")
41 cpp_quote("#define SCRIPTPROP_DEBUGGER               0x00001100")
42 cpp_quote("#define SCRIPTPROP_JITDEBUG               0x00001101")
43 cpp_quote("#define SCRIPTPROP_HACK_FIBERSUPPORT      0x70000000")
44 cpp_quote("#define SCRIPTPROP_HACK_TRIDENTEVENTSINK  0x70000001")
45  
46 typedef enum tagSCRIPTSTATE {
47     SCRIPTSTATE_UNINITIALIZED = 0,
48     SCRIPTSTATE_STARTED       = 1,
49     SCRIPTSTATE_CONNECTED     = 2,
50     SCRIPTSTATE_DISCONNECTED  = 3,
51     SCRIPTSTATE_CLOSED        = 4,
52     SCRIPTSTATE_INITIALIZED   = 5
53 } SCRIPTSTATE;
54
55 typedef enum tagSCRIPTTHREADSTATE {
56     SCRIPTTHREADSTATE_NOTINSCRIPT = 0,
57     SCRIPTTHREADSTATE_RUNNING     = 1
58 } SCRIPTTHREADSTATE;
59
60 typedef DWORD SCRIPTTHREADID;
61 cpp_quote("#define SCRIPTTHREADID_CURRENT ((SCRIPTTHREADID)-1)")
62 cpp_quote("#define SCRIPTTHREADID_BASE ((SCRIPTTHREADID)-2)")
63 cpp_quote("#define SCRIPTTHREADID_ALL ((SCRIPTTHREADID)-3)")
64
65 cpp_quote("#define SCRIPTITEM_ISVISIBLE           0x00000002")
66 cpp_quote("#define SCRIPTITEM_ISSOURCE            0x00000004")
67 cpp_quote("#define SCRIPTITEM_GLOBALMEMBERS       0x00000008")
68 cpp_quote("#define SCRIPTITEM_ISPERSISTENT        0x00000040")
69 cpp_quote("#define SCRIPTITEM_CODEONLY            0x00000200")
70 cpp_quote("#define SCRIPTITEM_NOCODE              0x00000400")
71 cpp_quote("#define SCRIPTITEM_ALL_FLAGS           (SCRIPTITEM_ISSOURCE | \\")
72 cpp_quote("                                        SCRIPTITEM_ISVISIBLE | \\")
73 cpp_quote("                                        SCRIPTITEM_ISPERSISTENT | \\")
74 cpp_quote("                                        SCRIPTITEM_GLOBALMEMBERS | \\")
75 cpp_quote("                                        SCRIPTITEM_NOCODE | \\")
76 cpp_quote("                                        SCRIPTITEM_CODEONLY)")
77 cpp_quote("#define SCRIPTTYPELIB_ISCONTROL        0x00000010")
78 cpp_quote("#define SCRIPTTYPELIB_ISPERSISTENT     0x00000040")
79 cpp_quote("#define SCRIPTTYPELIB_ALL_FLAGS        (SCRIPTTEXT_ISCONTROL | SCRIPTTYPELIB_ISPERSISTENT)")
80 cpp_quote("#define SCRIPTTEXT_DELAYEXECUTION      0x00000001")
81 cpp_quote("#define SCRIPTTEXT_ISVISIBLE           0x00000002")
82 cpp_quote("#define SCRIPTTEXT_ISEXPRESSION        0x00000020")
83 cpp_quote("#define SCRIPTTEXT_ISPERSISTENT        0x00000040")
84 cpp_quote("#define SCRIPTTEXT_HOSTMANAGESSOURCE   0x00000080")
85 cpp_quote("#define SCRIPTTEXT_ALL_FLAGS           (SCRIPTTEXT_DELAYEXECUTION | \\")
86 cpp_quote("                                        SCRIPTTEXT_ISVISIBLE | \\")
87 cpp_quote("                                        SCRIPTTEXT_ISEXPRESSION | \\")
88 cpp_quote("                                        SCRIPTTEXT_ISPERSISTENT | \\")
89 cpp_quote("                                        SCRIPTTEXT_HOSTMANAGESSOURCE)")
90 cpp_quote("#define SCRIPTPROC_HOSTMANAGESSOURCE   0x00000080")
91 cpp_quote("#define SCRIPTPROC_IMPLICIT_THIS       0x00000100")
92 cpp_quote("#define SCRIPTPROC_IMPLICIT_PARENTS    0x00000200")
93 cpp_quote("#define SCRIPTPROC_ALL_FLAGS           (SCRIPTPROC_HOSTMANAGESSOURCE | \\")
94 cpp_quote("                                        SCRIPTPROC_IMPLICIT_THIS | \\")
95 cpp_quote("                                        SCRIPTPROC_IMPLICIT_PARENTS)")
96 cpp_quote("#define SCRIPTINFO_IUNKNOWN            0x00000001")
97 cpp_quote("#define SCRIPTINFO_ITYPEINFO           0x00000002")
98 cpp_quote("#define SCRIPTINFO_ALL_FLAGS           (SCRIPTINFO_IUNKNOWN | SCRIPTINFO_ITYPEINFO)")
99 cpp_quote("#define SCRIPTINTERRUPT_DEBUG          0x00000001")
100 cpp_quote("#define SCRIPTINTERRUPT_RAISEEXCEPTION 0x00000002")
101 cpp_quote("#define SCRIPTINTERRUPT_ALL_FLAGS      (SCRIPTINTERRUPT_DEBUG | SCRIPTINTERRUPT_RAISEEXCEPTION)")
102 cpp_quote("#define SCRIPTSTAT_STATEMENT_COUNT      1")
103 cpp_quote("#define SCRIPTSTAT_INSTRUCTION_COUNT    2")
104 cpp_quote("#define SCRIPTSTAT_INTSTRUCTION_TIME    3")
105 cpp_quote("#define SCRIPTSTAT_TOTAL_TIME           4")
106
107 [
108 object,
109 uuid(EAE1BA61-A4ED-11cf-8F20-00805F2CD064),
110 pointer_default(unique)
111 ]
112 interface IActiveScriptError : IUnknown
113 {
114     HRESULT GetExceptionInfo(
115             [out] EXCEPINFO *pexcepinfo
116     );
117     
118     HRESULT GetSourcePosition(
119             [out] DWORD *pdwSourceContext,
120             [out] ULONG *pulLineNumber,
121             [out] LONG *plCharacterPosition
122     );
123     
124     HRESULT GetSourceLineText(
125             [out] BSTR *pbstrSourceLine
126     );
127 }
128
129 [
130 object,
131 uuid(DB01A1E3-A42B-11cf-8F20-00805F2CD064),
132 pointer_default(unique)
133 ]
134 interface IActiveScriptSite : IUnknown
135 {
136     HRESULT GetLCID(
137             [out] LCID *plcid);
138     
139     HRESULT GetItemInfo(
140             [in] LPCOLESTR pstrName,
141             [in] DWORD dwReturnMask,
142             [out] IUnknown **ppiunkItem,
143             [out] ITypeInfo **ppti
144     );
145     
146     HRESULT GetDocVersionString(
147             [out] BSTR *pbstrVersion
148     );
149     
150     HRESULT OnScriptTerminate(
151             [in] const VARIANT *pvarResult,
152             [in] const EXCEPINFO *pexcepinfo
153     );
154     
155     HRESULT OnStateChange(
156             [in] SCRIPTSTATE ssScriptState
157     );
158     
159     HRESULT OnScriptError(
160             [in] IActiveScriptError *pscripterror
161     );
162     
163     HRESULT OnEnterScript(void);
164     
165     HRESULT OnLeaveScript(void);
166 }
167
168 cpp_quote("typedef IActiveScriptSite *PIActiveScriptSite;")
169
170 [
171 object,
172 uuid(D10F6761-83E9-11cf-8F20-00805F2CD064),
173 pointer_default(unique)
174 ]
175 interface IActiveScriptSiteWindow : IUnknown
176 {
177     HRESULT GetWindow(
178             [out] HWND *phwnd
179     );
180
181     HRESULT EnableModeless(
182             [in] BOOL fEnable
183     );
184 }
185
186 [
187 object,
188 uuid(539698A0-CDCA-11CF-A5EB-00AA0047A063),
189 pointer_default(unique)
190 ]
191 interface IActiveScriptSiteInterruptPoll : IUnknown
192 {
193     HRESULT QueryContinue();
194 }
195
196 [
197 object,
198 uuid(BB1A2AE1-A4F9-11cf-8F20-00805F2CD064),
199 pointer_default(unique)
200 ]
201 interface IActiveScript : IUnknown
202 {
203     HRESULT SetScriptSite(
204             [in] IActiveScriptSite *pass
205     );
206
207     HRESULT GetScriptSite(
208             [in] REFIID riid,
209             [out, iid_is(riid)] void **ppvObject
210     );
211
212     HRESULT SetScriptState(
213             [in] SCRIPTSTATE ss
214     );
215
216     HRESULT GetScriptState(
217             [out] SCRIPTSTATE *pssState
218     );
219
220     HRESULT Close(void);
221
222     HRESULT AddNamedItem(
223             [in] LPCOLESTR pstrName,
224             [in] DWORD dwFlags
225     );
226
227     HRESULT AddTypeLib(
228             [in] REFGUID rguidTypeLib,
229             [in] DWORD dwMajor,
230             [in] DWORD dwMinor,
231             [in] DWORD dwFlags
232     );
233
234     HRESULT GetScriptDispatch(
235             [in] LPCOLESTR pstrItemName,
236             [out] IDispatch **ppdisp
237     );
238
239     HRESULT GetCurrentScriptThreadID(
240             [out] SCRIPTTHREADID *pstidThread
241     );
242
243     HRESULT GetScriptThreadID(
244             [in] DWORD dwWin32ThreadId,
245             [out] SCRIPTTHREADID *pstidThread
246     );
247
248     HRESULT GetScriptThreadState(
249             [in] SCRIPTTHREADID stidThread,
250             [out] SCRIPTTHREADSTATE *pstsState
251     );
252
253     HRESULT InterruptScriptThread(
254             [in] SCRIPTTHREADID stidThread,
255             [in] const EXCEPINFO *pexcepinfo,
256             [in] DWORD dwFlags
257     );
258
259     HRESULT Clone(
260             [out] IActiveScript **ppscript
261     );
262 }
263
264 cpp_quote("typedef IActiveScript *PIActiveScript;")
265
266 [
267 object,
268 uuid(BB1A2AE2-A4F9-11cf-8F20-00805F2CD064),
269 pointer_default(unique)
270 ]
271 interface IActiveScriptParse32 : IUnknown
272 {
273     HRESULT InitNew(void);
274
275     HRESULT AddScriptlet(
276             [in] LPCOLESTR pstrDefaultName,
277             [in] LPCOLESTR pstrCode,
278             [in] LPCOLESTR pstrItemName,
279             [in] LPCOLESTR pstrSubItemName,
280             [in] LPCOLESTR pstrEventName,
281             [in] LPCOLESTR pstrDelimiter,
282             [in] DWORD dwSourceContextCookie,
283             [in] ULONG ulStartingLineNumber,
284             [in] DWORD dwFlags,
285             [out] BSTR *pbstrName,
286             [out] EXCEPINFO *pexcepinfo
287     );
288
289     HRESULT ParseScriptText(
290             [in] LPCOLESTR pstrCode,
291             [in] LPCOLESTR pstrItemName,
292             [in] IUnknown *punkContext,
293             [in] LPCOLESTR pstrDelimiter,
294             [in] DWORD dwSourceContextCookie,
295             [in] ULONG ulStartingLineNumber,
296             [in] DWORD dwFlags,
297             [out] VARIANT *pvarResult,
298             [out] EXCEPINFO *pexcepinfo
299     );
300 }
301
302 [
303    object,
304    uuid(c7ef7658-e1ee-480e-97ea-d52cb4d76d17),
305    pointer_default(unique)
306 ]
307 interface IActiveScriptParse64 : IUnknown
308 {
309     HRESULT InitNew(void);
310
311     HRESULT AddScriptlet(
312             [in] LPCOLESTR pstrDefaultName,
313             [in] LPCOLESTR pstrCode,
314             [in] LPCOLESTR pstrItemName,
315             [in] LPCOLESTR pstrSubItemName,
316             [in] LPCOLESTR pstrEventName,
317             [in] LPCOLESTR pstrDelimiter,
318             [in] DWORDLONG dwSourceContextCookie,
319             [in] ULONG ulStartingLineNumber,
320             [in] DWORD dwFlags,
321             [out] BSTR *pbstrName,
322             [out] EXCEPINFO *pexcepinfo
323     );
324
325     HRESULT ParseScriptText(
326             [in] LPCOLESTR pstrCode,
327             [in] LPCOLESTR pstrItemName,
328             [in] IUnknown *punkContext,
329             [in] LPCOLESTR pstrDelimiter,
330             [in] DWORDLONG dwSourceContextCookie,
331             [in] ULONG ulStartingLineNumber,
332             [in] DWORD dwFlags,
333             [out] VARIANT *pvarResult,
334             [out] EXCEPINFO *pexcepinfo
335     );
336 }
337
338 cpp_quote("#ifdef _WIN64")
339 cpp_quote("#define IActiveScriptParse IActiveScriptParse64")
340 cpp_quote("#define IID_IActiveScriptParse IID_IActiveScriptParse64")
341 cpp_quote("#else")
342 cpp_quote("#define IActiveScriptParse IActiveScriptParse32")
343 cpp_quote("#define IID_IActiveScriptParse IID_IActiveScriptParse32")
344 cpp_quote("#endif")
345
346 cpp_quote("typedef IActiveScriptParse *PIActiveScriptParse;")
347
348 [
349 object,
350 uuid(1CFF0050-6FDD-11d0-9328-00A0C90DCAA9),
351 pointer_default(unique)
352 ]
353 interface IActiveScriptParseProcedureOld : IUnknown
354 {
355     HRESULT ParseProcedureText(
356             [in] LPCOLESTR pstrCode,
357             [in] LPCOLESTR pstrFormalParams,
358             [in] LPCOLESTR pstrItemName,
359             [in] IUnknown *punkContext,
360             [in] LPCOLESTR pstrDelimiter,
361             [in] DWORD dwSourceContextCookie,
362             [in] ULONG ulStartingLineNumber,
363             [in] DWORD dwFlags,
364             [out] IDispatch **ppdisp
365     );
366 }
367
368 [
369 object,
370 uuid(AA5B6A80-B834-11d0-932F-00A0C90DCAA9),
371 pointer_default(unique)
372 ]
373 interface IActiveScriptParseProcedure : IUnknown
374 {
375     HRESULT ParseProcedureText(
376             [in] LPCOLESTR pstrCode,
377             [in] LPCOLESTR pstrFormalParams,
378             [in] LPCOLESTR pstrProcedureName,
379             [in] LPCOLESTR pstrItemName,
380             [in] IUnknown *punkContext,
381             [in] LPCOLESTR pstrDelimiter,
382             [in] DWORD dwSourceContextCookie,
383             [in] ULONG ulStartingLineNumber,
384             [in] DWORD dwFlags,
385             [out] IDispatch **ppdisp
386     );
387 }
388
389 [
390     object,
391     uuid(71ee5b20-fb04-11d1-b3a8-00a0c911e8b2),
392     pointer_default(unique)
393 ]
394 interface IActiveScriptParseProcedure2 : IActiveScriptParseProcedure
395 {
396 }
397
398 [
399 object,
400 uuid(63CDBCB0-C1B1-11d0-9336-00A0C90DCAA9),
401 pointer_default(unique)
402 ]
403 interface IBindEventHandler : IUnknown
404 {
405     HRESULT BindHandler(
406             [in] LPCOLESTR pstrEvent,
407             [in] IDispatch *pdisp
408     );
409 }
410
411 [
412 object,
413 uuid(B8DA6310-E19B-11d0-933C-00A0C90DCAA9),
414 pointer_default(unique)
415 ]
416 interface IActiveScriptStats : IUnknown
417 {
418     HRESULT GetStat(
419             [in] DWORD stid,
420             [out] ULONG *pluHi,
421             [out] ULONG *pluLo
422     );
423
424     HRESULT GetStatEx(
425             [in] REFGUID guid,
426             [out] ULONG *pluHi,
427             [out] ULONG *pluLo
428     );
429
430     HRESULT ResetStats(void);
431 }
432
433 [
434     object,
435     uuid(4954e0d0-fbc7-11d1-8410-006008c3fbfc),
436     pointer_default(unique)
437 ]
438 interface IActiveScriptProperty : IUnknown
439 {
440     HRESULT GetProperty(
441             [in] DWORD dwProperty,
442             [in] VARIANT *pvarIndex,
443             [out] VARIANT *pvarValue);
444
445     HRESULT SetProperty(
446             [in] DWORD dwProperty,
447             [in] VARIANT *pvarIndex,
448             [in] VARIANT *pvarValue);
449 }