/*
 * 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
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 */

#ifndef DO_NO_IMPORTS
import "ocidl.idl";
import "oleidl.idl";
import "oaidl.idl";
import "servprov.idl";
#endif

cpp_quote("DEFINE_GUID(SID_VariantConversion, 0x1f101481,0xbccd,0x11d0,0x93,0x36,0x00,0xa0,0xc9,0xd,0xca,0xa9);")
cpp_quote("DEFINE_GUID(SID_GetCaller, 0x4717cc40,0xbcb9,0x11d0,0x93,0x36,0x00,0xa0,0xc9,0xd,0xca,0xa9);")

cpp_quote("#define fdexNameCaseSensitive       0x00000001L")
cpp_quote("#define fdexNameEnsure              0x00000002L")
cpp_quote("#define fdexNameImplicit            0x00000004L")
cpp_quote("#define fdexNameCaseInsensitive     0x00000008L")
cpp_quote("#define fdexNameInternal            0x00000010L")
cpp_quote("#define fdexNameNoDynamicProperties 0x00000020L")

cpp_quote("#define fdexPropCanGet              0x00000001L")
cpp_quote("#define fdexPropCannotGet           0x00000002L")
cpp_quote("#define fdexPropCanPut              0x00000004L")
cpp_quote("#define fdexPropCannotPut           0x00000008L")
cpp_quote("#define fdexPropCanPutRef           0x00000010L")
cpp_quote("#define fdexPropCannotPutRef        0x00000020L")
cpp_quote("#define fdexPropNoSideEffects       0x00000040L")
cpp_quote("#define fdexPropDynamicType         0x00000080L")
cpp_quote("#define fdexPropCanCall             0x00000100L")
cpp_quote("#define fdexPropCannotCall          0x00000200L")
cpp_quote("#define fdexPropCanConstruct        0x00000400L")
cpp_quote("#define fdexPropCannotConstruct     0x00000800L")
cpp_quote("#define fdexPropCanSourceEvents     0x00001000L")
cpp_quote("#define fdexPropCannotSourceEvents  0x00002000L")

cpp_quote("#define fdexEnumDefault             0x00000001L")
cpp_quote("#define fdexEnumAll                 0x00000002L")

cpp_quote("#define grfdexPropCanAll \\")
cpp_quote("       (fdexPropCanGet | fdexPropCanPut | fdexPropCanPutRef | \\")
cpp_quote("        fdexPropCanCall | fdexPropCanConstruct | fdexPropCanSourceEvents)")
cpp_quote("#define grfdexPropCannotAll \\")
cpp_quote("       (fdexPropCannotGet | fdexPropCannotPut | fdexPropCannotPutRef | \\")
cpp_quote("        fdexPropCannotCall | fdexPropCannotConstruct | fdexPropCannotSourceEvents)")
cpp_quote("#define grfdexPropExtraAll \\")
cpp_quote("       (fdexPropNoSideEffects | fdexPropDynamicType)")
cpp_quote("#define grfdexPropAll \\")
cpp_quote("       (grfdexPropCanAll | grfdexPropCannotAll | grfdexPropExtraAll)")

cpp_quote("#define DISPATCH_CONSTRUCT 0x4000")

cpp_quote("#define DISPID_THIS (-613)")
cpp_quote("#define DISPID_STARTENUM DISPID_UNKNOWN")

[
object,
uuid(A6EF9860-C720-11d0-9337-00A0C90DCAA9),
pointer_default(unique)
]
interface IDispatchEx : IDispatch
{
    HRESULT GetDispID(
            [in] BSTR bstrName,
            [in] DWORD grfdex,
            [out] DISPID *pid);

    [local]
    HRESULT InvokeEx(
            [in, annotation("__in")] DISPID id,
            [in, annotation("__in")] LCID lcid,
            [in, annotation("__in")] WORD wFlags,
            [in, annotation("__in")] DISPPARAMS *pdp,
            [out, annotation("__out_opt")] VARIANT *pvarRes,
            [out, annotation("__out_opt")] EXCEPINFO *pei,
            [in, unique, annotation("__in_opt")] IServiceProvider *pspCaller);

    [call_as(InvokeEx)]
    HRESULT RemoteInvokeEx(
            [in] DISPID id,
            [in] LCID lcid,
            [in] DWORD dwFlags,
            [in] DISPPARAMS *pdp,
            [out] VARIANT *pvarRes,
            [out] EXCEPINFO *pei,
            [in, unique] IServiceProvider *pspCaller,
            [in] UINT cvarRefArg,
            [in, size_is(cvarRefArg)] UINT *rgiRefArg,
            [in, out, size_is(cvarRefArg)] VARIANT *rgvarRefArg);

    HRESULT DeleteMemberByName(
            [in] BSTR bstrName,
            [in] DWORD grfdex);

    HRESULT DeleteMemberByDispID(
            [in] DISPID id);

    HRESULT GetMemberProperties(
            [in] DISPID id,
            [in] DWORD grfdexFetch,
            [out] DWORD *pgrfdex);

    HRESULT GetMemberName(
            [in] DISPID id,
            [out] BSTR *pbstrName);

    HRESULT GetNextDispID(
            [in] DWORD grfdex,
            [in] DISPID id,
            [out] DISPID *pid);

    HRESULT GetNameSpaceParent([out] IUnknown **ppunk);
}

[
object,
uuid(A6EF9861-C720-11d0-9337-00A0C90DCAA9),
pointer_default(unique)
]
interface IDispError : IUnknown
{
    HRESULT QueryErrorInfo(
            [in] GUID guidErrorType,
            [out] IDispError **ppde);

    HRESULT GetNext(
            [out] IDispError **ppde);

    HRESULT GetHresult(
            [out] HRESULT *phr);

    HRESULT GetSource(
            [out] BSTR *pbstrSource);

    HRESULT GetHelpInfo(
            [out] BSTR *pbstrFileName,
            [out] DWORD *pdwContext);

    HRESULT GetDescription(
            [out] BSTR *pbstrDescription);
}

[
object,
uuid(A6EF9862-C720-11d0-9337-00A0C90DCAA9),
pointer_default(unique)
]
interface IVariantChangeType : IUnknown
{
    HRESULT ChangeType(
            [in, out, unique] VARIANT *pvarDst,
            [in, unique] VARIANT *pvarSrc,
            [in] LCID lcid,
            [in] VARTYPE vtNew);
}


[
object,
uuid(CA04B7E6-0D21-11d1-8CC5-00C04FC2B085),
pointer_default(unique)
]
interface IObjectIdentity : IUnknown
{
    HRESULT IsEqualObject( 
            [in] IUnknown *punk);
}

[
    object,
    uuid(c5598e60-b307-11d1-b27d-006008c3fbfb),
    pointer_default(unique)
]
interface ICanHandleException : IUnknown
{
    HRESULT CanHandleException(
            [in] EXCEPINFO *pExcepInfo,
            [in] VARIANT *pvar);
}

[
    object,
    uuid(10e2414a-ec59-49d2-bc51-5add2c36febc),
    pointer_default(unique)
]
interface IProvideRuntimeContext : IUnknown
{
    HRESULT GetCurrentSourceContext(
            [out] DWORD_PTR *pdwContext,
            [out] VARIANT_BOOL *pfExecutingGlobalCode);
}