Removed some uses of the non-standard ICOM_THIS macro.
[wine/multimedia.git] / dlls / shdocvw / events.c
blob9f6a8f9e3f2ede676eda6ff8257fa917e1d09a67
1 /*
2 * Implementation of event-related interfaces for IE Web Browser control:
4 * - IConnectionPointContainer
5 * - IConnectionPoint
7 * Copyright 2001 John R. Sheets (for CodeWeavers)
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #include <string.h>
25 #include "wine/debug.h"
26 #include "shdocvw.h"
28 WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
31 static const GUID IID_INotifyDBEvents =
32 { 0xdb526cc0, 0xd188, 0x11cd, { 0xad, 0x48, 0x00, 0xaa, 0x00, 0x3c, 0x9c, 0xb6 } };
34 /**********************************************************************
35 * Implement the IConnectionPointContainer interface
38 static HRESULT WINAPI WBCPC_QueryInterface(LPCONNECTIONPOINTCONTAINER iface,
39 REFIID riid, LPVOID *ppobj)
41 IConnectionPointContainerImpl *This = (IConnectionPointContainerImpl *)iface;
43 FIXME("(%p)->(%s,%p),stub!\n", This, debugstr_guid(riid), ppobj);
44 return E_NOINTERFACE;
47 static ULONG WINAPI WBCPC_AddRef(LPCONNECTIONPOINTCONTAINER iface)
49 IConnectionPointContainerImpl *This = (IConnectionPointContainerImpl *)iface;
51 TRACE("\n");
52 return ++(This->ref);
55 static ULONG WINAPI WBCPC_Release(LPCONNECTIONPOINTCONTAINER iface)
57 IConnectionPointContainerImpl *This = (IConnectionPointContainerImpl *)iface;
59 /* static class, won't be freed */
60 TRACE("\n");
61 return --(This->ref);
64 /* Get a list of connection points inside this container. */
65 static HRESULT WINAPI WBCPC_EnumConnectionPoints(LPCONNECTIONPOINTCONTAINER iface,
66 LPENUMCONNECTIONPOINTS *ppEnum)
68 FIXME("stub: IEnumConnectionPoints = %p\n", *ppEnum);
69 return S_OK;
72 /* Retrieve the connection point in this container associated with the
73 * riid interface. When events occur in the control, the control can
74 * call backwards into its embedding site, through these interfaces.
76 static HRESULT WINAPI WBCPC_FindConnectionPoint(LPCONNECTIONPOINTCONTAINER iface,
77 REFIID riid, LPCONNECTIONPOINT *ppCP)
79 TRACE(": IID = %s, IConnectionPoint = %p\n", debugstr_guid(riid), *ppCP);
81 /* For now, return the same IConnectionPoint object for both
82 * event interface requests.
84 if (IsEqualGUID (&IID_INotifyDBEvents, riid))
86 TRACE("Returning connection point %p for IID_INotifyDBEvents\n",
87 &SHDOCVW_ConnectionPoint);
88 *ppCP = (LPCONNECTIONPOINT)&SHDOCVW_ConnectionPoint;
89 return S_OK;
91 else if (IsEqualGUID (&IID_IPropertyNotifySink, riid))
93 TRACE("Returning connection point %p for IID_IPropertyNotifySink\n",
94 &SHDOCVW_ConnectionPoint);
95 *ppCP = (LPCONNECTIONPOINT)&SHDOCVW_ConnectionPoint;
96 return S_OK;
99 return E_FAIL;
102 /**********************************************************************
103 * IConnectionPointContainer virtual function table for IE Web Browser component
106 static IConnectionPointContainerVtbl WBCPC_Vtbl =
108 WBCPC_QueryInterface,
109 WBCPC_AddRef,
110 WBCPC_Release,
111 WBCPC_EnumConnectionPoints,
112 WBCPC_FindConnectionPoint
115 IConnectionPointContainerImpl SHDOCVW_ConnectionPointContainer = { &WBCPC_Vtbl, 1 };
118 /**********************************************************************
119 * Implement the IConnectionPoint interface
122 static HRESULT WINAPI WBCP_QueryInterface(LPCONNECTIONPOINT iface,
123 REFIID riid, LPVOID *ppobj)
125 IConnectionPointImpl *This = (IConnectionPointImpl *)iface;
127 FIXME("(%p)->(%s,%p),stub!\n", This, debugstr_guid(riid), ppobj);
128 return E_NOINTERFACE;
131 static ULONG WINAPI WBCP_AddRef(LPCONNECTIONPOINT iface)
133 IConnectionPointImpl *This = (IConnectionPointImpl *)iface;
135 TRACE("\n");
136 return ++(This->ref);
139 static ULONG WINAPI WBCP_Release(LPCONNECTIONPOINT iface)
141 IConnectionPointImpl *This = (IConnectionPointImpl *)iface;
143 /* static class, won't be freed */
144 TRACE("\n");
145 return --(This->ref);
148 static HRESULT WINAPI WBCP_GetConnectionInterface(LPCONNECTIONPOINT iface, IID* pIId)
150 FIXME("stub: %s\n", debugstr_guid(pIId));
151 return S_OK;
154 /* Get this connection point's owning container */
155 static HRESULT WINAPI
156 WBCP_GetConnectionPointContainer(LPCONNECTIONPOINT iface,
157 LPCONNECTIONPOINTCONTAINER *ppCPC)
159 FIXME("stub: IConnectionPointContainer = %p\n", *ppCPC);
160 return S_OK;
163 /* Connect the pUnkSink event-handling implementation (in the control site)
164 * to this connection point. Return a handle to this connection in
165 * pdwCookie (for later use in Unadvise()).
167 static HRESULT WINAPI WBCP_Advise(LPCONNECTIONPOINT iface,
168 LPUNKNOWN pUnkSink, DWORD *pdwCookie)
170 static int new_cookie;
172 FIXME("stub: IUnknown = %p, connection cookie = %ld\n", pUnkSink, *pdwCookie);
174 *pdwCookie = ++new_cookie;
175 TRACE ("Returning cookie = %ld\n", *pdwCookie);
177 return S_OK;
180 /* Disconnect this implementation from the connection point. */
181 static HRESULT WINAPI WBCP_Unadvise(LPCONNECTIONPOINT iface,
182 DWORD dwCookie)
184 FIXME("stub: cookie to disconnect = %lx\n", dwCookie);
185 return S_OK;
188 /* Get a list of connections in this connection point. */
189 static HRESULT WINAPI WBCP_EnumConnections(LPCONNECTIONPOINT iface,
190 LPENUMCONNECTIONS *ppEnum)
192 FIXME("stub: IEnumConnections = %p\n", *ppEnum);
193 return S_OK;
196 /**********************************************************************
197 * IConnectionPoint virtual function table for IE Web Browser component
200 static IConnectionPointVtbl WBCP_Vtbl =
202 WBCP_QueryInterface,
203 WBCP_AddRef,
204 WBCP_Release,
205 WBCP_GetConnectionInterface,
206 WBCP_GetConnectionPointContainer,
207 WBCP_Advise,
208 WBCP_Unadvise,
209 WBCP_EnumConnections
212 IConnectionPointImpl SHDOCVW_ConnectionPoint = { &WBCP_Vtbl, 1 };