Fix typo in OUTLINETEXTMETRIC definition.
[wine.git] / dlls / shdocvw / events.c
blobc2259d97b484933feeaf267539b1b12b82caa8f9
1 /*
2 * Implementation of event-related interfaces for IE Web Browser control:
4 * - IConnectionPointContainer
5 * - IConnectionPoint
7 * 2001 John R. Sheets (for CodeWeavers)
8 */
10 #include <string.h>
11 #include "debugtools.h"
12 #include "shdocvw.h"
14 DEFAULT_DEBUG_CHANNEL(shdocvw);
17 /**********************************************************************
18 * Implement the IConnectionPointContainer interface
21 static HRESULT WINAPI WBCPC_QueryInterface(LPCONNECTIONPOINTCONTAINER iface,
22 REFIID riid, LPVOID *ppobj)
24 ICOM_THIS(IConnectionPointContainerImpl, iface);
26 FIXME("(%p)->(%s,%p),stub!\n", This, debugstr_guid(riid), ppobj);
27 return E_NOINTERFACE;
30 static ULONG WINAPI WBCPC_AddRef(LPCONNECTIONPOINTCONTAINER iface)
32 ICOM_THIS(IConnectionPointContainerImpl, iface);
34 TRACE("\n");
35 return ++(This->ref);
38 static ULONG WINAPI WBCPC_Release(LPCONNECTIONPOINTCONTAINER iface)
40 ICOM_THIS(IConnectionPointContainerImpl, iface);
42 /* static class, won't be freed */
43 TRACE("\n");
44 return --(This->ref);
47 /* Get a list of connection points inside this container. */
48 static HRESULT WINAPI WBCPC_EnumConnectionPoints(LPCONNECTIONPOINTCONTAINER iface,
49 LPENUMCONNECTIONPOINTS *ppEnum)
51 FIXME("stub: IEnumConnectionPoints = %p\n", *ppEnum);
52 return S_OK;
55 /* Retrieve the connection point in this container associated with the
56 * riid interface. When events occur in the control, the control can
57 * call backwards into its embedding site, through these interfaces.
59 static HRESULT WINAPI WBCPC_FindConnectionPoint(LPCONNECTIONPOINTCONTAINER iface,
60 REFIID riid, LPCONNECTIONPOINT *ppCP)
62 TRACE(": IID = %s, IConnectionPoint = %p\n", debugstr_guid(riid), *ppCP);
64 /* For now, return the same IConnectionPoint object for both
65 * event interface requests.
67 if (IsEqualGUID (&IID_INotifyDBEvents, riid))
69 TRACE("Returning connection point %p for IID_INotifyDBEvents\n",
70 &SHDOCVW_ConnectionPoint);
71 *ppCP = (LPCONNECTIONPOINT)&SHDOCVW_ConnectionPoint;
72 return S_OK;
74 else if (IsEqualGUID (&IID_IPropertyNotifySink, riid))
76 TRACE("Returning connection point %p for IID_IPropertyNotifySink\n",
77 &SHDOCVW_ConnectionPoint);
78 *ppCP = (LPCONNECTIONPOINT)&SHDOCVW_ConnectionPoint;
79 return S_OK;
82 return E_FAIL;
85 /**********************************************************************
86 * IConnectionPointContainer virtual function table for IE Web Browser component
89 static ICOM_VTABLE(IConnectionPointContainer) WBCPC_Vtbl =
91 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
92 WBCPC_QueryInterface,
93 WBCPC_AddRef,
94 WBCPC_Release,
95 WBCPC_EnumConnectionPoints,
96 WBCPC_FindConnectionPoint
99 IConnectionPointContainerImpl SHDOCVW_ConnectionPointContainer = { &WBCPC_Vtbl, 1 };
102 /**********************************************************************
103 * Implement the IConnectionPoint interface
106 static HRESULT WINAPI WBCP_QueryInterface(LPCONNECTIONPOINT iface,
107 REFIID riid, LPVOID *ppobj)
109 ICOM_THIS(IConnectionPointImpl, iface);
111 FIXME("(%p)->(%s,%p),stub!\n", This, debugstr_guid(riid), ppobj);
112 return E_NOINTERFACE;
115 static ULONG WINAPI WBCP_AddRef(LPCONNECTIONPOINT iface)
117 ICOM_THIS(IConnectionPointImpl, iface);
119 TRACE("\n");
120 return ++(This->ref);
123 static ULONG WINAPI WBCP_Release(LPCONNECTIONPOINT iface)
125 ICOM_THIS(IConnectionPointImpl, iface);
127 /* static class, won't be freed */
128 TRACE("\n");
129 return --(This->ref);
132 static HRESULT WINAPI WBCP_GetConnectionInterface(LPCONNECTIONPOINT iface, IID* pIId)
134 FIXME("stub: %s\n", debugstr_guid(pIId));
135 return S_OK;
138 /* Get this connection point's owning container */
139 static HRESULT WINAPI
140 WBCP_GetConnectionPointContainer(LPCONNECTIONPOINT iface,
141 LPCONNECTIONPOINTCONTAINER *ppCPC)
143 FIXME("stub: IConnectionPointContainer = %p\n", *ppCPC);
144 return S_OK;
147 /* Connect the pUnkSink event-handling implementation (in the control site)
148 * to this connection point. Return a handle to this connection in
149 * pdwCookie (for later use in Unadvise()).
151 static HRESULT WINAPI WBCP_Advise(LPCONNECTIONPOINT iface,
152 LPUNKNOWN pUnkSink, DWORD *pdwCookie)
154 static int new_cookie;
156 FIXME("stub: IUnknown = %p, connection cookie = %ld\n", pUnkSink, *pdwCookie);
158 *pdwCookie = ++new_cookie;
159 TRACE ("Returning cookie = %ld\n", *pdwCookie);
161 return S_OK;
164 /* Disconnect this implementation from the connection point. */
165 static HRESULT WINAPI WBCP_Unadvise(LPCONNECTIONPOINT iface,
166 DWORD dwCookie)
168 FIXME("stub: cookie to disconnect = %ld\n", dwCookie);
169 return S_OK;
172 /* Get a list of connections in this connection point. */
173 static HRESULT WINAPI WBCP_EnumConnections(LPCONNECTIONPOINT iface,
174 LPENUMCONNECTIONS *ppEnum)
176 FIXME("stub: IEnumConnections = %p\n", *ppEnum);
177 return S_OK;
180 /**********************************************************************
181 * IConnectionPoint virtual function table for IE Web Browser component
184 static ICOM_VTABLE(IConnectionPoint) WBCP_Vtbl =
186 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
187 WBCP_QueryInterface,
188 WBCP_AddRef,
189 WBCP_Release,
190 WBCP_GetConnectionInterface,
191 WBCP_GetConnectionPointContainer,
192 WBCP_Advise,
193 WBCP_Unadvise,
194 WBCP_EnumConnections
197 IConnectionPointImpl SHDOCVW_ConnectionPoint = { &WBCP_Vtbl, 1 };