activscp.idl 16.6 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/*
 * Copyright 2004 Kevin Koltzau
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * 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 21 22
import "ocidl.idl";
import "oleidl.idl";
import "oaidl.idl";
23
#endif
24 25 26 27 28 29 30 31

cpp_quote("#ifndef _NO_SCRIPT_GUIDS")

cpp_quote("DEFINE_GUID(CATID_ActiveScript,       0xf0b7a1a1,0x9847,0x11cf,0x8f,0x20,0x00,0x80,0x5f,0x2c,0xd0,0x64);")
cpp_quote("DEFINE_GUID(CATID_ActiveScriptParse,  0xf0b7a1a2,0x9847,0x11cf,0x8f,0x20,0x00,0x80,0x5f,0x2c,0xd0,0x64);")
cpp_quote("DEFINE_GUID(CATID_ActiveScriptEncode, 0xf0b7a1a3,0x9847,0x11cf,0x8f,0x20,0x00,0x80,0x5f,0x2c,0xd0,0x64);")

cpp_quote("#endif")
32 33 34 35 36 37 38 39 40 41 42

cpp_quote("#define SCRIPTPROP_NAME                   0x00000000")
cpp_quote("#define SCRIPTPROP_MAJORVERSION           0x00000001")
cpp_quote("#define SCRIPTPROP_MINORVERSION           0x00000002")
cpp_quote("#define SCRIPTPROP_BUILDNUMBER            0x00000003")
cpp_quote("#define SCRIPTPROP_DELAYEDEVENTSINKING    0x00001000")
cpp_quote("#define SCRIPTPROP_CATCHEXCEPTION         0x00001001")
cpp_quote("#define SCRIPTPROP_CONVERSIONLCID         0x00001002")
cpp_quote("#define SCRIPTPROP_HOSTSTACKREQUIRED      0x00001003")
cpp_quote("#define SCRIPTPROP_DEBUGGER               0x00001100")
cpp_quote("#define SCRIPTPROP_JITDEBUG               0x00001101")
43 44 45 46 47
cpp_quote("#define SCRIPTPROP_INVOKEVERSIONING       0x00004000")

cpp_quote("#define SCRIPTPROP_HACK_FIBERSUPPORT                0x70000000")
cpp_quote("#define SCRIPTPROP_HACK_TRIDENTEVENTSINK            0x70000001")
cpp_quote("#define SCRIPTPROP_ABBREVIATE_GLOBALNAME_RESOLUTION 0x70000002")
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
 
typedef enum tagSCRIPTSTATE {
    SCRIPTSTATE_UNINITIALIZED = 0,
    SCRIPTSTATE_STARTED       = 1,
    SCRIPTSTATE_CONNECTED     = 2,
    SCRIPTSTATE_DISCONNECTED  = 3,
    SCRIPTSTATE_CLOSED        = 4,
    SCRIPTSTATE_INITIALIZED   = 5
} SCRIPTSTATE;

typedef enum tagSCRIPTTHREADSTATE {
    SCRIPTTHREADSTATE_NOTINSCRIPT = 0,
    SCRIPTTHREADSTATE_RUNNING     = 1
} SCRIPTTHREADSTATE;

63 64 65 66 67 68 69 70 71 72 73
typedef enum tagSCRIPTUICITEM {
    SCRIPTUICITEM_INPUTBOX = 1,
    SCRIPTUICITEM_MSGBOX   = 2
} SCRIPTUICITEM;

typedef enum tagSCRIPTUICHANDLING {
    SCRIPTUICHANDLING_ALLOW       = 0,
    SCRIPTUICHANDLING_NOUIERROR   = 1,
    SCRIPTUICHANDLING_NOUIDEFAULT = 2
} SCRIPTUICHANDLING;

74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199
typedef DWORD SCRIPTTHREADID;
cpp_quote("#define SCRIPTTHREADID_CURRENT ((SCRIPTTHREADID)-1)")
cpp_quote("#define SCRIPTTHREADID_BASE ((SCRIPTTHREADID)-2)")
cpp_quote("#define SCRIPTTHREADID_ALL ((SCRIPTTHREADID)-3)")

cpp_quote("#define SCRIPTITEM_ISVISIBLE           0x00000002")
cpp_quote("#define SCRIPTITEM_ISSOURCE            0x00000004")
cpp_quote("#define SCRIPTITEM_GLOBALMEMBERS       0x00000008")
cpp_quote("#define SCRIPTITEM_ISPERSISTENT        0x00000040")
cpp_quote("#define SCRIPTITEM_CODEONLY            0x00000200")
cpp_quote("#define SCRIPTITEM_NOCODE              0x00000400")
cpp_quote("#define SCRIPTITEM_ALL_FLAGS           (SCRIPTITEM_ISSOURCE | \\")
cpp_quote("                                        SCRIPTITEM_ISVISIBLE | \\")
cpp_quote("                                        SCRIPTITEM_ISPERSISTENT | \\")
cpp_quote("                                        SCRIPTITEM_GLOBALMEMBERS | \\")
cpp_quote("                                        SCRIPTITEM_NOCODE | \\")
cpp_quote("                                        SCRIPTITEM_CODEONLY)")
cpp_quote("#define SCRIPTTYPELIB_ISCONTROL        0x00000010")
cpp_quote("#define SCRIPTTYPELIB_ISPERSISTENT     0x00000040")
cpp_quote("#define SCRIPTTYPELIB_ALL_FLAGS        (SCRIPTTEXT_ISCONTROL | SCRIPTTYPELIB_ISPERSISTENT)")
cpp_quote("#define SCRIPTTEXT_DELAYEXECUTION      0x00000001")
cpp_quote("#define SCRIPTTEXT_ISVISIBLE           0x00000002")
cpp_quote("#define SCRIPTTEXT_ISEXPRESSION        0x00000020")
cpp_quote("#define SCRIPTTEXT_ISPERSISTENT        0x00000040")
cpp_quote("#define SCRIPTTEXT_HOSTMANAGESSOURCE   0x00000080")
cpp_quote("#define SCRIPTTEXT_ALL_FLAGS           (SCRIPTTEXT_DELAYEXECUTION | \\")
cpp_quote("                                        SCRIPTTEXT_ISVISIBLE | \\")
cpp_quote("                                        SCRIPTTEXT_ISEXPRESSION | \\")
cpp_quote("                                        SCRIPTTEXT_ISPERSISTENT | \\")
cpp_quote("                                        SCRIPTTEXT_HOSTMANAGESSOURCE)")
cpp_quote("#define SCRIPTPROC_HOSTMANAGESSOURCE   0x00000080")
cpp_quote("#define SCRIPTPROC_IMPLICIT_THIS       0x00000100")
cpp_quote("#define SCRIPTPROC_IMPLICIT_PARENTS    0x00000200")
cpp_quote("#define SCRIPTPROC_ALL_FLAGS           (SCRIPTPROC_HOSTMANAGESSOURCE | \\")
cpp_quote("                                        SCRIPTPROC_IMPLICIT_THIS | \\")
cpp_quote("                                        SCRIPTPROC_IMPLICIT_PARENTS)")
cpp_quote("#define SCRIPTINFO_IUNKNOWN            0x00000001")
cpp_quote("#define SCRIPTINFO_ITYPEINFO           0x00000002")
cpp_quote("#define SCRIPTINFO_ALL_FLAGS           (SCRIPTINFO_IUNKNOWN | SCRIPTINFO_ITYPEINFO)")
cpp_quote("#define SCRIPTINTERRUPT_DEBUG          0x00000001")
cpp_quote("#define SCRIPTINTERRUPT_RAISEEXCEPTION 0x00000002")
cpp_quote("#define SCRIPTINTERRUPT_ALL_FLAGS      (SCRIPTINTERRUPT_DEBUG | SCRIPTINTERRUPT_RAISEEXCEPTION)")
cpp_quote("#define SCRIPTSTAT_STATEMENT_COUNT      1")
cpp_quote("#define SCRIPTSTAT_INSTRUCTION_COUNT    2")
cpp_quote("#define SCRIPTSTAT_INTSTRUCTION_TIME    3")
cpp_quote("#define SCRIPTSTAT_TOTAL_TIME           4")

[
object,
uuid(EAE1BA61-A4ED-11cf-8F20-00805F2CD064),
pointer_default(unique)
]
interface IActiveScriptError : IUnknown
{
    HRESULT GetExceptionInfo(
            [out] EXCEPINFO *pexcepinfo
    );
    
    HRESULT GetSourcePosition(
            [out] DWORD *pdwSourceContext,
            [out] ULONG *pulLineNumber,
            [out] LONG *plCharacterPosition
    );
    
    HRESULT GetSourceLineText(
            [out] BSTR *pbstrSourceLine
    );
}

[
object,
uuid(DB01A1E3-A42B-11cf-8F20-00805F2CD064),
pointer_default(unique)
]
interface IActiveScriptSite : IUnknown
{
    HRESULT GetLCID(
            [out] LCID *plcid);
    
    HRESULT GetItemInfo(
            [in] LPCOLESTR pstrName,
            [in] DWORD dwReturnMask,
            [out] IUnknown **ppiunkItem,
            [out] ITypeInfo **ppti
    );
    
    HRESULT GetDocVersionString(
            [out] BSTR *pbstrVersion
    );
    
    HRESULT OnScriptTerminate(
            [in] const VARIANT *pvarResult,
            [in] const EXCEPINFO *pexcepinfo
    );
    
    HRESULT OnStateChange(
            [in] SCRIPTSTATE ssScriptState
    );
    
    HRESULT OnScriptError(
            [in] IActiveScriptError *pscripterror
    );
    
    HRESULT OnEnterScript(void);
    
    HRESULT OnLeaveScript(void);
}

cpp_quote("typedef IActiveScriptSite *PIActiveScriptSite;")

[
object,
uuid(D10F6761-83E9-11cf-8F20-00805F2CD064),
pointer_default(unique)
]
interface IActiveScriptSiteWindow : IUnknown
{
    HRESULT GetWindow(
            [out] HWND *phwnd
    );

    HRESULT EnableModeless(
            [in] BOOL fEnable
    );
}

200 201 202 203 204 205 206 207 208 209 210 211
[
    object,
    uuid(aedae97e-d7ee-4796-b960-7f092ae844ab),
    pointer_default(unique)
]
interface IActiveScriptSiteUIControl : IUnknown
{
    HRESULT GetUIBehavior(
            [in]  SCRIPTUICITEM UicItem,
            [out] SCRIPTUICHANDLING *pUicHandling);
}

212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296
[
object,
uuid(539698A0-CDCA-11CF-A5EB-00AA0047A063),
pointer_default(unique)
]
interface IActiveScriptSiteInterruptPoll : IUnknown
{
    HRESULT QueryContinue();
}

[
object,
uuid(BB1A2AE1-A4F9-11cf-8F20-00805F2CD064),
pointer_default(unique)
]
interface IActiveScript : IUnknown
{
    HRESULT SetScriptSite(
            [in] IActiveScriptSite *pass
    );

    HRESULT GetScriptSite(
            [in] REFIID riid,
            [out, iid_is(riid)] void **ppvObject
    );

    HRESULT SetScriptState(
            [in] SCRIPTSTATE ss
    );

    HRESULT GetScriptState(
            [out] SCRIPTSTATE *pssState
    );

    HRESULT Close(void);

    HRESULT AddNamedItem(
            [in] LPCOLESTR pstrName,
            [in] DWORD dwFlags
    );

    HRESULT AddTypeLib(
            [in] REFGUID rguidTypeLib,
            [in] DWORD dwMajor,
            [in] DWORD dwMinor,
            [in] DWORD dwFlags
    );

    HRESULT GetScriptDispatch(
            [in] LPCOLESTR pstrItemName,
            [out] IDispatch **ppdisp
    );

    HRESULT GetCurrentScriptThreadID(
            [out] SCRIPTTHREADID *pstidThread
    );

    HRESULT GetScriptThreadID(
            [in] DWORD dwWin32ThreadId,
            [out] SCRIPTTHREADID *pstidThread
    );

    HRESULT GetScriptThreadState(
            [in] SCRIPTTHREADID stidThread,
            [out] SCRIPTTHREADSTATE *pstsState
    );

    HRESULT InterruptScriptThread(
            [in] SCRIPTTHREADID stidThread,
            [in] const EXCEPINFO *pexcepinfo,
            [in] DWORD dwFlags
    );

    HRESULT Clone(
            [out] IActiveScript **ppscript
    );
}

cpp_quote("typedef IActiveScript *PIActiveScript;")

[
object,
uuid(BB1A2AE2-A4F9-11cf-8F20-00805F2CD064),
pointer_default(unique)
]
297
interface IActiveScriptParse32 : IUnknown
298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327
{
    HRESULT InitNew(void);

    HRESULT AddScriptlet(
            [in] LPCOLESTR pstrDefaultName,
            [in] LPCOLESTR pstrCode,
            [in] LPCOLESTR pstrItemName,
            [in] LPCOLESTR pstrSubItemName,
            [in] LPCOLESTR pstrEventName,
            [in] LPCOLESTR pstrDelimiter,
            [in] DWORD dwSourceContextCookie,
            [in] ULONG ulStartingLineNumber,
            [in] DWORD dwFlags,
            [out] BSTR *pbstrName,
            [out] EXCEPINFO *pexcepinfo
    );

    HRESULT ParseScriptText(
            [in] LPCOLESTR pstrCode,
            [in] LPCOLESTR pstrItemName,
            [in] IUnknown *punkContext,
            [in] LPCOLESTR pstrDelimiter,
            [in] DWORD dwSourceContextCookie,
            [in] ULONG ulStartingLineNumber,
            [in] DWORD dwFlags,
            [out] VARIANT *pvarResult,
            [out] EXCEPINFO *pexcepinfo
    );
}

328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371
[
   object,
   uuid(c7ef7658-e1ee-480e-97ea-d52cb4d76d17),
   pointer_default(unique)
]
interface IActiveScriptParse64 : IUnknown
{
    HRESULT InitNew(void);

    HRESULT AddScriptlet(
            [in] LPCOLESTR pstrDefaultName,
            [in] LPCOLESTR pstrCode,
            [in] LPCOLESTR pstrItemName,
            [in] LPCOLESTR pstrSubItemName,
            [in] LPCOLESTR pstrEventName,
            [in] LPCOLESTR pstrDelimiter,
            [in] DWORDLONG dwSourceContextCookie,
            [in] ULONG ulStartingLineNumber,
            [in] DWORD dwFlags,
            [out] BSTR *pbstrName,
            [out] EXCEPINFO *pexcepinfo
    );

    HRESULT ParseScriptText(
            [in] LPCOLESTR pstrCode,
            [in] LPCOLESTR pstrItemName,
            [in] IUnknown *punkContext,
            [in] LPCOLESTR pstrDelimiter,
            [in] DWORDLONG dwSourceContextCookie,
            [in] ULONG ulStartingLineNumber,
            [in] DWORD dwFlags,
            [out] VARIANT *pvarResult,
            [out] EXCEPINFO *pexcepinfo
    );
}

cpp_quote("#ifdef _WIN64")
cpp_quote("#define IActiveScriptParse IActiveScriptParse64")
cpp_quote("#define IID_IActiveScriptParse IID_IActiveScriptParse64")
cpp_quote("#else")
cpp_quote("#define IActiveScriptParse IActiveScriptParse32")
cpp_quote("#define IID_IActiveScriptParse IID_IActiveScriptParse32")
cpp_quote("#endif")

372 373 374 375 376 377 378
cpp_quote("typedef IActiveScriptParse *PIActiveScriptParse;")

[
object,
uuid(1CFF0050-6FDD-11d0-9328-00A0C90DCAA9),
pointer_default(unique)
]
379
interface IActiveScriptParseProcedureOld32 : IUnknown
380 381 382 383 384 385 386 387 388 389 390 391 392 393
{
    HRESULT ParseProcedureText(
            [in] LPCOLESTR pstrCode,
            [in] LPCOLESTR pstrFormalParams,
            [in] LPCOLESTR pstrItemName,
            [in] IUnknown *punkContext,
            [in] LPCOLESTR pstrDelimiter,
            [in] DWORD dwSourceContextCookie,
            [in] ULONG ulStartingLineNumber,
            [in] DWORD dwFlags,
            [out] IDispatch **ppdisp
    );
}

394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421
[
    object,
    uuid(21f57128-08c9-4638-ba12-22d15d88dc5c),
    pointer_default(unique)
]
interface IActiveScriptParseProcedureOld64 : IUnknown
{
    HRESULT ParseProcedureText(
            [in] LPCOLESTR pstrCode,
            [in] LPCOLESTR pstrFormalParams,
            [in] LPCOLESTR pstrItemName,
            [in] IUnknown *punkContext,
            [in] LPCOLESTR pstrDelimiter,
            [in] DWORDLONG dwSourceContextCookie,
            [in] ULONG ulStartingLineNumber,
            [in] DWORD dwFlags,
            [out] IDispatch **ppdisp
    );
}

cpp_quote("#ifdef _WIN64")
cpp_quote("#define IActiveScriptParseProcedureOld IActiveScriptParseProcedureOld64")
cpp_quote("#define IID_IActiveScriptParseProcedureOld IID_IActiveScriptParseProcedureOld64")
cpp_quote("#else")
cpp_quote("#define IActiveScriptParseProcedureOld IActiveScriptParseProcedureOld32")
cpp_quote("#define IID_IActiveScriptParseProcedureOld IID_IActiveScriptParseProcedureOld32")
cpp_quote("#endif")

422 423 424 425 426
[
object,
uuid(AA5B6A80-B834-11d0-932F-00A0C90DCAA9),
pointer_default(unique)
]
427
interface IActiveScriptParseProcedure32 : IUnknown
428 429 430 431 432 433 434 435 436 437 438 439 440 441 442
{
    HRESULT ParseProcedureText(
            [in] LPCOLESTR pstrCode,
            [in] LPCOLESTR pstrFormalParams,
            [in] LPCOLESTR pstrProcedureName,
            [in] LPCOLESTR pstrItemName,
            [in] IUnknown *punkContext,
            [in] LPCOLESTR pstrDelimiter,
            [in] DWORD dwSourceContextCookie,
            [in] ULONG ulStartingLineNumber,
            [in] DWORD dwFlags,
            [out] IDispatch **ppdisp
    );
}

443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471
[
    object,
    uuid(c64713b6-e029-4cc5-9200-438b72890b6a),
    pointer_default(unique)
]
interface IActiveScriptParseProcedure64 : IUnknown
{
    HRESULT ParseProcedureText(
            [in] LPCOLESTR pstrCode,
            [in] LPCOLESTR pstrFormalParams,
            [in] LPCOLESTR pstrProcedureName,
            [in] LPCOLESTR pstrItemName,
            [in] IUnknown *punkContext,
            [in] LPCOLESTR pstrDelimiter,
            [in] DWORDLONG dwSourceContextCookie,
            [in] ULONG ulStartingLineNumber,
            [in] DWORD dwFlags,
            [out] IDispatch **ppdisp
    );
}

cpp_quote("#ifdef _WIN64")
cpp_quote("#define IActiveScriptParseProcedure IActiveScriptParseProcedure64")
cpp_quote("#define IID_IActiveScriptParseProcedure IID_IActiveScriptParseProcedure64")
cpp_quote("#else")
cpp_quote("#define IActiveScriptParseProcedure IActiveScriptParseProcedure32")
cpp_quote("#define IID_IActiveScriptParseProcedure IID_IActiveScriptParseProcedure32")
cpp_quote("#endif")

472 473 474 475 476
[
    object,
    uuid(71ee5b20-fb04-11d1-b3a8-00a0c911e8b2),
    pointer_default(unique)
]
477 478 479 480 481 482 483 484 485 486
interface IActiveScriptParseProcedure2_32 : IActiveScriptParseProcedure32
{
}

[
    object,
    uuid(fe7c4271-210c-448d-9f54-76dab7047b28),
    pointer_default(unique)
]
interface IActiveScriptParseProcedure2_64 : IActiveScriptParseProcedure64
487 488 489
{
}

490 491 492 493 494 495 496 497
cpp_quote("#ifdef _WIN64")
cpp_quote("#define IActiveScriptParseProcedure2 IActiveScriptParseProcedure2_64")
cpp_quote("#define IID_IActiveScriptParseProcedure2 IID_IActiveScriptParseProcedure2_64")
cpp_quote("#else")
cpp_quote("#define IActiveScriptParseProcedure2 IActiveScriptParseProcedure2_32")
cpp_quote("#define IID_IActiveScriptParseProcedure2 IID_IActiveScriptParseProcedure2_32")
cpp_quote("#endif")

498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531
[
object,
uuid(63CDBCB0-C1B1-11d0-9336-00A0C90DCAA9),
pointer_default(unique)
]
interface IBindEventHandler : IUnknown
{
    HRESULT BindHandler(
            [in] LPCOLESTR pstrEvent,
            [in] IDispatch *pdisp
    );
}

[
object,
uuid(B8DA6310-E19B-11d0-933C-00A0C90DCAA9),
pointer_default(unique)
]
interface IActiveScriptStats : IUnknown
{
    HRESULT GetStat(
            [in] DWORD stid,
            [out] ULONG *pluHi,
            [out] ULONG *pluLo
    );

    HRESULT GetStatEx(
            [in] REFGUID guid,
            [out] ULONG *pluHi,
            [out] ULONG *pluLo
    );

    HRESULT ResetStats(void);
}
532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549

[
    object,
    uuid(4954e0d0-fbc7-11d1-8410-006008c3fbfc),
    pointer_default(unique)
]
interface IActiveScriptProperty : IUnknown
{
    HRESULT GetProperty(
            [in] DWORD dwProperty,
            [in] VARIANT *pvarIndex,
            [out] VARIANT *pvarValue);

    HRESULT SetProperty(
            [in] DWORD dwProperty,
            [in] VARIANT *pvarIndex,
            [in] VARIANT *pvarValue);
}