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_INVOKEVERSIONING 0x00004000")
45 cpp_quote
("#define SCRIPTPROP_HACK_FIBERSUPPORT 0x70000000")
46 cpp_quote
("#define SCRIPTPROP_HACK_TRIDENTEVENTSINK 0x70000001")
47 cpp_quote
("#define SCRIPTPROP_ABBREVIATE_GLOBALNAME_RESOLUTION 0x70000002")
49 typedef enum tagSCRIPTLANGUAGEVERSION
{
50 SCRIPTLANGUAGEVERSION_DEFAULT
= 0,
51 SCRIPTLANGUAGEVERSION_5_7
= 1,
52 SCRIPTLANGUAGEVERSION_5_8
= 2,
53 SCRIPTLANGUAGEVERSION_MAX
= 255
54 } SCRIPTLANGUAGEVERSION
;
56 typedef enum tagSCRIPTSTATE
{
57 SCRIPTSTATE_UNINITIALIZED
= 0,
58 SCRIPTSTATE_STARTED
= 1,
59 SCRIPTSTATE_CONNECTED
= 2,
60 SCRIPTSTATE_DISCONNECTED
= 3,
61 SCRIPTSTATE_CLOSED
= 4,
62 SCRIPTSTATE_INITIALIZED
= 5
65 typedef enum tagSCRIPTTHREADSTATE
{
66 SCRIPTTHREADSTATE_NOTINSCRIPT
= 0,
67 SCRIPTTHREADSTATE_RUNNING
= 1
70 typedef enum tagSCRIPTUICITEM
{
71 SCRIPTUICITEM_INPUTBOX
= 1,
72 SCRIPTUICITEM_MSGBOX
= 2
75 typedef enum tagSCRIPTUICHANDLING
{
76 SCRIPTUICHANDLING_ALLOW
= 0,
77 SCRIPTUICHANDLING_NOUIERROR
= 1,
78 SCRIPTUICHANDLING_NOUIDEFAULT
= 2
81 typedef enum tagSCRIPTGCTYPE
{
82 SCRIPTGCTYPE_NORMAL
= 0,
83 SCRIPTGCTYPE_EXHAUSTIVE
= 1
86 typedef DWORD SCRIPTTHREADID
;
87 cpp_quote
("#define SCRIPTTHREADID_CURRENT ((SCRIPTTHREADID)-1)")
88 cpp_quote
("#define SCRIPTTHREADID_BASE ((SCRIPTTHREADID)-2)")
89 cpp_quote
("#define SCRIPTTHREADID_ALL ((SCRIPTTHREADID)-3)")
91 cpp_quote
("#define SCRIPTITEM_ISVISIBLE 0x00000002")
92 cpp_quote
("#define SCRIPTITEM_ISSOURCE 0x00000004")
93 cpp_quote
("#define SCRIPTITEM_GLOBALMEMBERS 0x00000008")
94 cpp_quote
("#define SCRIPTITEM_ISPERSISTENT 0x00000040")
95 cpp_quote
("#define SCRIPTITEM_CODEONLY 0x00000200")
96 cpp_quote
("#define SCRIPTITEM_NOCODE 0x00000400")
97 cpp_quote
("#define SCRIPTITEM_ALL_FLAGS (SCRIPTITEM_ISSOURCE | \\")
98 cpp_quote
(" SCRIPTITEM_ISVISIBLE | \\")
99 cpp_quote
(" SCRIPTITEM_ISPERSISTENT | \\")
100 cpp_quote
(" SCRIPTITEM_GLOBALMEMBERS | \\")
101 cpp_quote
(" SCRIPTITEM_NOCODE | \\")
102 cpp_quote
(" SCRIPTITEM_CODEONLY)")
103 cpp_quote
("#define SCRIPTTYPELIB_ISCONTROL 0x00000010")
104 cpp_quote
("#define SCRIPTTYPELIB_ISPERSISTENT 0x00000040")
105 cpp_quote
("#define SCRIPTTYPELIB_ALL_FLAGS (SCRIPTTEXT_ISCONTROL | SCRIPTTYPELIB_ISPERSISTENT)")
106 cpp_quote
("#define SCRIPTTEXT_DELAYEXECUTION 0x00000001")
107 cpp_quote
("#define SCRIPTTEXT_ISVISIBLE 0x00000002")
108 cpp_quote
("#define SCRIPTTEXT_ISEXPRESSION 0x00000020")
109 cpp_quote
("#define SCRIPTTEXT_ISPERSISTENT 0x00000040")
110 cpp_quote
("#define SCRIPTTEXT_HOSTMANAGESSOURCE 0x00000080")
111 cpp_quote
("#define SCRIPTTEXT_ALL_FLAGS (SCRIPTTEXT_DELAYEXECUTION | \\")
112 cpp_quote
(" SCRIPTTEXT_ISVISIBLE | \\")
113 cpp_quote
(" SCRIPTTEXT_ISEXPRESSION | \\")
114 cpp_quote
(" SCRIPTTEXT_ISPERSISTENT | \\")
115 cpp_quote
(" SCRIPTTEXT_HOSTMANAGESSOURCE)")
116 cpp_quote
("#define SCRIPTPROC_ISEXPRESSION 0x00000020")
117 cpp_quote
("#define SCRIPTPROC_HOSTMANAGESSOURCE 0x00000080")
118 cpp_quote
("#define SCRIPTPROC_IMPLICIT_THIS 0x00000100")
119 cpp_quote
("#define SCRIPTPROC_IMPLICIT_PARENTS 0x00000200")
120 cpp_quote
("#define SCRIPTPROC_ALL_FLAGS (SCRIPTPROC_ISEXPRESSION | \\")
121 cpp_quote
(" SCRIPTPROC_HOSTMANAGESSOURCE | \\")
122 cpp_quote
(" SCRIPTPROC_IMPLICIT_THIS | \\")
123 cpp_quote
(" SCRIPTPROC_IMPLICIT_PARENTS)")
124 cpp_quote
("#define SCRIPTINFO_IUNKNOWN 0x00000001")
125 cpp_quote
("#define SCRIPTINFO_ITYPEINFO 0x00000002")
126 cpp_quote
("#define SCRIPTINFO_ALL_FLAGS (SCRIPTINFO_IUNKNOWN | SCRIPTINFO_ITYPEINFO)")
127 cpp_quote
("#define SCRIPTINTERRUPT_DEBUG 0x00000001")
128 cpp_quote
("#define SCRIPTINTERRUPT_RAISEEXCEPTION 0x00000002")
129 cpp_quote
("#define SCRIPTINTERRUPT_ALL_FLAGS (SCRIPTINTERRUPT_DEBUG | SCRIPTINTERRUPT_RAISEEXCEPTION)")
130 cpp_quote
("#define SCRIPTSTAT_STATEMENT_COUNT 1")
131 cpp_quote
("#define SCRIPTSTAT_INSTRUCTION_COUNT 2")
132 cpp_quote
("#define SCRIPTSTAT_INTSTRUCTION_TIME 3")
133 cpp_quote
("#define SCRIPTSTAT_TOTAL_TIME 4")
135 cpp_quote
("#define SCRIPT_E_RECORDED 0x86664004")
136 cpp_quote
("#define SCRIPT_E_REPORTED 0x80020101")
137 cpp_quote
("#define SCRIPT_E_PROPAGATE 0x80020102")
141 uuid(EAE1BA61
-A4ED
-11cf
-8F20
-00805F2CD064
),
142 pointer_default(unique)
144 interface IActiveScriptError
: IUnknown
146 HRESULT GetExceptionInfo
(
147 [out] EXCEPINFO
*pexcepinfo
150 HRESULT GetSourcePosition
(
151 [out] DWORD
*pdwSourceContext
,
152 [out] ULONG
*pulLineNumber
,
153 [out] LONG *plCharacterPosition
156 HRESULT GetSourceLineText
(
157 [out] BSTR *pbstrSourceLine
163 uuid(DB01A1E3
-A42B
-11cf
-8F20
-00805F2CD064
),
164 pointer_default(unique)
166 interface IActiveScriptSite
: IUnknown
172 [in] LPCOLESTR pstrName
,
173 [in] DWORD dwReturnMask
,
174 [out] IUnknown
**ppiunkItem
,
175 [out] ITypeInfo
**ppti
178 HRESULT GetDocVersionString
(
179 [out] BSTR *pbstrVersion
182 HRESULT OnScriptTerminate
(
183 [in] const VARIANT *pvarResult
,
184 [in] const EXCEPINFO
*pexcepinfo
187 HRESULT OnStateChange
(
188 [in] SCRIPTSTATE ssScriptState
191 HRESULT OnScriptError
(
192 [in] IActiveScriptError
*pscripterror
195 HRESULT OnEnterScript
(void);
197 HRESULT OnLeaveScript
(void);
200 cpp_quote
("typedef IActiveScriptSite *PIActiveScriptSite;")
204 uuid(D10F6761
-83E9
-11cf
-8F20
-00805F2CD064
),
205 pointer_default(unique)
207 interface IActiveScriptSiteWindow
: IUnknown
213 HRESULT EnableModeless
(
220 uuid(aedae97e
-d7ee
-4796-b960
-7f092ae844ab
),
221 pointer_default(unique)
223 interface IActiveScriptSiteUIControl
: IUnknown
225 HRESULT GetUIBehavior
(
226 [in] SCRIPTUICITEM UicItem
,
227 [out] SCRIPTUICHANDLING
*pUicHandling
);
232 uuid(539698A0
-CDCA
-11CF
-A5EB
-00AA0047A063
),
233 pointer_default(unique)
235 interface IActiveScriptSiteInterruptPoll
: IUnknown
237 HRESULT QueryContinue
();
242 uuid(BB1A2AE1
-A4F9
-11cf
-8F20
-00805F2CD064
),
243 pointer_default(unique)
245 interface IActiveScript
: IUnknown
247 HRESULT SetScriptSite
(
248 [in] IActiveScriptSite
*pass
251 HRESULT GetScriptSite
(
253 [out, iid_is(riid
)] void **ppvObject
256 HRESULT SetScriptState
(
260 HRESULT GetScriptState
(
261 [out] SCRIPTSTATE
*pssState
266 HRESULT AddNamedItem
(
267 [in] LPCOLESTR pstrName
,
272 [in] REFGUID rguidTypeLib
,
278 HRESULT GetScriptDispatch
(
279 [in] LPCOLESTR pstrItemName
,
280 [out] IDispatch
**ppdisp
283 HRESULT GetCurrentScriptThreadID
(
284 [out] SCRIPTTHREADID
*pstidThread
287 HRESULT GetScriptThreadID
(
288 [in] DWORD dwWin32ThreadId
,
289 [out] SCRIPTTHREADID
*pstidThread
292 HRESULT GetScriptThreadState
(
293 [in] SCRIPTTHREADID stidThread
,
294 [out] SCRIPTTHREADSTATE
*pstsState
297 HRESULT InterruptScriptThread
(
298 [in] SCRIPTTHREADID stidThread
,
299 [in] const EXCEPINFO
*pexcepinfo
,
304 [out] IActiveScript
**ppscript
308 cpp_quote
("typedef IActiveScript *PIActiveScript;")
312 uuid(BB1A2AE2
-A4F9
-11cf
-8F20
-00805F2CD064
),
313 pointer_default(unique)
315 interface IActiveScriptParse32
: IUnknown
317 HRESULT InitNew
(void);
319 HRESULT AddScriptlet
(
320 [in] LPCOLESTR pstrDefaultName
,
321 [in] LPCOLESTR pstrCode
,
322 [in] LPCOLESTR pstrItemName
,
323 [in] LPCOLESTR pstrSubItemName
,
324 [in] LPCOLESTR pstrEventName
,
325 [in] LPCOLESTR pstrDelimiter
,
326 [in] DWORD dwSourceContextCookie
,
327 [in] ULONG ulStartingLineNumber
,
329 [out] BSTR *pbstrName
,
330 [out] EXCEPINFO
*pexcepinfo
333 HRESULT ParseScriptText
(
334 [in] LPCOLESTR pstrCode
,
335 [in] LPCOLESTR pstrItemName
,
336 [in] IUnknown
*punkContext
,
337 [in] LPCOLESTR pstrDelimiter
,
338 [in] DWORD dwSourceContextCookie
,
339 [in] ULONG ulStartingLineNumber
,
341 [out] VARIANT *pvarResult
,
342 [out] EXCEPINFO
*pexcepinfo
348 uuid(c7ef7658
-e1ee
-480e-97ea
-d52cb4d76d17
),
349 pointer_default(unique)
351 interface IActiveScriptParse64
: IUnknown
353 HRESULT InitNew
(void);
355 HRESULT AddScriptlet
(
356 [in] LPCOLESTR pstrDefaultName
,
357 [in] LPCOLESTR pstrCode
,
358 [in] LPCOLESTR pstrItemName
,
359 [in] LPCOLESTR pstrSubItemName
,
360 [in] LPCOLESTR pstrEventName
,
361 [in] LPCOLESTR pstrDelimiter
,
362 [in] DWORDLONG dwSourceContextCookie
,
363 [in] ULONG ulStartingLineNumber
,
365 [out] BSTR *pbstrName
,
366 [out] EXCEPINFO
*pexcepinfo
369 HRESULT ParseScriptText
(
370 [in] LPCOLESTR pstrCode
,
371 [in] LPCOLESTR pstrItemName
,
372 [in] IUnknown
*punkContext
,
373 [in] LPCOLESTR pstrDelimiter
,
374 [in] DWORDLONG dwSourceContextCookie
,
375 [in] ULONG ulStartingLineNumber
,
377 [out] VARIANT *pvarResult
,
378 [out] EXCEPINFO
*pexcepinfo
382 cpp_quote
("#ifdef _WIN64")
383 cpp_quote
("#define IActiveScriptParse IActiveScriptParse64")
384 cpp_quote
("#define IID_IActiveScriptParse IID_IActiveScriptParse64")
386 cpp_quote
("#define IActiveScriptParse IActiveScriptParse32")
387 cpp_quote
("#define IID_IActiveScriptParse IID_IActiveScriptParse32")
390 cpp_quote
("typedef IActiveScriptParse *PIActiveScriptParse;")
394 uuid(1CFF0050
-6FDD
-11d0
-9328-00A0C90DCAA9
),
395 pointer_default(unique)
397 interface IActiveScriptParseProcedureOld32
: IUnknown
399 HRESULT ParseProcedureText
(
400 [in] LPCOLESTR pstrCode
,
401 [in] LPCOLESTR pstrFormalParams
,
402 [in] LPCOLESTR pstrItemName
,
403 [in] IUnknown
*punkContext
,
404 [in] LPCOLESTR pstrDelimiter
,
405 [in] DWORD dwSourceContextCookie
,
406 [in] ULONG ulStartingLineNumber
,
408 [out] IDispatch
**ppdisp
414 uuid(21f57128
-08c9
-4638-ba12
-22d15d88dc5c
),
415 pointer_default(unique)
417 interface IActiveScriptParseProcedureOld64
: IUnknown
419 HRESULT ParseProcedureText
(
420 [in] LPCOLESTR pstrCode
,
421 [in] LPCOLESTR pstrFormalParams
,
422 [in] LPCOLESTR pstrItemName
,
423 [in] IUnknown
*punkContext
,
424 [in] LPCOLESTR pstrDelimiter
,
425 [in] DWORDLONG dwSourceContextCookie
,
426 [in] ULONG ulStartingLineNumber
,
428 [out] IDispatch
**ppdisp
432 cpp_quote
("#ifdef _WIN64")
433 cpp_quote
("#define IActiveScriptParseProcedureOld IActiveScriptParseProcedureOld64")
434 cpp_quote
("#define IID_IActiveScriptParseProcedureOld IID_IActiveScriptParseProcedureOld64")
436 cpp_quote
("#define IActiveScriptParseProcedureOld IActiveScriptParseProcedureOld32")
437 cpp_quote
("#define IID_IActiveScriptParseProcedureOld IID_IActiveScriptParseProcedureOld32")
442 uuid(AA5B6A80
-B834
-11d0
-932F
-00A0C90DCAA9
),
443 pointer_default(unique)
445 interface IActiveScriptParseProcedure32
: IUnknown
447 HRESULT ParseProcedureText
(
448 [in] LPCOLESTR pstrCode
,
449 [in] LPCOLESTR pstrFormalParams
,
450 [in] LPCOLESTR pstrProcedureName
,
451 [in] LPCOLESTR pstrItemName
,
452 [in] IUnknown
*punkContext
,
453 [in] LPCOLESTR pstrDelimiter
,
454 [in] DWORD dwSourceContextCookie
,
455 [in] ULONG ulStartingLineNumber
,
457 [out] IDispatch
**ppdisp
463 uuid(c64713b6
-e029
-4cc5
-9200-438b72890b6a
),
464 pointer_default(unique)
466 interface IActiveScriptParseProcedure64
: IUnknown
468 HRESULT ParseProcedureText
(
469 [in] LPCOLESTR pstrCode
,
470 [in] LPCOLESTR pstrFormalParams
,
471 [in] LPCOLESTR pstrProcedureName
,
472 [in] LPCOLESTR pstrItemName
,
473 [in] IUnknown
*punkContext
,
474 [in] LPCOLESTR pstrDelimiter
,
475 [in] DWORDLONG dwSourceContextCookie
,
476 [in] ULONG ulStartingLineNumber
,
478 [out] IDispatch
**ppdisp
482 cpp_quote
("#ifdef _WIN64")
483 cpp_quote
("#define IActiveScriptParseProcedure IActiveScriptParseProcedure64")
484 cpp_quote
("#define IID_IActiveScriptParseProcedure IID_IActiveScriptParseProcedure64")
486 cpp_quote
("#define IActiveScriptParseProcedure IActiveScriptParseProcedure32")
487 cpp_quote
("#define IID_IActiveScriptParseProcedure IID_IActiveScriptParseProcedure32")
492 uuid(71ee5b20
-fb04
-11d1
-b3a8
-00a0c911e8b2
),
493 pointer_default(unique)
495 interface IActiveScriptParseProcedure2_32
: IActiveScriptParseProcedure32
501 uuid(fe7c4271
-210c
-448d
-9f54
-76dab7047b28
),
502 pointer_default(unique)
504 interface IActiveScriptParseProcedure2_64
: IActiveScriptParseProcedure64
508 cpp_quote
("#ifdef _WIN64")
509 cpp_quote
("#define IActiveScriptParseProcedure2 IActiveScriptParseProcedure2_64")
510 cpp_quote
("#define IID_IActiveScriptParseProcedure2 IID_IActiveScriptParseProcedure2_64")
512 cpp_quote
("#define IActiveScriptParseProcedure2 IActiveScriptParseProcedure2_32")
513 cpp_quote
("#define IID_IActiveScriptParseProcedure2 IID_IActiveScriptParseProcedure2_32")
518 uuid(63CDBCB0
-C1B1
-11d0
-9336-00A0C90DCAA9
),
519 pointer_default(unique)
521 interface IBindEventHandler
: IUnknown
524 [in] LPCOLESTR pstrEvent
,
525 [in] IDispatch
*pdisp
531 uuid(B8DA6310
-E19B
-11d0
-933C
-00A0C90DCAA9
),
532 pointer_default(unique)
534 interface IActiveScriptStats
: IUnknown
548 HRESULT ResetStats
(void);
553 uuid(4954e0d0
-fbc7
-11d1
-8410-006008c3fbfc
),
554 pointer_default(unique)
556 interface IActiveScriptProperty
: IUnknown
559 [in] DWORD dwProperty
,
560 [in] VARIANT *pvarIndex
,
561 [out] VARIANT *pvarValue
);
564 [in] DWORD dwProperty
,
565 [in] VARIANT *pvarIndex
,
566 [in] VARIANT *pvarValue
);
571 uuid(6aa2c4a0
-2b53
-11d4
-a2a0
-00104bd35090
),
572 pointer_default(unique)
574 interface IActiveScriptGarbageCollector
: IUnknown
576 HRESULT CollectGarbage
(
577 [in] SCRIPTGCTYPE gctype
);