- huge COM cleanup: only keep dmusic8 version of interfaces when they
[wine/wine-kai.git] / dlls / shdocvw / events.c
blob08b1544cedc3aa1a7e4e412e2bd0c3bd28744c1c
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 /**********************************************************************
32 * Implement the IConnectionPointContainer interface
35 static HRESULT WINAPI WBCPC_QueryInterface(LPCONNECTIONPOINTCONTAINER iface,
36 REFIID riid, LPVOID *ppobj)
38 ICOM_THIS(IConnectionPointContainerImpl, iface);
40 FIXME("(%p)->(%s,%p),stub!\n", This, debugstr_guid(riid), ppobj);
41 return E_NOINTERFACE;
44 static ULONG WINAPI WBCPC_AddRef(LPCONNECTIONPOINTCONTAINER iface)
46 ICOM_THIS(IConnectionPointContainerImpl, iface);
48 TRACE("\n");
49 return ++(This->ref);
52 static ULONG WINAPI WBCPC_Release(LPCONNECTIONPOINTCONTAINER iface)
54 ICOM_THIS(IConnectionPointContainerImpl, iface);
56 /* static class, won't be freed */
57 TRACE("\n");
58 return --(This->ref);
61 /* Get a list of connection points inside this container. */
62 static HRESULT WINAPI WBCPC_EnumConnectionPoints(LPCONNECTIONPOINTCONTAINER iface,
63 LPENUMCONNECTIONPOINTS *ppEnum)
65 FIXME("stub: IEnumConnectionPoints = %p\n", *ppEnum);
66 return S_OK;
69 /* Retrieve the connection point in this container associated with the
70 * riid interface. When events occur in the control, the control can
71 * call backwards into its embedding site, through these interfaces.
73 static HRESULT WINAPI WBCPC_FindConnectionPoint(LPCONNECTIONPOINTCONTAINER iface,
74 REFIID riid, LPCONNECTIONPOINT *ppCP)
76 TRACE(": IID = %s, IConnectionPoint = %p\n", debugstr_guid(riid), *ppCP);
78 /* For now, return the same IConnectionPoint object for both
79 * event interface requests.
81 if (IsEqualGUID (&IID_INotifyDBEvents, riid))
83 TRACE("Returning connection point %p for IID_INotifyDBEvents\n",
84 &SHDOCVW_ConnectionPoint);
85 *ppCP = (LPCONNECTIONPOINT)&SHDOCVW_ConnectionPoint;
86 return S_OK;
88 else if (IsEqualGUID (&IID_IPropertyNotifySink, riid))
90 TRACE("Returning connection point %p for IID_IPropertyNotifySink\n",
91 &SHDOCVW_ConnectionPoint);
92 *ppCP = (LPCONNECTIONPOINT)&SHDOCVW_ConnectionPoint;
93 return S_OK;
96 return E_FAIL;
99 /**********************************************************************
100 * IConnectionPointContainer virtual function table for IE Web Browser component
103 static ICOM_VTABLE(IConnectionPointContainer) WBCPC_Vtbl =
105 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
106 WBCPC_QueryInterface,
107 WBCPC_AddRef,
108 WBCPC_Release,
109 WBCPC_EnumConnectionPoints,
110 WBCPC_FindConnectionPoint
113 IConnectionPointContainerImpl SHDOCVW_ConnectionPointContainer = { &WBCPC_Vtbl, 1 };
116 /**********************************************************************
117 * Implement the IConnectionPoint interface
120 static HRESULT WINAPI WBCP_QueryInterface(LPCONNECTIONPOINT iface,
121 REFIID riid, LPVOID *ppobj)
123 ICOM_THIS(IConnectionPointImpl, iface);
125 FIXME("(%p)->(%s,%p),stub!\n", This, debugstr_guid(riid), ppobj);
126 return E_NOINTERFACE;
129 static ULONG WINAPI WBCP_AddRef(LPCONNECTIONPOINT iface)
131 ICOM_THIS(IConnectionPointImpl, iface);
133 TRACE("\n");
134 return ++(This->ref);
137 static ULONG WINAPI WBCP_Release(LPCONNECTIONPOINT iface)
139 ICOM_THIS(IConnectionPointImpl, iface);
141 /* static class, won't be freed */
142 TRACE("\n");
143 return --(This->ref);
146 static HRESULT WINAPI WBCP_GetConnectionInterface(LPCONNECTIONPOINT iface, IID* pIId)
148 FIXME("stub: %s\n", debugstr_guid(pIId));
149 return S_OK;
152 /* Get this connection point's owning container */
153 static HRESULT WINAPI
154 WBCP_GetConnectionPointContainer(LPCONNECTIONPOINT iface,
155 LPCONNECTIONPOINTCONTAINER *ppCPC)
157 FIXME("stub: IConnectionPointContainer = %p\n", *ppCPC);
158 return S_OK;
161 /* Connect the pUnkSink event-handling implementation (in the control site)
162 * to this connection point. Return a handle to this connection in
163 * pdwCookie (for later use in Unadvise()).
165 static HRESULT WINAPI WBCP_Advise(LPCONNECTIONPOINT iface,
166 LPUNKNOWN pUnkSink, DWORD *pdwCookie)
168 static int new_cookie;
170 FIXME("stub: IUnknown = %p, connection cookie = %ld\n", pUnkSink, *pdwCookie);
172 *pdwCookie = ++new_cookie;
173 TRACE ("Returning cookie = %ld\n", *pdwCookie);
175 return S_OK;
178 /* Disconnect this implementation from the connection point. */
179 static HRESULT WINAPI WBCP_Unadvise(LPCONNECTIONPOINT iface,
180 DWORD dwCookie)
182 FIXME("stub: cookie to disconnect = %lx\n", dwCookie);
183 return S_OK;
186 /* Get a list of connections in this connection point. */
187 static HRESULT WINAPI WBCP_EnumConnections(LPCONNECTIONPOINT iface,
188 LPENUMCONNECTIONS *ppEnum)
190 FIXME("stub: IEnumConnections = %p\n", *ppEnum);
191 return S_OK;
194 /**********************************************************************
195 * IConnectionPoint virtual function table for IE Web Browser component
198 static ICOM_VTABLE(IConnectionPoint) WBCP_Vtbl =
200 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
201 WBCP_QueryInterface,
202 WBCP_AddRef,
203 WBCP_Release,
204 WBCP_GetConnectionInterface,
205 WBCP_GetConnectionPointContainer,
206 WBCP_Advise,
207 WBCP_Unadvise,
208 WBCP_EnumConnections
211 IConnectionPointImpl SHDOCVW_ConnectionPoint = { &WBCP_Vtbl, 1 };