2 * Copyright 2004 Kevin Koltzau
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.
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.
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
25 cpp_quote("#ifndef _NO_SCRIPT_GUIDS")
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);")
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")
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
55 typedef enum tagSCRIPTTHREADSTATE {
56 SCRIPTTHREADSTATE_NOTINSCRIPT = 0,
57 SCRIPTTHREADSTATE_RUNNING = 1
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)")
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")
109 uuid(EAE1BA61-A4ED-11cf-8F20-00805F2CD064),
110 pointer_default(unique)
112 interface IActiveScriptError : IUnknown
114 HRESULT GetExceptionInfo(
115 [out] EXCEPINFO *pexcepinfo
118 HRESULT GetSourcePosition(
119 [out] DWORD *pdwSourceContext,
120 [out] ULONG *pulLineNumber,
121 [out] LONG *plCharacterPosition
124 HRESULT GetSourceLineText(
125 [out] BSTR *pbstrSourceLine
131 uuid(DB01A1E3-A42B-11cf-8F20-00805F2CD064),
132 pointer_default(unique)
134 interface IActiveScriptSite : IUnknown
140 [in] LPCOLESTR pstrName,
141 [in] DWORD dwReturnMask,
142 [out] IUnknown **ppiunkItem,
143 [out] ITypeInfo **ppti
146 HRESULT GetDocVersionString(
147 [out] BSTR *pbstrVersion
150 HRESULT OnScriptTerminate(
151 [in] const VARIANT *pvarResult,
152 [in] const EXCEPINFO *pexcepinfo
155 HRESULT OnStateChange(
156 [in] SCRIPTSTATE ssScriptState
159 HRESULT OnScriptError(
160 [in] IActiveScriptError *pscripterror
163 HRESULT OnEnterScript(void);
165 HRESULT OnLeaveScript(void);
168 cpp_quote("typedef IActiveScriptSite *PIActiveScriptSite;")
172 uuid(D10F6761-83E9-11cf-8F20-00805F2CD064),
173 pointer_default(unique)
175 interface IActiveScriptSiteWindow : IUnknown
181 HRESULT EnableModeless(
188 uuid(539698A0-CDCA-11CF-A5EB-00AA0047A063),
189 pointer_default(unique)
191 interface IActiveScriptSiteInterruptPoll : IUnknown
193 HRESULT QueryContinue();
198 uuid(BB1A2AE1-A4F9-11cf-8F20-00805F2CD064),
199 pointer_default(unique)
201 interface IActiveScript : IUnknown
203 HRESULT SetScriptSite(
204 [in] IActiveScriptSite *pass
207 HRESULT GetScriptSite(
209 [out, iid_is(riid)] void **ppvObject
212 HRESULT SetScriptState(
216 HRESULT GetScriptState(
217 [out] SCRIPTSTATE *pssState
222 HRESULT AddNamedItem(
223 [in] LPCOLESTR pstrName,
228 [in] REFGUID rguidTypeLib,
234 HRESULT GetScriptDispatch(
235 [in] LPCOLESTR pstrItemName,
236 [out] IDispatch **ppdisp
239 HRESULT GetCurrentScriptThreadID(
240 [out] SCRIPTTHREADID *pstidThread
243 HRESULT GetScriptThreadID(
244 [in] DWORD dwWin32ThreadId,
245 [out] SCRIPTTHREADID *pstidThread
248 HRESULT GetScriptThreadState(
249 [in] SCRIPTTHREADID stidThread,
250 [out] SCRIPTTHREADSTATE *pstsState
253 HRESULT InterruptScriptThread(
254 [in] SCRIPTTHREADID stidThread,
255 [in] const EXCEPINFO *pexcepinfo,
260 [out] IActiveScript **ppscript
264 cpp_quote("typedef IActiveScript *PIActiveScript;")
268 uuid(BB1A2AE2-A4F9-11cf-8F20-00805F2CD064),
269 pointer_default(unique)
271 interface IActiveScriptParse32 : IUnknown
273 HRESULT InitNew(void);
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,
285 [out] BSTR *pbstrName,
286 [out] EXCEPINFO *pexcepinfo
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,
297 [out] VARIANT *pvarResult,
298 [out] EXCEPINFO *pexcepinfo
304 uuid(c7ef7658-e1ee-480e-97ea-d52cb4d76d17),
305 pointer_default(unique)
307 interface IActiveScriptParse64 : IUnknown
309 HRESULT InitNew(void);
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,
321 [out] BSTR *pbstrName,
322 [out] EXCEPINFO *pexcepinfo
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,
333 [out] VARIANT *pvarResult,
334 [out] EXCEPINFO *pexcepinfo
338 cpp_quote("#ifdef _WIN64")
339 cpp_quote("#define IActiveScriptParse IActiveScriptParse64")
340 cpp_quote("#define IID_IActiveScriptParse IID_IActiveScriptParse64")
342 cpp_quote("#define IActiveScriptParse IActiveScriptParse32")
343 cpp_quote("#define IID_IActiveScriptParse IID_IActiveScriptParse32")
346 cpp_quote("typedef IActiveScriptParse *PIActiveScriptParse;")
350 uuid(1CFF0050-6FDD-11d0-9328-00A0C90DCAA9),
351 pointer_default(unique)
353 interface IActiveScriptParseProcedureOld32 : IUnknown
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,
364 [out] IDispatch **ppdisp
370 uuid(21f57128-08c9-4638-ba12-22d15d88dc5c),
371 pointer_default(unique)
373 interface IActiveScriptParseProcedureOld64 : IUnknown
375 HRESULT ParseProcedureText(
376 [in] LPCOLESTR pstrCode,
377 [in] LPCOLESTR pstrFormalParams,
378 [in] LPCOLESTR pstrItemName,
379 [in] IUnknown *punkContext,
380 [in] LPCOLESTR pstrDelimiter,
381 [in] DWORDLONG dwSourceContextCookie,
382 [in] ULONG ulStartingLineNumber,
384 [out] IDispatch **ppdisp
388 cpp_quote("#ifdef _WIN64")
389 cpp_quote("#define IActiveScriptParseProcedureOld IActiveScriptParseProcedureOld64")
390 cpp_quote("#define IID_IActiveScriptParseProcedureOld IID_IActiveScriptParseProcedureOld64")
392 cpp_quote("#define IActiveScriptParseProcedureOld IActiveScriptParseProcedureOld32")
393 cpp_quote("#define IID_IActiveScriptParseProcedureOld IID_IActiveScriptParseProcedureOld32")
398 uuid(AA5B6A80-B834-11d0-932F-00A0C90DCAA9),
399 pointer_default(unique)
401 interface IActiveScriptParseProcedure32 : IUnknown
403 HRESULT ParseProcedureText(
404 [in] LPCOLESTR pstrCode,
405 [in] LPCOLESTR pstrFormalParams,
406 [in] LPCOLESTR pstrProcedureName,
407 [in] LPCOLESTR pstrItemName,
408 [in] IUnknown *punkContext,
409 [in] LPCOLESTR pstrDelimiter,
410 [in] DWORD dwSourceContextCookie,
411 [in] ULONG ulStartingLineNumber,
413 [out] IDispatch **ppdisp
419 uuid(c64713b6-e029-4cc5-9200-438b72890b6a),
420 pointer_default(unique)
422 interface IActiveScriptParseProcedure64 : IUnknown
424 HRESULT ParseProcedureText(
425 [in] LPCOLESTR pstrCode,
426 [in] LPCOLESTR pstrFormalParams,
427 [in] LPCOLESTR pstrProcedureName,
428 [in] LPCOLESTR pstrItemName,
429 [in] IUnknown *punkContext,
430 [in] LPCOLESTR pstrDelimiter,
431 [in] DWORDLONG dwSourceContextCookie,
432 [in] ULONG ulStartingLineNumber,
434 [out] IDispatch **ppdisp
438 cpp_quote("#ifdef _WIN64")
439 cpp_quote("#define IActiveScriptParseProcedure IActiveScriptParseProcedure64")
440 cpp_quote("#define IID_IActiveScriptParseProcedure IID_IActiveScriptParseProcedure64")
442 cpp_quote("#define IActiveScriptParseProcedure IActiveScriptParseProcedure32")
443 cpp_quote("#define IID_IActiveScriptParseProcedure IID_IActiveScriptParseProcedure32")
448 uuid(71ee5b20-fb04-11d1-b3a8-00a0c911e8b2),
449 pointer_default(unique)
451 interface IActiveScriptParseProcedure2_32 : IActiveScriptParseProcedure32
457 uuid(fe7c4271-210c-448d-9f54-76dab7047b28),
458 pointer_default(unique)
460 interface IActiveScriptParseProcedure2_64 : IActiveScriptParseProcedure64
464 cpp_quote("#ifdef _WIN64")
465 cpp_quote("#define IActiveScriptParseProcedure2 IActiveScriptParseProcedure2_64")
466 cpp_quote("#define IID_IActiveScriptParseProcedure2 IID_IActiveScriptParseProcedure2_64")
468 cpp_quote("#define IActiveScriptParseProcedure2 IActiveScriptParseProcedure2_32")
469 cpp_quote("#define IID_IActiveScriptParseProcedure2 IID_IActiveScriptParseProcedure2_32")
474 uuid(63CDBCB0-C1B1-11d0-9336-00A0C90DCAA9),
475 pointer_default(unique)
477 interface IBindEventHandler : IUnknown
480 [in] LPCOLESTR pstrEvent,
481 [in] IDispatch *pdisp
487 uuid(B8DA6310-E19B-11d0-933C-00A0C90DCAA9),
488 pointer_default(unique)
490 interface IActiveScriptStats : IUnknown
504 HRESULT ResetStats(void);
509 uuid(4954e0d0-fbc7-11d1-8410-006008c3fbfc),
510 pointer_default(unique)
512 interface IActiveScriptProperty : IUnknown
515 [in] DWORD dwProperty,
516 [in] VARIANT *pvarIndex,
517 [out] VARIANT *pvarValue);
520 [in] DWORD dwProperty,
521 [in] VARIANT *pvarIndex,
522 [in] VARIANT *pvarValue);